Average Error: 1.2 → 1.2
Time: 5.4s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \frac{1}{\frac{\frac{a - t}{z - t}}{y}}\]
x + y \cdot \frac{z - t}{a - t}
x + \frac{1}{\frac{\frac{a - t}{z - t}}{y}}
double f(double x, double y, double z, double t, double a) {
        double r579530 = x;
        double r579531 = y;
        double r579532 = z;
        double r579533 = t;
        double r579534 = r579532 - r579533;
        double r579535 = a;
        double r579536 = r579535 - r579533;
        double r579537 = r579534 / r579536;
        double r579538 = r579531 * r579537;
        double r579539 = r579530 + r579538;
        return r579539;
}

double f(double x, double y, double z, double t, double a) {
        double r579540 = x;
        double r579541 = 1.0;
        double r579542 = a;
        double r579543 = t;
        double r579544 = r579542 - r579543;
        double r579545 = z;
        double r579546 = r579545 - r579543;
        double r579547 = r579544 / r579546;
        double r579548 = y;
        double r579549 = r579547 / r579548;
        double r579550 = r579541 / r579549;
        double r579551 = r579540 + r579550;
        return r579551;
}

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 un-div-inv1.1

    \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
  6. Using strategy rm
  7. Applied clear-num1.2

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\frac{a - t}{z - t}}{y}}}\]
  8. Final simplification1.2

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

Reproduce

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