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

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r600107 = x;
        double r600108 = y;
        double r600109 = z;
        double r600110 = r600108 - r600109;
        double r600111 = t;
        double r600112 = r600110 * r600111;
        double r600113 = a;
        double r600114 = r600113 - r600109;
        double r600115 = r600112 / r600114;
        double r600116 = r600107 + r600115;
        return r600116;
}

double f(double x, double y, double z, double t, double a) {
        double r600117 = y;
        double r600118 = z;
        double r600119 = r600117 - r600118;
        double r600120 = t;
        double r600121 = r600119 * r600120;
        double r600122 = a;
        double r600123 = r600122 - r600118;
        double r600124 = r600121 / r600123;
        double r600125 = -inf.0;
        bool r600126 = r600124 <= r600125;
        double r600127 = x;
        double r600128 = r600120 / r600123;
        double r600129 = r600119 * r600128;
        double r600130 = r600127 + r600129;
        double r600131 = 4.312035133218399e+269;
        bool r600132 = r600124 <= r600131;
        double r600133 = r600127 + r600124;
        double r600134 = r600123 / r600120;
        double r600135 = r600117 / r600134;
        double r600136 = r600118 / r600134;
        double r600137 = r600135 - r600136;
        double r600138 = r600127 + r600137;
        double r600139 = r600132 ? r600133 : r600138;
        double r600140 = r600126 ? r600130 : r600139;
        return r600140;
}

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.7
Target0.6
Herbie0.5
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

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

    1. Initial program 64.0

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

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

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

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

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

    1. Initial program 0.3

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

    if 4.312035133218399e+269 < (/ (* (- y z) t) (- a z))

    1. Initial program 57.4

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
    4. Using strategy rm
    5. Applied div-sub2.6

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

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

Reproduce

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

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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