Average Error: 11.3 → 0.5
Time: 4.3s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \le -5.56428645216344652455427279640743493882 \cdot 10^{259}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \le 9.075100432190174717524604647768967797883 \cdot 10^{219}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \le -5.56428645216344652455427279640743493882 \cdot 10^{259}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \le 9.075100432190174717524604647768967797883 \cdot 10^{219}:\\
\;\;\;\;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 r514292 = x;
        double r514293 = y;
        double r514294 = z;
        double r514295 = t;
        double r514296 = r514294 - r514295;
        double r514297 = r514293 * r514296;
        double r514298 = a;
        double r514299 = r514298 - r514295;
        double r514300 = r514297 / r514299;
        double r514301 = r514292 + r514300;
        return r514301;
}

double f(double x, double y, double z, double t, double a) {
        double r514302 = y;
        double r514303 = z;
        double r514304 = t;
        double r514305 = r514303 - r514304;
        double r514306 = r514302 * r514305;
        double r514307 = a;
        double r514308 = r514307 - r514304;
        double r514309 = r514306 / r514308;
        double r514310 = -5.5642864521634465e+259;
        bool r514311 = r514309 <= r514310;
        double r514312 = x;
        double r514313 = r514308 / r514305;
        double r514314 = r514302 / r514313;
        double r514315 = r514312 + r514314;
        double r514316 = 9.075100432190175e+219;
        bool r514317 = r514309 <= r514316;
        double r514318 = r514312 + r514309;
        double r514319 = r514305 / r514308;
        double r514320 = r514302 * r514319;
        double r514321 = r514312 + r514320;
        double r514322 = r514317 ? r514318 : r514321;
        double r514323 = r514311 ? r514315 : r514322;
        return r514323;
}

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

Original11.3
Target1.4
Herbie0.5
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* y (- z t)) (- a t)) < -5.5642864521634465e+259

    1. Initial program 55.9

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*1.7

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

    if -5.5642864521634465e+259 < (/ (* y (- z t)) (- a t)) < 9.075100432190175e+219

    1. Initial program 0.2

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

    if 9.075100432190175e+219 < (/ (* y (- z t)) (- a t))

    1. Initial program 52.4

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

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot \left(a - t\right)}}\]
    4. Applied times-frac2.0

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
    5. Simplified2.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \le -5.56428645216344652455427279640743493882 \cdot 10^{259}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \le 9.075100432190174717524604647768967797883 \cdot 10^{219}:\\ \;\;\;\;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 2019322 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

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