Average Error: 11.0 → 0.3
Time: 2.6s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \le -5.1535214033275047 \cdot 10^{293}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \le 1.1923586009172976 \cdot 10^{308}:\\ \;\;\;\;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}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \le -5.1535214033275047 \cdot 10^{293}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{elif}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \le 1.1923586009172976 \cdot 10^{308}:\\
\;\;\;\;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 r535922 = x;
        double r535923 = y;
        double r535924 = z;
        double r535925 = t;
        double r535926 = r535924 - r535925;
        double r535927 = r535923 * r535926;
        double r535928 = a;
        double r535929 = r535928 - r535925;
        double r535930 = r535927 / r535929;
        double r535931 = r535922 + r535930;
        return r535931;
}

double f(double x, double y, double z, double t, double a) {
        double r535932 = x;
        double r535933 = y;
        double r535934 = z;
        double r535935 = t;
        double r535936 = r535934 - r535935;
        double r535937 = r535933 * r535936;
        double r535938 = a;
        double r535939 = r535938 - r535935;
        double r535940 = r535937 / r535939;
        double r535941 = r535932 + r535940;
        double r535942 = -5.153521403327505e+293;
        bool r535943 = r535941 <= r535942;
        double r535944 = r535939 / r535936;
        double r535945 = r535933 / r535944;
        double r535946 = r535932 + r535945;
        double r535947 = 1.1923586009172976e+308;
        bool r535948 = r535941 <= r535947;
        double r535949 = r535936 / r535939;
        double r535950 = r535933 * r535949;
        double r535951 = r535932 + r535950;
        double r535952 = r535948 ? r535941 : r535951;
        double r535953 = r535943 ? r535946 : r535952;
        return r535953;
}

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.0
Target1.3
Herbie0.3
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

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

    1. Initial program 55.9

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

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

    if -5.153521403327505e+293 < (+ x (/ (* y (- z t)) (- a t))) < 1.1923586009172976e+308

    1. Initial program 0.3

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

    if 1.1923586009172976e+308 < (+ x (/ (* y (- z t)) (- a t)))

    1. Initial program 63.8

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \le -5.1535214033275047 \cdot 10^{293}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;x + \frac{y \cdot \left(z - t\right)}{a - t} \le 1.1923586009172976 \cdot 10^{308}:\\ \;\;\;\;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 2020081 
(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))))