Average Error: 1.3 → 2.3
Time: 24.7s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\frac{\frac{y}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}{\frac{\sqrt[3]{a - t}}{z - t}} + x\]
x + y \cdot \frac{z - t}{a - t}
\frac{\frac{y}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}{\frac{\sqrt[3]{a - t}}{z - t}} + x
double f(double x, double y, double z, double t, double a) {
        double r446489 = x;
        double r446490 = y;
        double r446491 = z;
        double r446492 = t;
        double r446493 = r446491 - r446492;
        double r446494 = a;
        double r446495 = r446494 - r446492;
        double r446496 = r446493 / r446495;
        double r446497 = r446490 * r446496;
        double r446498 = r446489 + r446497;
        return r446498;
}

double f(double x, double y, double z, double t, double a) {
        double r446499 = y;
        double r446500 = a;
        double r446501 = t;
        double r446502 = r446500 - r446501;
        double r446503 = cbrt(r446502);
        double r446504 = r446503 * r446503;
        double r446505 = r446499 / r446504;
        double r446506 = z;
        double r446507 = r446506 - r446501;
        double r446508 = r446503 / r446507;
        double r446509 = r446505 / r446508;
        double r446510 = x;
        double r446511 = r446509 + r446510;
        return r446511;
}

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
Herbie2.3
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241069024247453646278348229 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089097262541964056085749132 \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. Simplified1.3

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right)}\]
  3. Using strategy rm
  4. Applied clear-num1.4

    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{\frac{a - t}{z - t}}}, y, x\right)\]
  5. Using strategy rm
  6. Applied fma-udef1.4

    \[\leadsto \color{blue}{\frac{1}{\frac{a - t}{z - t}} \cdot y + x}\]
  7. Simplified1.3

    \[\leadsto \color{blue}{\frac{y}{\frac{a - t}{z - t}}} + x\]
  8. Using strategy rm
  9. Applied *-un-lft-identity1.3

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

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

    \[\leadsto \frac{y}{\color{blue}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{1} \cdot \frac{\sqrt[3]{a - t}}{z - t}}} + x\]
  12. Applied associate-/r*2.3

    \[\leadsto \color{blue}{\frac{\frac{y}{\frac{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}{1}}}{\frac{\sqrt[3]{a - t}}{z - t}}} + x\]
  13. Simplified2.3

    \[\leadsto \frac{\color{blue}{\frac{y}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}}{\frac{\sqrt[3]{a - t}}{z - t}} + x\]
  14. Final simplification2.3

    \[\leadsto \frac{\frac{y}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}}}{\frac{\sqrt[3]{a - t}}{z - t}} + x\]

Reproduce

herbie shell --seed 2019209 +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.50808486055124107e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.8944268627920891e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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