Average Error: 1.4 → 2.0
Time: 21.3s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -6.980533944371433 \cdot 10^{-281}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{a - t} \cdot \left(z - t\right)\\ \end{array}\]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -6.980533944371433 \cdot 10^{-281}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r40882027 = x;
        double r40882028 = y;
        double r40882029 = z;
        double r40882030 = t;
        double r40882031 = r40882029 - r40882030;
        double r40882032 = a;
        double r40882033 = r40882032 - r40882030;
        double r40882034 = r40882031 / r40882033;
        double r40882035 = r40882028 * r40882034;
        double r40882036 = r40882027 + r40882035;
        return r40882036;
}

double f(double x, double y, double z, double t, double a) {
        double r40882037 = t;
        double r40882038 = -6.980533944371433e-281;
        bool r40882039 = r40882037 <= r40882038;
        double r40882040 = y;
        double r40882041 = z;
        double r40882042 = r40882041 - r40882037;
        double r40882043 = a;
        double r40882044 = r40882043 - r40882037;
        double r40882045 = r40882042 / r40882044;
        double r40882046 = r40882040 * r40882045;
        double r40882047 = x;
        double r40882048 = r40882046 + r40882047;
        double r40882049 = r40882040 / r40882044;
        double r40882050 = r40882049 * r40882042;
        double r40882051 = r40882047 + r40882050;
        double r40882052 = r40882039 ? r40882048 : r40882051;
        return r40882052;
}

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.4
Herbie2.0
\[\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. Split input into 2 regimes
  2. if t < -6.980533944371433e-281

    1. Initial program 1.1

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

    if -6.980533944371433e-281 < t

    1. Initial program 1.6

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied clear-num1.6

      \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}}\]
    4. Applied un-div-inv1.4

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
    5. Using strategy rm
    6. Applied associate-/r/2.7

      \[\leadsto x + \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.0

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

Reproduce

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