Average Error: 10.5 → 0.7
Time: 14.3s
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 r404710 = x;
        double r404711 = y;
        double r404712 = z;
        double r404713 = t;
        double r404714 = r404712 - r404713;
        double r404715 = r404711 * r404714;
        double r404716 = a;
        double r404717 = r404712 - r404716;
        double r404718 = r404715 / r404717;
        double r404719 = r404710 + r404718;
        return r404719;
}

double f(double x, double y, double z, double t, double a) {
        double r404720 = y;
        double r404721 = z;
        double r404722 = t;
        double r404723 = r404721 - r404722;
        double r404724 = r404720 * r404723;
        double r404725 = a;
        double r404726 = r404721 - r404725;
        double r404727 = r404724 / r404726;
        double r404728 = -inf.0;
        bool r404729 = r404727 <= r404728;
        double r404730 = x;
        double r404731 = r404726 / r404723;
        double r404732 = r404720 / r404731;
        double r404733 = r404730 + r404732;
        double r404734 = 6.539770865773377e+177;
        bool r404735 = r404727 <= r404734;
        double r404736 = r404730 + r404727;
        double r404737 = r404720 / r404726;
        double r404738 = r404723 * r404737;
        double r404739 = r404738 + r404730;
        double r404740 = r404735 ? r404736 : r404739;
        double r404741 = r404729 ? r404733 : r404740;
        return r404741;
}

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))))