Average Error: 1.3 → 1.7
Time: 23.0s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + y \cdot \left(\left(\frac{z}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right) + \left(\frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right)\right)\]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \left(\left(\frac{z}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right) + \left(\frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r674539 = x;
        double r674540 = y;
        double r674541 = z;
        double r674542 = t;
        double r674543 = r674541 - r674542;
        double r674544 = a;
        double r674545 = r674544 - r674542;
        double r674546 = r674543 / r674545;
        double r674547 = r674540 * r674546;
        double r674548 = r674539 + r674547;
        return r674548;
}

double f(double x, double y, double z, double t, double a) {
        double r674549 = x;
        double r674550 = y;
        double r674551 = z;
        double r674552 = a;
        double r674553 = t;
        double r674554 = r674552 - r674553;
        double r674555 = r674551 / r674554;
        double r674556 = cbrt(r674553);
        double r674557 = 3.0;
        double r674558 = pow(r674556, r674557);
        double r674559 = r674558 / r674554;
        double r674560 = r674555 - r674559;
        double r674561 = r674559 - r674559;
        double r674562 = r674560 + r674561;
        double r674563 = r674550 * r674562;
        double r674564 = r674549 + r674563;
        return r674564;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.3
Target0.4
Herbie1.7
\[\begin{array}{l} \mathbf{if}\;y \lt -8.50808486055124107 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.8944268627920891 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Initial program 1.3

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Using strategy rm
  3. Applied div-sub1.3

    \[\leadsto x + y \cdot \color{blue}{\left(\frac{z}{a - t} - \frac{t}{a - t}\right)}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity1.3

    \[\leadsto x + y \cdot \left(\frac{z}{a - t} - \frac{t}{\color{blue}{1 \cdot \left(a - t\right)}}\right)\]
  6. Applied add-cube-cbrt1.6

    \[\leadsto x + y \cdot \left(\frac{z}{a - t} - \frac{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}{1 \cdot \left(a - t\right)}\right)\]
  7. Applied times-frac1.6

    \[\leadsto x + y \cdot \left(\frac{z}{a - t} - \color{blue}{\frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1} \cdot \frac{\sqrt[3]{t}}{a - t}}\right)\]
  8. Applied add-sqr-sqrt26.3

    \[\leadsto x + y \cdot \left(\color{blue}{\sqrt{\frac{z}{a - t}} \cdot \sqrt{\frac{z}{a - t}}} - \frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1} \cdot \frac{\sqrt[3]{t}}{a - t}\right)\]
  9. Applied prod-diff26.3

    \[\leadsto x + y \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt{\frac{z}{a - t}}, \sqrt{\frac{z}{a - t}}, -\frac{\sqrt[3]{t}}{a - t} \cdot \frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1}\right) + \mathsf{fma}\left(-\frac{\sqrt[3]{t}}{a - t}, \frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1}, \frac{\sqrt[3]{t}}{a - t} \cdot \frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1}\right)\right)}\]
  10. Simplified1.7

    \[\leadsto x + y \cdot \left(\color{blue}{\left(\frac{z}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right)} + \mathsf{fma}\left(-\frac{\sqrt[3]{t}}{a - t}, \frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1}, \frac{\sqrt[3]{t}}{a - t} \cdot \frac{\sqrt[3]{t} \cdot \sqrt[3]{t}}{1}\right)\right)\]
  11. Simplified1.7

    \[\leadsto x + y \cdot \left(\left(\frac{z}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right) + \color{blue}{\left(\frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right)}\right)\]
  12. Final simplification1.7

    \[\leadsto x + y \cdot \left(\left(\frac{z}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right) + \left(\frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t} - \frac{{\left(\sqrt[3]{t}\right)}^{3}}{a - t}\right)\right)\]

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

  (+ x (* y (/ (- z t) (- a t)))))