Average Error: 1.4 → 1.4
Time: 6.7s
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 r536575 = x;
        double r536576 = y;
        double r536577 = z;
        double r536578 = t;
        double r536579 = r536577 - r536578;
        double r536580 = a;
        double r536581 = r536580 - r536578;
        double r536582 = r536579 / r536581;
        double r536583 = r536576 * r536582;
        double r536584 = r536575 + r536583;
        return r536584;
}

double f(double x, double y, double z, double t, double a) {
        double r536585 = x;
        double r536586 = y;
        double r536587 = z;
        double r536588 = a;
        double r536589 = t;
        double r536590 = r536588 - r536589;
        double r536591 = r536587 / r536590;
        double r536592 = r536586 * r536591;
        double r536593 = r536589 / r536590;
        double r536594 = -r536593;
        double r536595 = r536586 * r536594;
        double r536596 = r536592 + r536595;
        double r536597 = r536585 + r536596;
        return r536597;
}

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)))))