Average Error: 10.5 → 0.7
Time: 15.1s
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 r362848 = x;
        double r362849 = y;
        double r362850 = z;
        double r362851 = t;
        double r362852 = r362850 - r362851;
        double r362853 = r362849 * r362852;
        double r362854 = a;
        double r362855 = r362850 - r362854;
        double r362856 = r362853 / r362855;
        double r362857 = r362848 + r362856;
        return r362857;
}

double f(double x, double y, double z, double t, double a) {
        double r362858 = y;
        double r362859 = z;
        double r362860 = t;
        double r362861 = r362859 - r362860;
        double r362862 = r362858 * r362861;
        double r362863 = a;
        double r362864 = r362859 - r362863;
        double r362865 = r362862 / r362864;
        double r362866 = -inf.0;
        bool r362867 = r362865 <= r362866;
        double r362868 = x;
        double r362869 = r362864 / r362861;
        double r362870 = r362858 / r362869;
        double r362871 = r362868 + r362870;
        double r362872 = 6.539770865773377e+177;
        bool r362873 = r362865 <= r362872;
        double r362874 = r362868 + r362865;
        double r362875 = r362858 / r362864;
        double r362876 = r362861 * r362875;
        double r362877 = r362876 + r362868;
        double r362878 = r362873 ? r362874 : r362877;
        double r362879 = r362867 ? r362871 : r362878;
        return r362879;
}

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 pow13.8

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

      \[\leadsto x + \color{blue}{{y}^{1}} \cdot {\left(\frac{z - t}{z - a}\right)}^{1}\]
    9. Applied pow-prod-down3.8

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

      \[\leadsto x + {\color{blue}{\left(\left(z - t\right) \cdot \frac{y}{z - a}\right)}}^{1}\]
  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))))