Average Error: 1.3 → 1.3
Time: 1.0m
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + y \cdot \frac{z - t}{a - t}\]
x + y \cdot \frac{z - t}{a - t}
x + y \cdot \frac{z - t}{a - t}
double f(double x, double y, double z, double t, double a) {
        double r28834248 = x;
        double r28834249 = y;
        double r28834250 = z;
        double r28834251 = t;
        double r28834252 = r28834250 - r28834251;
        double r28834253 = a;
        double r28834254 = r28834253 - r28834251;
        double r28834255 = r28834252 / r28834254;
        double r28834256 = r28834249 * r28834255;
        double r28834257 = r28834248 + r28834256;
        return r28834257;
}

double f(double x, double y, double z, double t, double a) {
        double r28834258 = x;
        double r28834259 = y;
        double r28834260 = z;
        double r28834261 = t;
        double r28834262 = r28834260 - r28834261;
        double r28834263 = a;
        double r28834264 = r28834263 - r28834261;
        double r28834265 = r28834262 / r28834264;
        double r28834266 = r28834259 * r28834265;
        double r28834267 = r28834258 + r28834266;
        return r28834267;
}

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.5
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.3

    \[x + y \cdot \frac{z - t}{a - t}\]
  2. Final simplification1.3

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

Reproduce

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