Average Error: 1.4 → 1.4
Time: 7.0s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[x + \left(y \cdot \frac{z}{a - t} + y \cdot \left(-\frac{t}{a - t}\right)\right)\]
x + y \cdot \frac{z - t}{a - t}
x + \left(y \cdot \frac{z}{a - t} + y \cdot \left(-\frac{t}{a - t}\right)\right)
double f(double x, double y, double z, double t, double a) {
        double r606448 = x;
        double r606449 = y;
        double r606450 = z;
        double r606451 = t;
        double r606452 = r606450 - r606451;
        double r606453 = a;
        double r606454 = r606453 - r606451;
        double r606455 = r606452 / r606454;
        double r606456 = r606449 * r606455;
        double r606457 = r606448 + r606456;
        return r606457;
}

double f(double x, double y, double z, double t, double a) {
        double r606458 = x;
        double r606459 = y;
        double r606460 = z;
        double r606461 = a;
        double r606462 = t;
        double r606463 = r606461 - r606462;
        double r606464 = r606460 / r606463;
        double r606465 = r606459 * r606464;
        double r606466 = r606462 / r606463;
        double r606467 = -r606466;
        double r606468 = r606459 * r606467;
        double r606469 = r606465 + r606468;
        double r606470 = r606458 + r606469;
        return r606470;
}

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

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

    \[\leadsto x + y \cdot \color{blue}{\left(\frac{z}{a - t} - \frac{t}{a - t}\right)}\]
  4. Using strategy rm
  5. Applied sub-neg1.4

    \[\leadsto x + y \cdot \color{blue}{\left(\frac{z}{a - t} + \left(-\frac{t}{a - t}\right)\right)}\]
  6. Applied distribute-lft-in1.4

    \[\leadsto x + \color{blue}{\left(y \cdot \frac{z}{a - t} + y \cdot \left(-\frac{t}{a - t}\right)\right)}\]
  7. Final simplification1.4

    \[\leadsto x + \left(y \cdot \frac{z}{a - t} + y \cdot \left(-\frac{t}{a - t}\right)\right)\]

Reproduce

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