Average Error: 1.2 → 1.2
Time: 18.7s
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 r339471 = x;
        double r339472 = y;
        double r339473 = z;
        double r339474 = t;
        double r339475 = r339473 - r339474;
        double r339476 = a;
        double r339477 = r339476 - r339474;
        double r339478 = r339475 / r339477;
        double r339479 = r339472 * r339478;
        double r339480 = r339471 + r339479;
        return r339480;
}

double f(double x, double y, double z, double t, double a) {
        double r339481 = x;
        double r339482 = y;
        double r339483 = z;
        double r339484 = t;
        double r339485 = r339483 - r339484;
        double r339486 = a;
        double r339487 = r339486 - r339484;
        double r339488 = r339485 / r339487;
        double r339489 = r339482 * r339488;
        double r339490 = r339481 + r339489;
        return r339490;
}

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.4
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. Final simplification1.2

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

Reproduce

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