Average Error: 10.9 → 0.7
Time: 16.6min
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -530501686562953.62:\\ \;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\\ \mathbf{elif}\;y \le 4.1892129312362705 \cdot 10^{53}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -530501686562953.62:\\
\;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\\

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

\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((y <= -530501686562953.6)) {
		VAR = ((double) (x + ((double) (y * ((double) (((double) (z - t)) * (1.0 / ((double) (a - t)))))))));
	} else {
		double VAR_1;
		if ((y <= 4.1892129312362705e+53)) {
			VAR_1 = ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (a - t)))));
		} else {
			VAR_1 = ((double) (x + (y / (((double) (a - t)) / ((double) (z - t))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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

Derivation

  1. Split input into 3 regimes
  2. if y < -530501686562953.62

    1. Initial program 24.5

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

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

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

      \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a - t}\]
    6. Using strategy rm
    7. Applied div-inv0.9

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

    if -530501686562953.62 < y < 4.1892129312362705e53

    1. Initial program 0.6

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

    if 4.1892129312362705e53 < y

    1. Initial program 26.7

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

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

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

Reproduce

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