Average Error: 1.4 → 1.3
Time: 17.3s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \frac{y}{\frac{a - t}{z - t}}\]
x + y \cdot \frac{z - t}{a - t}
x + \frac{y}{\frac{a - t}{z - t}}
double f(double x, double y, double z, double t, double a) {
        double r456275 = x;
        double r456276 = y;
        double r456277 = z;
        double r456278 = t;
        double r456279 = r456277 - r456278;
        double r456280 = a;
        double r456281 = r456280 - r456278;
        double r456282 = r456279 / r456281;
        double r456283 = r456276 * r456282;
        double r456284 = r456275 + r456283;
        return r456284;
}

double f(double x, double y, double z, double t, double a) {
        double r456285 = x;
        double r456286 = y;
        double r456287 = a;
        double r456288 = t;
        double r456289 = r456287 - r456288;
        double r456290 = z;
        double r456291 = r456290 - r456288;
        double r456292 = r456289 / r456291;
        double r456293 = r456286 / r456292;
        double r456294 = r456285 + r456293;
        return r456294;
}

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.4
Target0.4
Herbie1.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.4

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

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

    \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
  6. Final simplification1.3

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

Reproduce

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