Average Error: 11.3 → 0.5
Time: 13.9s
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 r362651 = x;
        double r362652 = y;
        double r362653 = z;
        double r362654 = t;
        double r362655 = r362653 - r362654;
        double r362656 = r362652 * r362655;
        double r362657 = a;
        double r362658 = r362657 - r362654;
        double r362659 = r362656 / r362658;
        double r362660 = r362651 + r362659;
        return r362660;
}

double f(double x, double y, double z, double t, double a) {
        double r362661 = y;
        double r362662 = z;
        double r362663 = t;
        double r362664 = r362662 - r362663;
        double r362665 = r362661 * r362664;
        double r362666 = a;
        double r362667 = r362666 - r362663;
        double r362668 = r362665 / r362667;
        double r362669 = -5.5642864521634465e+259;
        bool r362670 = r362668 <= r362669;
        double r362671 = x;
        double r362672 = r362667 / r362664;
        double r362673 = r362661 / r362672;
        double r362674 = r362671 + r362673;
        double r362675 = 9.075100432190175e+219;
        bool r362676 = r362668 <= r362675;
        double r362677 = r362671 + r362668;
        double r362678 = r362664 / r362667;
        double r362679 = r362661 * r362678;
        double r362680 = r362671 + r362679;
        double r362681 = r362676 ? r362677 : r362680;
        double r362682 = r362670 ? r362674 : r362681;
        return r362682;
}

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