Average Error: 11.0 → 1.4
Time: 3.4s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;z \le 1.49428060924115861 \cdot 10^{38}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{y}} \cdot \left(z - t\right)\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;z \le 1.49428060924115861 \cdot 10^{38}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r621413 = x;
        double r621414 = y;
        double r621415 = z;
        double r621416 = t;
        double r621417 = r621415 - r621416;
        double r621418 = r621414 * r621417;
        double r621419 = a;
        double r621420 = r621419 - r621416;
        double r621421 = r621418 / r621420;
        double r621422 = r621413 + r621421;
        return r621422;
}

double f(double x, double y, double z, double t, double a) {
        double r621423 = z;
        double r621424 = 1.4942806092411586e+38;
        bool r621425 = r621423 <= r621424;
        double r621426 = x;
        double r621427 = y;
        double r621428 = a;
        double r621429 = t;
        double r621430 = r621428 - r621429;
        double r621431 = r621423 - r621429;
        double r621432 = r621430 / r621431;
        double r621433 = r621427 / r621432;
        double r621434 = r621426 + r621433;
        double r621435 = 1.0;
        double r621436 = r621430 / r621427;
        double r621437 = r621435 / r621436;
        double r621438 = r621437 * r621431;
        double r621439 = r621426 + r621438;
        double r621440 = r621425 ? r621434 : r621439;
        return r621440;
}

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
Herbie1.4
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if z < 1.4942806092411586e+38

    1. Initial program 10.0

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

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

    if 1.4942806092411586e+38 < z

    1. Initial program 15.0

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/2.8

      \[\leadsto x + \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right)}\]
    6. Using strategy rm
    7. Applied clear-num3.2

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

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

Reproduce

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