Average Error: 1.2 → 1.2
Time: 5.7s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\frac{1}{\frac{\frac{a - t}{z - t}}{y}} + x\]
x + y \cdot \frac{z - t}{a - t}
\frac{1}{\frac{\frac{a - t}{z - t}}{y}} + x
double f(double x, double y, double z, double t, double a) {
        double r622485 = x;
        double r622486 = y;
        double r622487 = z;
        double r622488 = t;
        double r622489 = r622487 - r622488;
        double r622490 = a;
        double r622491 = r622490 - r622488;
        double r622492 = r622489 / r622491;
        double r622493 = r622486 * r622492;
        double r622494 = r622485 + r622493;
        return r622494;
}

double f(double x, double y, double z, double t, double a) {
        double r622495 = 1.0;
        double r622496 = a;
        double r622497 = t;
        double r622498 = r622496 - r622497;
        double r622499 = z;
        double r622500 = r622499 - r622497;
        double r622501 = r622498 / r622500;
        double r622502 = y;
        double r622503 = r622501 / r622502;
        double r622504 = r622495 / r622503;
        double r622505 = x;
        double r622506 = r622504 + r622505;
        return r622506;
}

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.2
Target0.5
Herbie1.2
\[\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.2

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

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

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

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

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

    \[\leadsto x + {\color{blue}{\left(\frac{y}{\frac{a - t}{z - t}}\right)}}^{1}\]
  9. Using strategy rm
  10. Applied clear-num1.2

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

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

Reproduce

herbie shell --seed 2020001 
(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)))))