Average Error: 1.2 → 0.4
Time: 4.4s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -8.06916043366223524 \cdot 10^{-64}:\\ \;\;\;\;1 \cdot \left(x + 1 \cdot \frac{y}{\frac{a - t}{z - t}}\right)\\ \mathbf{elif}\;y \le 5.4933827527075371 \cdot 10^{24}:\\ \;\;\;\;1 \cdot \left(x + \frac{y \cdot \left(z - t\right)}{a - t}\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(x + y \cdot \frac{z - t}{a - t}\right)\\ \end{array}\]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -8.06916043366223524 \cdot 10^{-64}:\\
\;\;\;\;1 \cdot \left(x + 1 \cdot \frac{y}{\frac{a - t}{z - t}}\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r544728 = x;
        double r544729 = y;
        double r544730 = z;
        double r544731 = t;
        double r544732 = r544730 - r544731;
        double r544733 = a;
        double r544734 = r544733 - r544731;
        double r544735 = r544732 / r544734;
        double r544736 = r544729 * r544735;
        double r544737 = r544728 + r544736;
        return r544737;
}

double f(double x, double y, double z, double t, double a) {
        double r544738 = y;
        double r544739 = -8.069160433662235e-64;
        bool r544740 = r544738 <= r544739;
        double r544741 = 1.0;
        double r544742 = x;
        double r544743 = a;
        double r544744 = t;
        double r544745 = r544743 - r544744;
        double r544746 = z;
        double r544747 = r544746 - r544744;
        double r544748 = r544745 / r544747;
        double r544749 = r544738 / r544748;
        double r544750 = r544741 * r544749;
        double r544751 = r544742 + r544750;
        double r544752 = r544741 * r544751;
        double r544753 = 5.493382752707537e+24;
        bool r544754 = r544738 <= r544753;
        double r544755 = r544738 * r544747;
        double r544756 = r544755 / r544745;
        double r544757 = r544742 + r544756;
        double r544758 = r544741 * r544757;
        double r544759 = r544747 / r544745;
        double r544760 = r544738 * r544759;
        double r544761 = r544742 + r544760;
        double r544762 = r544741 * r544761;
        double r544763 = r544754 ? r544758 : r544762;
        double r544764 = r544740 ? r544752 : r544763;
        return r544764;
}

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
Herbie0.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 y < -8.069160433662235e-64

    1. Initial program 0.5

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.5

      \[\leadsto \color{blue}{1 \cdot \left(x + y \cdot \frac{z - t}{a - t}\right)}\]
    4. Using strategy rm
    5. Applied clear-num0.6

      \[\leadsto 1 \cdot \left(x + y \cdot \color{blue}{\frac{1}{\frac{a - t}{z - t}}}\right)\]
    6. Using strategy rm
    7. Applied *-un-lft-identity0.6

      \[\leadsto 1 \cdot \left(x + \color{blue}{\left(1 \cdot y\right)} \cdot \frac{1}{\frac{a - t}{z - t}}\right)\]
    8. Applied associate-*l*0.6

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

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

    if -8.069160433662235e-64 < y < 5.493382752707537e+24

    1. Initial program 1.9

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity1.9

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

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

    if 5.493382752707537e+24 < y

    1. Initial program 0.4

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -8.06916043366223524 \cdot 10^{-64}:\\ \;\;\;\;1 \cdot \left(x + 1 \cdot \frac{y}{\frac{a - t}{z - t}}\right)\\ \mathbf{elif}\;y \le 5.4933827527075371 \cdot 10^{24}:\\ \;\;\;\;1 \cdot \left(x + \frac{y \cdot \left(z - t\right)}{a - t}\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(x + y \cdot \frac{z - t}{a - t}\right)\\ \end{array}\]

Reproduce

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