Average Error: 10.6 → 0.5
Time: 3.3s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -7.060274994323644065660680161698480954589 \cdot 10^{-76}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;y \le 1.604883138641033711442777835307291618104 \cdot 10^{-75}:\\ \;\;\;\;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}\;y \le -7.060274994323644065660680161698480954589 \cdot 10^{-76}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{elif}\;y \le 1.604883138641033711442777835307291618104 \cdot 10^{-75}:\\
\;\;\;\;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 r572250 = x;
        double r572251 = y;
        double r572252 = z;
        double r572253 = t;
        double r572254 = r572252 - r572253;
        double r572255 = r572251 * r572254;
        double r572256 = a;
        double r572257 = r572256 - r572253;
        double r572258 = r572255 / r572257;
        double r572259 = r572250 + r572258;
        return r572259;
}

double f(double x, double y, double z, double t, double a) {
        double r572260 = y;
        double r572261 = -7.060274994323644e-76;
        bool r572262 = r572260 <= r572261;
        double r572263 = x;
        double r572264 = a;
        double r572265 = t;
        double r572266 = r572264 - r572265;
        double r572267 = z;
        double r572268 = r572267 - r572265;
        double r572269 = r572266 / r572268;
        double r572270 = r572260 / r572269;
        double r572271 = r572263 + r572270;
        double r572272 = 1.6048831386410337e-75;
        bool r572273 = r572260 <= r572272;
        double r572274 = r572260 * r572268;
        double r572275 = r572274 / r572266;
        double r572276 = r572263 + r572275;
        double r572277 = r572268 / r572266;
        double r572278 = r572260 * r572277;
        double r572279 = r572263 + r572278;
        double r572280 = r572273 ? r572276 : r572279;
        double r572281 = r572262 ? r572271 : r572280;
        return r572281;
}

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

Derivation

  1. Split input into 3 regimes
  2. if y < -7.060274994323644e-76

    1. Initial program 17.6

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

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

    if -7.060274994323644e-76 < y < 1.6048831386410337e-75

    1. Initial program 0.4

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

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

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

      \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a - t}\]
    6. Using strategy rm
    7. Applied associate-*r/0.4

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

    if 1.6048831386410337e-75 < y

    1. Initial program 18.0

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

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

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

      \[\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}\;y \le -7.060274994323644065660680161698480954589 \cdot 10^{-76}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;y \le 1.604883138641033711442777835307291618104 \cdot 10^{-75}:\\ \;\;\;\;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 2019354 
(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))))