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

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r693242 = x;
        double r693243 = y;
        double r693244 = z;
        double r693245 = t;
        double r693246 = r693244 - r693245;
        double r693247 = a;
        double r693248 = r693247 - r693245;
        double r693249 = r693246 / r693248;
        double r693250 = r693243 * r693249;
        double r693251 = r693242 + r693250;
        return r693251;
}

double f(double x, double y, double z, double t, double a) {
        double r693252 = y;
        double r693253 = -8.069160433662235e-64;
        bool r693254 = r693252 <= r693253;
        double r693255 = x;
        double r693256 = a;
        double r693257 = t;
        double r693258 = r693256 - r693257;
        double r693259 = z;
        double r693260 = r693259 - r693257;
        double r693261 = r693258 / r693260;
        double r693262 = r693252 / r693261;
        double r693263 = r693255 + r693262;
        double r693264 = 1.0;
        double r693265 = pow(r693263, r693264);
        double r693266 = 5.493382752707537e+24;
        bool r693267 = r693252 <= r693266;
        double r693268 = r693252 * r693260;
        double r693269 = r693268 / r693258;
        double r693270 = r693255 + r693269;
        double r693271 = r693260 / r693258;
        double r693272 = r693252 * r693271;
        double r693273 = r693255 + r693272;
        double r693274 = pow(r693273, r693264);
        double r693275 = r693267 ? r693270 : r693274;
        double r693276 = r693254 ? r693265 : r693275;
        return r693276;
}

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 pow10.5

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

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

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

    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 associate-*r/0.4

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

    if 5.493382752707537e+24 < y

    1. Initial program 0.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -8.06916043366223524 \cdot 10^{-64}:\\ \;\;\;\;{\left(x + \frac{y}{\frac{a - t}{z - t}}\right)}^{1}\\ \mathbf{elif}\;y \le 5.4933827527075371 \cdot 10^{24}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;{\left(x + y \cdot \frac{z - t}{a - t}\right)}^{1}\\ \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)))))