Average Error: 2.3 → 1.0
Time: 4.0s
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}\;a \le -7.2988430988256025 \cdot 10^{-174} \lor \neg \left(a \le 6.57391704924192805 \cdot 10^{-69}\right):\\ \;\;\;\;\left(x + y \cdot z\right) + a \cdot \left(z \cdot b + t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(\left(a \cdot z\right) \cdot \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right)\right) \cdot \sqrt[3]{b}\\ \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}\;a \le -7.2988430988256025 \cdot 10^{-174} \lor \neg \left(a \le 6.57391704924192805 \cdot 10^{-69}\right):\\
\;\;\;\;\left(x + y \cdot z\right) + a \cdot \left(z \cdot b + t\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r768156 = x;
        double r768157 = y;
        double r768158 = z;
        double r768159 = r768157 * r768158;
        double r768160 = r768156 + r768159;
        double r768161 = t;
        double r768162 = a;
        double r768163 = r768161 * r768162;
        double r768164 = r768160 + r768163;
        double r768165 = r768162 * r768158;
        double r768166 = b;
        double r768167 = r768165 * r768166;
        double r768168 = r768164 + r768167;
        return r768168;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r768169 = a;
        double r768170 = -7.2988430988256025e-174;
        bool r768171 = r768169 <= r768170;
        double r768172 = 6.573917049241928e-69;
        bool r768173 = r768169 <= r768172;
        double r768174 = !r768173;
        bool r768175 = r768171 || r768174;
        double r768176 = x;
        double r768177 = y;
        double r768178 = z;
        double r768179 = r768177 * r768178;
        double r768180 = r768176 + r768179;
        double r768181 = b;
        double r768182 = r768178 * r768181;
        double r768183 = t;
        double r768184 = r768182 + r768183;
        double r768185 = r768169 * r768184;
        double r768186 = r768180 + r768185;
        double r768187 = r768183 * r768169;
        double r768188 = r768180 + r768187;
        double r768189 = r768169 * r768178;
        double r768190 = cbrt(r768181);
        double r768191 = r768190 * r768190;
        double r768192 = r768189 * r768191;
        double r768193 = r768192 * r768190;
        double r768194 = r768188 + r768193;
        double r768195 = r768175 ? r768186 : r768194;
        return r768195;
}

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
Herbie1.0
\[\begin{array}{l} \mathbf{if}\;z \lt -11820553527347888000:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{elif}\;z \lt 4.75897431883642871 \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 a < -7.2988430988256025e-174 or 6.573917049241928e-69 < a

    1. Initial program 3.4

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
    2. Using strategy rm
    3. Applied associate-+l+3.4

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)}\]
    4. Simplified1.2

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

    if -7.2988430988256025e-174 < a < 6.573917049241928e-69

    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.6

      \[\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.6

      \[\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}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.0

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

Reproduce

herbie shell --seed 2020065 
(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.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

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