Average Error: 10.5 → 0.7
Time: 13.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -\infty:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \le 6.539770865773377012647932284333126840637 \cdot 10^{177}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{z - a}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} = -\infty:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r441417 = x;
        double r441418 = y;
        double r441419 = z;
        double r441420 = t;
        double r441421 = r441419 - r441420;
        double r441422 = r441418 * r441421;
        double r441423 = a;
        double r441424 = r441419 - r441423;
        double r441425 = r441422 / r441424;
        double r441426 = r441417 + r441425;
        return r441426;
}

double f(double x, double y, double z, double t, double a) {
        double r441427 = y;
        double r441428 = z;
        double r441429 = t;
        double r441430 = r441428 - r441429;
        double r441431 = r441427 * r441430;
        double r441432 = a;
        double r441433 = r441428 - r441432;
        double r441434 = r441431 / r441433;
        double r441435 = -inf.0;
        bool r441436 = r441434 <= r441435;
        double r441437 = x;
        double r441438 = r441433 / r441430;
        double r441439 = r441427 / r441438;
        double r441440 = r441437 + r441439;
        double r441441 = 6.539770865773377e+177;
        bool r441442 = r441434 <= r441441;
        double r441443 = r441437 + r441434;
        double r441444 = r441427 / r441433;
        double r441445 = r441430 * r441444;
        double r441446 = r441445 + r441437;
        double r441447 = r441442 ? r441443 : r441446;
        double r441448 = r441436 ? r441440 : r441447;
        return r441448;
}

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

Original10.5
Target1.5
Herbie0.7
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* y (- z t)) (- z a)) < -inf.0

    1. Initial program 64.0

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

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

    if -inf.0 < (/ (* y (- z t)) (- z a)) < 6.539770865773377e+177

    1. Initial program 0.3

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

    if 6.539770865773377e+177 < (/ (* y (- z t)) (- z a))

    1. Initial program 42.5

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

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

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

      \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{z - a}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity3.8

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

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

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

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

Reproduce

herbie shell --seed 2019323 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

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

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