Average Error: 2.3 → 2.3
Time: 11.6s
Precision: 64
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
double f(double x, double y, double z, double t, double a, double b) {
        double r40341986 = x;
        double r40341987 = y;
        double r40341988 = z;
        double r40341989 = r40341987 * r40341988;
        double r40341990 = r40341986 + r40341989;
        double r40341991 = t;
        double r40341992 = a;
        double r40341993 = r40341991 * r40341992;
        double r40341994 = r40341990 + r40341993;
        double r40341995 = r40341992 * r40341988;
        double r40341996 = b;
        double r40341997 = r40341995 * r40341996;
        double r40341998 = r40341994 + r40341997;
        return r40341998;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r40341999 = x;
        double r40342000 = y;
        double r40342001 = z;
        double r40342002 = r40342000 * r40342001;
        double r40342003 = r40341999 + r40342002;
        double r40342004 = t;
        double r40342005 = a;
        double r40342006 = r40342004 * r40342005;
        double r40342007 = r40342003 + r40342006;
        double r40342008 = r40342005 * r40342001;
        double r40342009 = b;
        double r40342010 = r40342008 * r40342009;
        double r40342011 = r40342007 + r40342010;
        return r40342011;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.3
Target0.3
Herbie2.3
\[\begin{array}{l} \mathbf{if}\;z \lt -11820553527347888128:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{elif}\;z \lt 4.758974318836428710669076838657752600596 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \end{array}\]

Derivation

  1. Initial program 2.3

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
  2. Final simplification2.3

    \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]

Reproduce

herbie shell --seed 2019174 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"

  :herbie-target
  (if (< z -1.1820553527347888e+19) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))