Average Error: 10.8 → 0.9
Time: 16.0s
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} \le -4.663883987632393677861891411181961763687 \cdot 10^{166} \lor \neg \left(\frac{\left(y - z\right) \cdot t}{a - z} \le 2.731141980457517668001956254413700357633 \cdot 10^{282}\right):\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}\\ \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} \le -4.663883987632393677861891411181961763687 \cdot 10^{166} \lor \neg \left(\frac{\left(y - z\right) \cdot t}{a - z} \le 2.731141980457517668001956254413700357633 \cdot 10^{282}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r385438 = x;
        double r385439 = y;
        double r385440 = z;
        double r385441 = r385439 - r385440;
        double r385442 = t;
        double r385443 = r385441 * r385442;
        double r385444 = a;
        double r385445 = r385444 - r385440;
        double r385446 = r385443 / r385445;
        double r385447 = r385438 + r385446;
        return r385447;
}

double f(double x, double y, double z, double t, double a) {
        double r385448 = y;
        double r385449 = z;
        double r385450 = r385448 - r385449;
        double r385451 = t;
        double r385452 = r385450 * r385451;
        double r385453 = a;
        double r385454 = r385453 - r385449;
        double r385455 = r385452 / r385454;
        double r385456 = -4.663883987632394e+166;
        bool r385457 = r385455 <= r385456;
        double r385458 = 2.7311419804575177e+282;
        bool r385459 = r385455 <= r385458;
        double r385460 = !r385459;
        bool r385461 = r385457 || r385460;
        double r385462 = x;
        double r385463 = r385454 / r385451;
        double r385464 = r385450 / r385463;
        double r385465 = r385462 + r385464;
        double r385466 = 1.0;
        double r385467 = r385454 / r385452;
        double r385468 = r385466 / r385467;
        double r385469 = r385462 + r385468;
        double r385470 = r385461 ? r385465 : r385469;
        return r385470;
}

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.8
Target0.6
Herbie0.9
\[\begin{array}{l} \mathbf{if}\;t \lt -1.068297449017406694366747246993994850729 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.911094988758637497591020599238553861375 \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 2 regimes
  2. if (/ (* (- y z) t) (- a z)) < -4.663883987632394e+166 or 2.7311419804575177e+282 < (/ (* (- y z) t) (- a z))

    1. Initial program 49.8

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

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

    if -4.663883987632394e+166 < (/ (* (- y z) t) (- a z)) < 2.7311419804575177e+282

    1. Initial program 0.3

      \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
    2. Using strategy rm
    3. Applied clear-num0.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} \le -4.663883987632393677861891411181961763687 \cdot 10^{166} \lor \neg \left(\frac{\left(y - z\right) \cdot t}{a - z} \le 2.731141980457517668001956254413700357633 \cdot 10^{282}\right):\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019303 
(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))))