Average Error: 1.4 → 1.4
Time: 3.7s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.5425104884202794 \cdot 10^{-156}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;t \le 3.35743028334156564 \cdot 10^{-19}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -1.5425104884202794 \cdot 10^{-156}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{elif}\;t \le 3.35743028334156564 \cdot 10^{-19}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r567550 = x;
        double r567551 = y;
        double r567552 = z;
        double r567553 = t;
        double r567554 = r567552 - r567553;
        double r567555 = a;
        double r567556 = r567555 - r567553;
        double r567557 = r567554 / r567556;
        double r567558 = r567551 * r567557;
        double r567559 = r567550 + r567558;
        return r567559;
}

double f(double x, double y, double z, double t, double a) {
        double r567560 = t;
        double r567561 = -1.5425104884202794e-156;
        bool r567562 = r567560 <= r567561;
        double r567563 = x;
        double r567564 = y;
        double r567565 = a;
        double r567566 = r567565 - r567560;
        double r567567 = z;
        double r567568 = r567567 - r567560;
        double r567569 = r567566 / r567568;
        double r567570 = r567564 / r567569;
        double r567571 = r567563 + r567570;
        double r567572 = 3.3574302833415656e-19;
        bool r567573 = r567560 <= r567572;
        double r567574 = r567564 * r567568;
        double r567575 = r567574 / r567566;
        double r567576 = r567563 + r567575;
        double r567577 = r567568 / r567566;
        double r567578 = r567564 * r567577;
        double r567579 = r567563 + r567578;
        double r567580 = r567573 ? r567576 : r567579;
        double r567581 = r567562 ? r567571 : r567580;
        return r567581;
}

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. Split input into 3 regimes
  2. if t < -1.5425104884202794e-156

    1. Initial program 0.7

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied associate-*r/13.4

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

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

    if -1.5425104884202794e-156 < t < 3.3574302833415656e-19

    1. Initial program 3.5

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied associate-*r/3.5

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

    if 3.3574302833415656e-19 < t

    1. Initial program 0.1

      \[x + y \cdot \frac{z - t}{a - t}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.5425104884202794 \cdot 10^{-156}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;t \le 3.35743028334156564 \cdot 10^{-19}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Reproduce

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