Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  SkCubics.h

  Sprache: C
 

/*
 * Copyright 2023 Google LLC
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkCubics_DEFINED
#define SkCubics_DEFINED

#include <cmath>

/**
 * Utilities for dealing with cubic formulas with one variable:
 *   f(t) = A*t^3 + B*t^2 + C*t + d
 */

class SkCubics {
public:
    /**
     * Puts up to 3 real solutions to the equation
     *   A*t^3 + B*t^2 + C*t + d = 0
     * in the provided array and returns how many roots that was.
     */

    static int RootsReal(double A, double B, double C, double D,
                         double solution[3]);

    /**
     * Puts up to 3 real solutions to the equation
     *   A*t^3 + B*t^2 + C*t + D = 0
     * in the provided array, with the constraint that t is in the range [0.0, 1.0],
     * and returns how many roots that was.
     */

    static int RootsValidT(double A, double B, double C, double D,
                           double solution[3]);


    /**
     * Puts up to 3 real solutions to the equation
     *   A*t^3 + B*t^2 + C*t + D = 0
     * in the provided array, with the constraint that t is in the range [0.0, 1.0],
     * and returns how many roots that was.
     * This is a slower method than RootsValidT, but more accurate in circumstances
     * where floating point error gets too big.
     */

    static int BinarySearchRootsValidT(double A, double B, double C, double D,
                                       double solution[3]);

    /**
     * Evaluates the cubic function with the 4 provided coefficients and the
     * provided variable.
     */

    static double EvalAt(double A, double B, double C, double D, double t) {
        return std::fma(t, std::fma(t, std::fma(t, A, B), C), D);
    }

    static double EvalAt(double coefficients[4], double t) {
        return EvalAt(coefficients[0], coefficients[1], coefficients[2], coefficients[3], t);
    }
};

#endif

Messung V0.5 in Prozent
C=91 H=100 G=95

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002