Average Error: 1.2 → 1.2
Time: 25.1s
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 r25338166 = x;
        double r25338167 = y;
        double r25338168 = z;
        double r25338169 = t;
        double r25338170 = r25338168 - r25338169;
        double r25338171 = a;
        double r25338172 = r25338171 - r25338169;
        double r25338173 = r25338170 / r25338172;
        double r25338174 = r25338167 * r25338173;
        double r25338175 = r25338166 + r25338174;
        return r25338175;
}

double f(double x, double y, double z, double t, double a) {
        double r25338176 = x;
        double r25338177 = y;
        double r25338178 = z;
        double r25338179 = t;
        double r25338180 = r25338178 - r25338179;
        double r25338181 = a;
        double r25338182 = r25338181 - r25338179;
        double r25338183 = r25338180 / r25338182;
        double r25338184 = r25338177 * r25338183;
        double r25338185 = r25338176 + r25338184;
        return r25338185;
}

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.5
Herbie1.2
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089 \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 2019163 +o rules:numerics
(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 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

  (+ x (* y (/ (- z t) (- a t)))))