Average Error: 11.3 → 0.9
Time: 3.8s
Precision: binary64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot t}{a - z} \le 3.33043009511256227 \cdot 10^{-175}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot \frac{1}{\frac{1}{t}}\\ \mathbf{elif}\;x + \frac{\left(y - z\right) \cdot t}{a - z} \le 1.65381565469013311 \cdot 10^{288}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot t}{a - z} \le 3.33043009511256227 \cdot 10^{-175}:\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot \frac{1}{\frac{1}{t}}\\

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

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (((double) (((double) (y - z)) * t)) / ((double) (a - z))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if ((((double) (x + ((double) (((double) (((double) (y - z)) * t)) / ((double) (a - z)))))) <= 3.330430095112562e-175)) {
		VAR = ((double) (x + ((double) (((double) (((double) (y - z)) / ((double) (a - z)))) * ((double) (1.0 / ((double) (1.0 / t))))))));
	} else {
		double VAR_1;
		if ((((double) (x + ((double) (((double) (((double) (y - z)) * t)) / ((double) (a - z)))))) <= 1.653815654690133e+288)) {
			VAR_1 = ((double) (x + ((double) (((double) (((double) (y - z)) * t)) / ((double) (a - z))))));
		} else {
			VAR_1 = ((double) (x + ((double) (((double) (y - z)) * ((double) (t / ((double) (a - z))))))));
		}
		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

Original11.3
Target0.6
Herbie0.9
\[\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 (+ x (/ (* (- y z) t) (- a z))) < 3.33043009511256227e-175

    1. Initial program 10.9

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

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t}}}\]
    5. Using strategy rm
    6. Applied div-inv3.8

      \[\leadsto x + \left(y - z\right) \cdot \frac{1}{\color{blue}{\left(a - z\right) \cdot \frac{1}{t}}}\]
    7. Applied *-un-lft-identity3.8

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

      \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\left(\frac{1}{a - z} \cdot \frac{1}{\frac{1}{t}}\right)}\]
    9. Applied associate-*r*1.3

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

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

    if 3.33043009511256227e-175 < (+ x (/ (* (- y z) t) (- a z))) < 1.65381565469013311e288

    1. Initial program 0.1

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

    if 1.65381565469013311e288 < (+ x (/ (* (- y z) t) (- a z)))

    1. Initial program 53.0

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

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

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

Reproduce

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