Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A

Percentage Accurate: 85.0% → 98.1%
Time: 11.2s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - t\right)}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a):
	return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((y * (z - t)) / (z - a));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 85.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - t\right)}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a):
	return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((y * (z - t)) / (z - a));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
	return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a)
	return fma(y, Float64(Float64(z - t) / Float64(z - a)), x)
end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Derivation
  1. Initial program 82.6%

    \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
  2. Step-by-step derivation
    1. +-commutative82.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
    2. associate-/l*98.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
    3. fma-define98.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 2: 92.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+274}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (<= t_1 (- INFINITY))
     (+ x (* y (- 1.0 (/ t z))))
     (if (<= t_1 1e+274) (+ x t_1) (+ x (* t (/ y (- a z))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x + (y * (1.0 - (t / z)));
	} else if (t_1 <= 1e+274) {
		tmp = x + t_1;
	} else {
		tmp = x + (t * (y / (a - z)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x + (y * (1.0 - (t / z)));
	} else if (t_1 <= 1e+274) {
		tmp = x + t_1;
	} else {
		tmp = x + (t * (y / (a - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x + (y * (1.0 - (t / z)))
	elif t_1 <= 1e+274:
		tmp = x + t_1
	else:
		tmp = x + (t * (y / (a - z)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z))));
	elseif (t_1 <= 1e+274)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(x + Float64(t * Float64(y / Float64(a - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (z - a);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x + (y * (1.0 - (t / z)));
	elseif (t_1 <= 1e+274)
		tmp = x + t_1;
	else
		tmp = x + (t * (y / (a - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+274], N[(x + t$95$1), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+274}:\\
\;\;\;\;x + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0

    1. Initial program 33.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 23.3%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{z}} \]
    4. Step-by-step derivation
      1. associate-/l*84.1%

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub84.1%

        \[\leadsto x + y \cdot \color{blue}{\left(\frac{z}{z} - \frac{t}{z}\right)} \]
      3. *-inverses84.1%

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.99999999999999921e273

    1. Initial program 99.9%

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

    if 9.99999999999999921e273 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 28.7%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative28.7%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*99.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*28.7%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} + x \]
      3. div-inv28.7%

        \[\leadsto \color{blue}{\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}} + x \]
      4. *-commutative28.7%

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

        \[\leadsto \color{blue}{\left(z - t\right) \cdot \left(y \cdot \frac{1}{z - a}\right)} + x \]
      6. div-inv99.9%

        \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{z - a}} + x \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a} + x} \]
    7. Taylor expanded in z around 0 67.4%

      \[\leadsto \color{blue}{\left(-1 \cdot t\right)} \cdot \frac{y}{z - a} + x \]
    8. Step-by-step derivation
      1. neg-mul-167.4%

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

      \[\leadsto \color{blue}{\left(-t\right)} \cdot \frac{y}{z - a} + x \]
    10. Taylor expanded in t around 0 33.2%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z - a}} \]
    11. Step-by-step derivation
      1. mul-1-neg33.2%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z - a}\right)} \]
      2. associate-*r/67.4%

        \[\leadsto x + \left(-\color{blue}{t \cdot \frac{y}{z - a}}\right) \]
      3. sub-neg67.4%

        \[\leadsto \color{blue}{x - t \cdot \frac{y}{z - a}} \]
    12. Simplified67.4%

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{z - a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq -\infty:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq 10^{+274}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 77.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -135000000000:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-47}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+151}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -135000000000.0)
   (+ y x)
   (if (<= z 1.3e-47)
     (+ x (* t (/ y a)))
     (if (<= z 5.6e+151) (- x (* t (/ y z))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -135000000000.0) {
		tmp = y + x;
	} else if (z <= 1.3e-47) {
		tmp = x + (t * (y / a));
	} else if (z <= 5.6e+151) {
		tmp = x - (t * (y / z));
	} else {
		tmp = y + x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-135000000000.0d0)) then
        tmp = y + x
    else if (z <= 1.3d-47) then
        tmp = x + (t * (y / a))
    else if (z <= 5.6d+151) then
        tmp = x - (t * (y / z))
    else
        tmp = y + x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -135000000000.0) {
		tmp = y + x;
	} else if (z <= 1.3e-47) {
		tmp = x + (t * (y / a));
	} else if (z <= 5.6e+151) {
		tmp = x - (t * (y / z));
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -135000000000.0:
		tmp = y + x
	elif z <= 1.3e-47:
		tmp = x + (t * (y / a))
	elif z <= 5.6e+151:
		tmp = x - (t * (y / z))
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -135000000000.0)
		tmp = Float64(y + x);
	elseif (z <= 1.3e-47)
		tmp = Float64(x + Float64(t * Float64(y / a)));
	elseif (z <= 5.6e+151)
		tmp = Float64(x - Float64(t * Float64(y / z)));
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -135000000000.0)
		tmp = y + x;
	elseif (z <= 1.3e-47)
		tmp = x + (t * (y / a));
	elseif (z <= 5.6e+151)
		tmp = x - (t * (y / z));
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -135000000000.0], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.3e-47], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e+151], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -135000000000:\\
\;\;\;\;y + x\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-47}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+151}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;y + x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.35e11 or 5.59999999999999975e151 < z

    1. Initial program 70.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative70.0%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*100.0%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 85.1%

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative85.1%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified85.1%

      \[\leadsto \color{blue}{y + x} \]

    if -1.35e11 < z < 1.3e-47

    1. Initial program 94.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative94.2%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*97.1%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified97.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 72.1%

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative72.1%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      2. associate-/l*76.3%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified76.3%

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

    if 1.3e-47 < z < 5.59999999999999975e151

    1. Initial program 87.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative87.2%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*87.2%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} + x \]
      3. div-inv87.2%

        \[\leadsto \color{blue}{\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}} + x \]
      4. *-commutative87.2%

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

        \[\leadsto \color{blue}{\left(z - t\right) \cdot \left(y \cdot \frac{1}{z - a}\right)} + x \]
      6. div-inv99.9%

        \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{z - a}} + x \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a} + x} \]
    7. Taylor expanded in z around 0 84.1%

      \[\leadsto \color{blue}{\left(-1 \cdot t\right)} \cdot \frac{y}{z - a} + x \]
    8. Step-by-step derivation
      1. neg-mul-184.1%

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

      \[\leadsto \color{blue}{\left(-t\right)} \cdot \frac{y}{z - a} + x \]
    10. Taylor expanded in z around inf 72.6%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z}} \]
    11. Step-by-step derivation
      1. mul-1-neg72.6%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z}\right)} \]
      2. unsub-neg72.6%

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{z}} \]
      3. associate-/l*74.9%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    12. Simplified74.9%

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -135000000000:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-47}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+151}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{-10}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-294}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-79}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -5.5e-10)
   (+ y x)
   (if (<= z 2.15e-294) x (if (<= z 7.6e-79) (* y (/ t a)) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.5e-10) {
		tmp = y + x;
	} else if (z <= 2.15e-294) {
		tmp = x;
	} else if (z <= 7.6e-79) {
		tmp = y * (t / a);
	} else {
		tmp = y + x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-5.5d-10)) then
        tmp = y + x
    else if (z <= 2.15d-294) then
        tmp = x
    else if (z <= 7.6d-79) then
        tmp = y * (t / a)
    else
        tmp = y + x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -5.5e-10) {
		tmp = y + x;
	} else if (z <= 2.15e-294) {
		tmp = x;
	} else if (z <= 7.6e-79) {
		tmp = y * (t / a);
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -5.5e-10:
		tmp = y + x
	elif z <= 2.15e-294:
		tmp = x
	elif z <= 7.6e-79:
		tmp = y * (t / a)
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -5.5e-10)
		tmp = Float64(y + x);
	elseif (z <= 2.15e-294)
		tmp = x;
	elseif (z <= 7.6e-79)
		tmp = Float64(y * Float64(t / a));
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -5.5e-10)
		tmp = y + x;
	elseif (z <= 2.15e-294)
		tmp = x;
	elseif (z <= 7.6e-79)
		tmp = y * (t / a);
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-10], N[(y + x), $MachinePrecision], If[LessEqual[z, 2.15e-294], x, If[LessEqual[z, 7.6e-79], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-10}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-294}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.6 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

\mathbf{else}:\\
\;\;\;\;y + x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4999999999999996e-10 or 7.6000000000000002e-79 < z

    1. Initial program 76.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative76.0%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 74.9%

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative74.9%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified74.9%

      \[\leadsto \color{blue}{y + x} \]

    if -5.4999999999999996e-10 < z < 2.1500000000000001e-294

    1. Initial program 94.6%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative94.6%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*96.4%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define96.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified96.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 56.6%

      \[\leadsto \color{blue}{x} \]

    if 2.1500000000000001e-294 < z < 7.6000000000000002e-79

    1. Initial program 96.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*96.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define96.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified96.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 92.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot \left(z - t\right)}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg92.3%

        \[\leadsto x + \color{blue}{\left(-\frac{y \cdot \left(z - t\right)}{a}\right)} \]
      2. unsub-neg92.3%

        \[\leadsto \color{blue}{x - \frac{y \cdot \left(z - t\right)}{a}} \]
      3. associate-/l*89.3%

        \[\leadsto x - \color{blue}{y \cdot \frac{z - t}{a}} \]
    7. Simplified89.3%

      \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
    8. Step-by-step derivation
      1. clear-num89.3%

        \[\leadsto x - y \cdot \color{blue}{\frac{1}{\frac{a}{z - t}}} \]
      2. un-div-inv92.5%

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    9. Applied egg-rr92.5%

      \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    10. Taylor expanded in x around 0 60.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot \left(z - t\right)}{a}} \]
    11. Step-by-step derivation
      1. mul-1-neg60.3%

        \[\leadsto \color{blue}{-\frac{y \cdot \left(z - t\right)}{a}} \]
      2. associate-/l*60.4%

        \[\leadsto -\color{blue}{y \cdot \frac{z - t}{a}} \]
      3. distribute-rgt-neg-in60.4%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{z - t}{a}\right)} \]
      4. distribute-neg-frac260.4%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{-a}} \]
    12. Simplified60.4%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{-a}} \]
    13. Taylor expanded in z around 0 59.6%

      \[\leadsto y \cdot \color{blue}{\frac{t}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 87.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.00385 \lor \neg \left(t \leq 96000000000000\right):\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -0.00385) (not (<= t 96000000000000.0)))
   (+ x (* t (/ y (- a z))))
   (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -0.00385) || !(t <= 96000000000000.0)) {
		tmp = x + (t * (y / (a - z)));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((t <= (-0.00385d0)) .or. (.not. (t <= 96000000000000.0d0))) then
        tmp = x + (t * (y / (a - z)))
    else
        tmp = x + (y * (z / (z - a)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -0.00385) || !(t <= 96000000000000.0)) {
		tmp = x + (t * (y / (a - z)));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -0.00385) or not (t <= 96000000000000.0):
		tmp = x + (t * (y / (a - z)))
	else:
		tmp = x + (y * (z / (z - a)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -0.00385) || !(t <= 96000000000000.0))
		tmp = Float64(x + Float64(t * Float64(y / Float64(a - z))));
	else
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -0.00385) || ~((t <= 96000000000000.0)))
		tmp = x + (t * (y / (a - z)));
	else
		tmp = x + (y * (z / (z - a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.00385], N[Not[LessEqual[t, 96000000000000.0]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.00385 \lor \neg \left(t \leq 96000000000000\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0038500000000000001 or 9.6e13 < t

    1. Initial program 81.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative81.8%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*97.6%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define97.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified97.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine97.6%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*81.8%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} + x \]
      3. div-inv81.7%

        \[\leadsto \color{blue}{\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}} + x \]
      4. *-commutative81.7%

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

        \[\leadsto \color{blue}{\left(z - t\right) \cdot \left(y \cdot \frac{1}{z - a}\right)} + x \]
      6. div-inv99.0%

        \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{z - a}} + x \]
    6. Applied egg-rr99.0%

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a} + x} \]
    7. Taylor expanded in z around 0 90.5%

      \[\leadsto \color{blue}{\left(-1 \cdot t\right)} \cdot \frac{y}{z - a} + x \]
    8. Step-by-step derivation
      1. neg-mul-190.5%

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

      \[\leadsto \color{blue}{\left(-t\right)} \cdot \frac{y}{z - a} + x \]
    10. Taylor expanded in t around 0 80.9%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z - a}} \]
    11. Step-by-step derivation
      1. mul-1-neg80.9%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z - a}\right)} \]
      2. associate-*r/90.5%

        \[\leadsto x + \left(-\color{blue}{t \cdot \frac{y}{z - a}}\right) \]
      3. sub-neg90.5%

        \[\leadsto \color{blue}{x - t \cdot \frac{y}{z - a}} \]
    12. Simplified90.5%

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

    if -0.0038500000000000001 < t < 9.6e13

    1. Initial program 83.4%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 75.2%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. associate-/l*91.7%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified91.7%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.00385 \lor \neg \left(t \leq 96000000000000\right):\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 81.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-104} \lor \neg \left(z \leq 9.5 \cdot 10^{+42}\right):\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -4.5e-104) (not (<= z 9.5e+42)))
   (+ x (* y (- 1.0 (/ t z))))
   (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -4.5e-104) || !(z <= 9.5e+42)) {
		tmp = x + (y * (1.0 - (t / z)));
	} else {
		tmp = x + (t * (y / a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-4.5d-104)) .or. (.not. (z <= 9.5d+42))) then
        tmp = x + (y * (1.0d0 - (t / z)))
    else
        tmp = x + (t * (y / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -4.5e-104) || !(z <= 9.5e+42)) {
		tmp = x + (y * (1.0 - (t / z)));
	} else {
		tmp = x + (t * (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -4.5e-104) or not (z <= 9.5e+42):
		tmp = x + (y * (1.0 - (t / z)))
	else:
		tmp = x + (t * (y / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -4.5e-104) || !(z <= 9.5e+42))
		tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z))));
	else
		tmp = Float64(x + Float64(t * Float64(y / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -4.5e-104) || ~((z <= 9.5e+42)))
		tmp = x + (y * (1.0 - (t / z)));
	else
		tmp = x + (t * (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.5e-104], N[Not[LessEqual[z, 9.5e+42]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-104} \lor \neg \left(z \leq 9.5 \cdot 10^{+42}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999997e-104 or 9.50000000000000019e42 < z

    1. Initial program 76.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 66.9%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{z}} \]
    4. Step-by-step derivation
      1. associate-/l*85.4%

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub85.4%

        \[\leadsto x + y \cdot \color{blue}{\left(\frac{z}{z} - \frac{t}{z}\right)} \]
      3. *-inverses85.4%

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

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

    if -4.4999999999999997e-104 < z < 9.50000000000000019e42

    1. Initial program 93.5%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative93.5%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*96.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define96.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified96.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 76.6%

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative76.6%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      2. associate-/l*81.4%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified81.4%

      \[\leadsto \color{blue}{t \cdot \frac{y}{a} + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-104} \lor \neg \left(z \leq 9.5 \cdot 10^{+42}\right):\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 76.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{+189}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+27}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -3.3e+189)
   (* t (/ y (- a z)))
   (if (<= t 9.5e+27) (+ x (* y (/ z (- z a)))) (+ x (* (- z t) (/ y z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -3.3e+189) {
		tmp = t * (y / (a - z));
	} else if (t <= 9.5e+27) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + ((z - t) * (y / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= (-3.3d+189)) then
        tmp = t * (y / (a - z))
    else if (t <= 9.5d+27) then
        tmp = x + (y * (z / (z - a)))
    else
        tmp = x + ((z - t) * (y / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -3.3e+189) {
		tmp = t * (y / (a - z));
	} else if (t <= 9.5e+27) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + ((z - t) * (y / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= -3.3e+189:
		tmp = t * (y / (a - z))
	elif t <= 9.5e+27:
		tmp = x + (y * (z / (z - a)))
	else:
		tmp = x + ((z - t) * (y / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= -3.3e+189)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (t <= 9.5e+27)
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	else
		tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -3.3e+189)
		tmp = t * (y / (a - z));
	elseif (t <= 9.5e+27)
		tmp = x + (y * (z / (z - a)));
	else
		tmp = x + ((z - t) * (y / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.3e+189], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+27], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+189}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\

\mathbf{elif}\;t \leq 9.5 \cdot 10^{+27}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.3000000000000002e189

    1. Initial program 75.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative75.2%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*95.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define95.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified95.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine95.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*75.2%

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

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

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

        \[\leadsto \color{blue}{\left(z - t\right) \cdot \left(y \cdot \frac{1}{z - a}\right)} + x \]
      6. div-inv95.7%

        \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{z - a}} + x \]
    6. Applied egg-rr95.7%

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a} + x} \]
    7. Taylor expanded in z around 0 91.4%

      \[\leadsto \color{blue}{\left(-1 \cdot t\right)} \cdot \frac{y}{z - a} + x \]
    8. Step-by-step derivation
      1. neg-mul-191.4%

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

      \[\leadsto \color{blue}{\left(-t\right)} \cdot \frac{y}{z - a} + x \]
    10. Taylor expanded in t around 0 75.0%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z - a}} \]
    11. Step-by-step derivation
      1. mul-1-neg75.0%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z - a}\right)} \]
      2. associate-*r/91.4%

        \[\leadsto x + \left(-\color{blue}{t \cdot \frac{y}{z - a}}\right) \]
      3. sub-neg91.4%

        \[\leadsto \color{blue}{x - t \cdot \frac{y}{z - a}} \]
    12. Simplified91.4%

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{z - a}} \]
    13. Taylor expanded in x around 0 57.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    14. Step-by-step derivation
      1. mul-1-neg57.8%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. associate-/l*74.4%

        \[\leadsto -\color{blue}{t \cdot \frac{y}{z - a}} \]
      3. distribute-rgt-neg-in74.4%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{y}{z - a}\right)} \]
      4. distribute-frac-neg74.4%

        \[\leadsto t \cdot \color{blue}{\frac{-y}{z - a}} \]
    15. Simplified74.4%

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

    if -3.3000000000000002e189 < t < 9.4999999999999997e27

    1. Initial program 83.1%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 72.6%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. associate-/l*88.8%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified88.8%

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

    if 9.4999999999999997e27 < t

    1. Initial program 84.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative84.0%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*97.0%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define97.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified97.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine97.0%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
      2. associate-/l*84.0%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} + x \]
      3. div-inv84.0%

        \[\leadsto \color{blue}{\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}} + x \]
      4. *-commutative84.0%

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

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

        \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{z - a}} + x \]
    6. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a} + x} \]
    7. Taylor expanded in z around inf 75.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{+189}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+27}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 78.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -215000000000:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+53}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -215000000000.0)
   (+ x (* y (/ z (- z a))))
   (if (<= a 3.5e+53) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -215000000000.0) {
		tmp = x + (y * (z / (z - a)));
	} else if (a <= 3.5e+53) {
		tmp = x + (y * (1.0 - (t / z)));
	} else {
		tmp = x + (t / (a / y));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-215000000000.0d0)) then
        tmp = x + (y * (z / (z - a)))
    else if (a <= 3.5d+53) then
        tmp = x + (y * (1.0d0 - (t / z)))
    else
        tmp = x + (t / (a / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -215000000000.0) {
		tmp = x + (y * (z / (z - a)));
	} else if (a <= 3.5e+53) {
		tmp = x + (y * (1.0 - (t / z)));
	} else {
		tmp = x + (t / (a / y));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -215000000000.0:
		tmp = x + (y * (z / (z - a)))
	elif a <= 3.5e+53:
		tmp = x + (y * (1.0 - (t / z)))
	else:
		tmp = x + (t / (a / y))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -215000000000.0)
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	elseif (a <= 3.5e+53)
		tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z))));
	else
		tmp = Float64(x + Float64(t / Float64(a / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -215000000000.0)
		tmp = x + (y * (z / (z - a)));
	elseif (a <= 3.5e+53)
		tmp = x + (y * (1.0 - (t / z)));
	else
		tmp = x + (t / (a / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -215000000000.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e+53], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -215000000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.15e11

    1. Initial program 77.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 66.7%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. associate-/l*81.4%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified81.4%

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

    if -2.15e11 < a < 3.50000000000000019e53

    1. Initial program 84.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 70.4%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{z}} \]
    4. Step-by-step derivation
      1. associate-/l*85.5%

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub85.5%

        \[\leadsto x + y \cdot \color{blue}{\left(\frac{z}{z} - \frac{t}{z}\right)} \]
      3. *-inverses85.5%

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

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

    if 3.50000000000000019e53 < a

    1. Initial program 85.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative85.2%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 70.2%

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative70.2%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      2. associate-/l*82.8%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified82.8%

      \[\leadsto \color{blue}{t \cdot \frac{y}{a} + x} \]
    8. Step-by-step derivation
      1. clear-num82.8%

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} + x \]
      2. un-div-inv82.8%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
    9. Applied egg-rr82.8%

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -215000000000:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+53}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -70000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{+141}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -70000000000.0) (not (<= z 3.1e+141)))
   (+ y x)
   (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -70000000000.0) || !(z <= 3.1e+141)) {
		tmp = y + x;
	} else {
		tmp = x + (t * (y / a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-70000000000.0d0)) .or. (.not. (z <= 3.1d+141))) then
        tmp = y + x
    else
        tmp = x + (t * (y / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -70000000000.0) || !(z <= 3.1e+141)) {
		tmp = y + x;
	} else {
		tmp = x + (t * (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -70000000000.0) or not (z <= 3.1e+141):
		tmp = y + x
	else:
		tmp = x + (t * (y / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -70000000000.0) || !(z <= 3.1e+141))
		tmp = Float64(y + x);
	else
		tmp = Float64(x + Float64(t * Float64(y / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -70000000000.0) || ~((z <= 3.1e+141)))
		tmp = y + x;
	else
		tmp = x + (t * (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -70000000000.0], N[Not[LessEqual[z, 3.1e+141]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -70000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{+141}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7e10 or 3.10000000000000004e141 < z

    1. Initial program 70.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative70.0%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*100.0%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 84.6%

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative84.6%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified84.6%

      \[\leadsto \color{blue}{y + x} \]

    if -7e10 < z < 3.10000000000000004e141

    1. Initial program 92.6%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative92.6%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*97.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define97.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified97.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 68.5%

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative68.5%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      2. associate-/l*73.1%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified73.1%

      \[\leadsto \color{blue}{t \cdot \frac{y}{a} + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -70000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{+141}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{-10} \lor \neg \left(z \leq 1.15 \cdot 10^{-17}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -4.1e-10) (not (<= z 1.15e-17))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -4.1e-10) || !(z <= 1.15e-17)) {
		tmp = y + x;
	} else {
		tmp = x + ((y * t) / a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-4.1d-10)) .or. (.not. (z <= 1.15d-17))) then
        tmp = y + x
    else
        tmp = x + ((y * t) / a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -4.1e-10) || !(z <= 1.15e-17)) {
		tmp = y + x;
	} else {
		tmp = x + ((y * t) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -4.1e-10) or not (z <= 1.15e-17):
		tmp = y + x
	else:
		tmp = x + ((y * t) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -4.1e-10) || !(z <= 1.15e-17))
		tmp = Float64(y + x);
	else
		tmp = Float64(x + Float64(Float64(y * t) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -4.1e-10) || ~((z <= 1.15e-17)))
		tmp = y + x;
	else
		tmp = x + ((y * t) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.1e-10], N[Not[LessEqual[z, 1.15e-17]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{-10} \lor \neg \left(z \leq 1.15 \cdot 10^{-17}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.0999999999999998e-10 or 1.15000000000000004e-17 < z

    1. Initial program 74.5%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative74.5%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 78.2%

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative78.2%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified78.2%

      \[\leadsto \color{blue}{y + x} \]

    if -4.0999999999999998e-10 < z < 1.15000000000000004e-17

    1. Initial program 95.1%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 72.9%

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{-10} \lor \neg \left(z \leq 1.15 \cdot 10^{-17}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 63.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.8 \cdot 10^{+226}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{+230}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -1.8e+226) x (if (<= a 3.4e+230) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.8e+226) {
		tmp = x;
	} else if (a <= 3.4e+230) {
		tmp = y + x;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-1.8d+226)) then
        tmp = x
    else if (a <= 3.4d+230) then
        tmp = y + x
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.8e+226) {
		tmp = x;
	} else if (a <= 3.4e+230) {
		tmp = y + x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -1.8e+226:
		tmp = x
	elif a <= 3.4e+230:
		tmp = y + x
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -1.8e+226)
		tmp = x;
	elseif (a <= 3.4e+230)
		tmp = Float64(y + x);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -1.8e+226)
		tmp = x;
	elseif (a <= 3.4e+230)
		tmp = y + x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.8e+226], x, If[LessEqual[a, 3.4e+230], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+226}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.4 \cdot 10^{+230}:\\
\;\;\;\;y + x\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.7999999999999999e226 or 3.39999999999999986e230 < a

    1. Initial program 81.5%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative81.5%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*99.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 79.1%

      \[\leadsto \color{blue}{x} \]

    if -1.7999999999999999e226 < a < 3.39999999999999986e230

    1. Initial program 82.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative82.8%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*98.6%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define98.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified98.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 65.4%

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative65.4%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified65.4%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 52.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-128}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.8 \cdot 10^{-38}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -1.2e-128) x (if (<= x 8.8e-38) y x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -1.2e-128) {
		tmp = x;
	} else if (x <= 8.8e-38) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (x <= (-1.2d-128)) then
        tmp = x
    else if (x <= 8.8d-38) then
        tmp = y
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -1.2e-128) {
		tmp = x;
	} else if (x <= 8.8e-38) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -1.2e-128:
		tmp = x
	elif x <= 8.8e-38:
		tmp = y
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -1.2e-128)
		tmp = x;
	elseif (x <= 8.8e-38)
		tmp = y;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (x <= -1.2e-128)
		tmp = x;
	elseif (x <= 8.8e-38)
		tmp = y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.2e-128], x, If[LessEqual[x, 8.8e-38], y, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-128}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 8.8 \cdot 10^{-38}:\\
\;\;\;\;y\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1999999999999999e-128 or 8.80000000000000029e-38 < x

    1. Initial program 85.6%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative85.6%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*99.9%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 71.4%

      \[\leadsto \color{blue}{x} \]

    if -1.1999999999999999e-128 < x < 8.80000000000000029e-38

    1. Initial program 77.3%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative77.3%

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
      2. associate-/l*96.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
      3. fma-define96.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified96.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 46.3%

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative46.3%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified46.3%

      \[\leadsto \color{blue}{y + x} \]
    8. Taylor expanded in y around inf 35.4%

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 96.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(z - t\right) \cdot \frac{y}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return x + ((z - t) * (y / (z - a)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + ((z - t) * (y / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a):
	return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((z - t) * (y / (z - a)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Derivation
  1. Initial program 82.6%

    \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
  2. Step-by-step derivation
    1. +-commutative82.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
    2. associate-/l*98.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
    3. fma-define98.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-undefine98.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    2. associate-/l*82.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a}} + x \]
    3. div-inv82.6%

      \[\leadsto \color{blue}{\left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}} + x \]
    4. *-commutative82.6%

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

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \left(y \cdot \frac{1}{z - a}\right)} + x \]
    6. div-inv97.5%

      \[\leadsto \left(z - t\right) \cdot \color{blue}{\frac{y}{z - a}} + x \]
  6. Applied egg-rr97.5%

    \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a} + x} \]
  7. Final simplification97.5%

    \[\leadsto x + \left(z - t\right) \cdot \frac{y}{z - a} \]
  8. Add Preprocessing

Alternative 14: 51.2% accurate, 11.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 82.6%

    \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
  2. Step-by-step derivation
    1. +-commutative82.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - t\right)}{z - a} + x} \]
    2. associate-/l*98.8%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a}} + x \]
    3. fma-define98.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  3. Simplified98.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 52.0%

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer Target 1: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{\frac{z - a}{z - t}} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a):
	return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y / ((z - a) / (z - t)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}

Reproduce

?
herbie shell --seed 2024139 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

  :alt
  (! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))

  (+ x (/ (* y (- z t)) (- z a))))