Average Error: 1.3 → 1.2
Time: 27.7s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\frac{y}{\frac{a - t}{z - t}} + x\]
x + y \cdot \frac{z - t}{a - t}
\frac{y}{\frac{a - t}{z - t}} + x
double f(double x, double y, double z, double t, double a) {
        double r417595 = x;
        double r417596 = y;
        double r417597 = z;
        double r417598 = t;
        double r417599 = r417597 - r417598;
        double r417600 = a;
        double r417601 = r417600 - r417598;
        double r417602 = r417599 / r417601;
        double r417603 = r417596 * r417602;
        double r417604 = r417595 + r417603;
        return r417604;
}

double f(double x, double y, double z, double t, double a) {
        double r417605 = y;
        double r417606 = a;
        double r417607 = t;
        double r417608 = r417606 - r417607;
        double r417609 = z;
        double r417610 = r417609 - r417607;
        double r417611 = r417608 / r417610;
        double r417612 = r417605 / r417611;
        double r417613 = x;
        double r417614 = r417612 + r417613;
        return r417614;
}

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.2
\[\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 clear-num1.3

    \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}}\]
  4. Using strategy rm
  5. Applied pow11.3

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

    \[\leadsto x + \color{blue}{{y}^{1}} \cdot {\left(\frac{1}{\frac{a - t}{z - t}}\right)}^{1}\]
  7. Applied pow-prod-down1.3

    \[\leadsto x + \color{blue}{{\left(y \cdot \frac{1}{\frac{a - t}{z - t}}\right)}^{1}}\]
  8. Simplified1.2

    \[\leadsto x + {\color{blue}{\left(\frac{y}{\frac{a - t}{z - t}}\right)}}^{1}\]
  9. Final simplification1.2

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

Reproduce

herbie shell --seed 2019199 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"

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

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