Average Error: 2.1 → 1.5
Time: 10.8s
Precision: 64
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\[\begin{array}{l} \mathbf{if}\;b \le -6.54960850931727249254048187521432331082 \cdot 10^{65}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(a \cdot z\right)\right) \cdot \sqrt[3]{b}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right) + \left(x + y \cdot z\right)\\ \end{array}\]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\begin{array}{l}
\mathbf{if}\;b \le -6.54960850931727249254048187521432331082 \cdot 10^{65}:\\
\;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(a \cdot z\right)\right) \cdot \sqrt[3]{b}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right) + \left(x + y \cdot z\right)\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r433647 = x;
        double r433648 = y;
        double r433649 = z;
        double r433650 = r433648 * r433649;
        double r433651 = r433647 + r433650;
        double r433652 = t;
        double r433653 = a;
        double r433654 = r433652 * r433653;
        double r433655 = r433651 + r433654;
        double r433656 = r433653 * r433649;
        double r433657 = b;
        double r433658 = r433656 * r433657;
        double r433659 = r433655 + r433658;
        return r433659;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r433660 = b;
        double r433661 = -6.5496085093172725e+65;
        bool r433662 = r433660 <= r433661;
        double r433663 = x;
        double r433664 = y;
        double r433665 = z;
        double r433666 = r433664 * r433665;
        double r433667 = r433663 + r433666;
        double r433668 = t;
        double r433669 = a;
        double r433670 = r433668 * r433669;
        double r433671 = r433667 + r433670;
        double r433672 = cbrt(r433660);
        double r433673 = r433672 * r433672;
        double r433674 = r433669 * r433665;
        double r433675 = r433673 * r433674;
        double r433676 = r433675 * r433672;
        double r433677 = r433671 + r433676;
        double r433678 = r433665 * r433660;
        double r433679 = r433668 + r433678;
        double r433680 = r433669 * r433679;
        double r433681 = r433680 + r433667;
        double r433682 = r433662 ? r433677 : r433681;
        return r433682;
}

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.1
Target0.4
Herbie1.5
\[\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. Split input into 2 regimes
  2. if b < -6.5496085093172725e+65

    1. Initial program 0.5

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot \color{blue}{\left(\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \sqrt[3]{b}\right)}\]
    4. Applied associate-*r*0.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot \sqrt[3]{b}}\]
    5. Simplified0.9

      \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \color{blue}{\left(\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(a \cdot z\right)\right)} \cdot \sqrt[3]{b}\]

    if -6.5496085093172725e+65 < b

    1. Initial program 2.4

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
    2. Simplified1.6

      \[\leadsto \color{blue}{a \cdot \left(t + z \cdot b\right) + \left(x + y \cdot z\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -6.54960850931727249254048187521432331082 \cdot 10^{65}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(a \cdot z\right)\right) \cdot \sqrt[3]{b}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(t + z \cdot b\right) + \left(x + y \cdot z\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.75897431883642871e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

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