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

Percentage Accurate: 85.0% → 98.2%
Time: 7.5s
Alternatives: 15
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 15 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.2% accurate, 1.0× speedup?

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

\\
\frac{y}{\frac{z - a}{z - t}} + x
\end{array}
Derivation
  1. Initial program 83.7%

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

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

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

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

    \[\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.4%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
  6. Applied egg-rr98.4%

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

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

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

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

Alternative 2: 80.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{z - a}\\ \mathbf{if}\;z \leq -6.4 \cdot 10^{+102}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-51}:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 4.25 \cdot 10^{-66}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ z (- z a))))))
   (if (<= z -6.4e+102)
     t_1
     (if (<= z -1.04e-51)
       (- x (* y (/ t z)))
       (if (<= z 4.25e-66) (+ x (/ y (/ a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / (z - a)));
	double tmp;
	if (z <= -6.4e+102) {
		tmp = t_1;
	} else if (z <= -1.04e-51) {
		tmp = x - (y * (t / z));
	} else if (z <= 4.25e-66) {
		tmp = x + (y / (a / t));
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = x + (y * (z / (z - a)))
    if (z <= (-6.4d+102)) then
        tmp = t_1
    else if (z <= (-1.04d-51)) then
        tmp = x - (y * (t / z))
    else if (z <= 4.25d-66) then
        tmp = x + (y / (a / t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (z / (z - a)));
	double tmp;
	if (z <= -6.4e+102) {
		tmp = t_1;
	} else if (z <= -1.04e-51) {
		tmp = x - (y * (t / z));
	} else if (z <= 4.25e-66) {
		tmp = x + (y / (a / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (z / (z - a)))
	tmp = 0
	if z <= -6.4e+102:
		tmp = t_1
	elif z <= -1.04e-51:
		tmp = x - (y * (t / z))
	elif z <= 4.25e-66:
		tmp = x + (y / (a / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a))))
	tmp = 0.0
	if (z <= -6.4e+102)
		tmp = t_1;
	elseif (z <= -1.04e-51)
		tmp = Float64(x - Float64(y * Float64(t / z)));
	elseif (z <= 4.25e-66)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (z / (z - a)));
	tmp = 0.0;
	if (z <= -6.4e+102)
		tmp = t_1;
	elseif (z <= -1.04e-51)
		tmp = x - (y * (t / z));
	elseif (z <= 4.25e-66)
		tmp = x + (y / (a / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+102], t$95$1, If[LessEqual[z, -1.04e-51], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.25e-66], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.04 \cdot 10^{-51}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.3999999999999999e102 or 4.24999999999999983e-66 < z

    1. Initial program 73.1%

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

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

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

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

    if -6.3999999999999999e102 < z < -1.0399999999999999e-51

    1. Initial program 83.2%

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

        \[\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 a around 0 68.4%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
    7. Simplified74.1%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z} + x} \]
    8. Taylor expanded in z around 0 70.2%

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

        \[\leadsto y \cdot \color{blue}{\left(-\frac{t}{z}\right)} + x \]
      2. distribute-neg-frac270.2%

        \[\leadsto y \cdot \color{blue}{\frac{t}{-z}} + x \]
    10. Simplified70.2%

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

    if -1.0399999999999999e-51 < z < 4.24999999999999983e-66

    1. Initial program 94.0%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    6. Applied egg-rr96.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+102}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq -1.04 \cdot 10^{-51}:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 4.25 \cdot 10^{-66}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+103}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-52}:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.6e+103)
   (+ y x)
   (if (<= z -4.8e-52)
     (- x (* y (/ t z)))
     (if (<= z 1.8e-30) (+ x (/ y (/ a t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.6e+103) {
		tmp = y + x;
	} else if (z <= -4.8e-52) {
		tmp = x - (y * (t / z));
	} else if (z <= 1.8e-30) {
		tmp = x + (y / (a / t));
	} 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 <= (-3.6d+103)) then
        tmp = y + x
    else if (z <= (-4.8d-52)) then
        tmp = x - (y * (t / z))
    else if (z <= 1.8d-30) then
        tmp = x + (y / (a / t))
    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 <= -3.6e+103) {
		tmp = y + x;
	} else if (z <= -4.8e-52) {
		tmp = x - (y * (t / z));
	} else if (z <= 1.8e-30) {
		tmp = x + (y / (a / t));
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.6e+103:
		tmp = y + x
	elif z <= -4.8e-52:
		tmp = x - (y * (t / z))
	elif z <= 1.8e-30:
		tmp = x + (y / (a / t))
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.6e+103)
		tmp = Float64(y + x);
	elseif (z <= -4.8e-52)
		tmp = Float64(x - Float64(y * Float64(t / z)));
	elseif (z <= 1.8e-30)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.6e+103)
		tmp = y + x;
	elseif (z <= -4.8e-52)
		tmp = x - (y * (t / z));
	elseif (z <= 1.8e-30)
		tmp = x + (y / (a / t));
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.6e+103], N[(y + x), $MachinePrecision], If[LessEqual[z, -4.8e-52], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-30], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-52}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.60000000000000017e103 or 1.8000000000000002e-30 < z

    1. Initial program 70.4%

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

        \[\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 86.7%

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

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

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

    if -3.60000000000000017e103 < z < -4.8000000000000003e-52

    1. Initial program 83.2%

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

        \[\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 a around 0 68.4%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
    7. Simplified74.1%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z} + x} \]
    8. Taylor expanded in z around 0 70.2%

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

        \[\leadsto y \cdot \color{blue}{\left(-\frac{t}{z}\right)} + x \]
      2. distribute-neg-frac270.2%

        \[\leadsto y \cdot \color{blue}{\frac{t}{-z}} + x \]
    10. Simplified70.2%

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

    if -4.8000000000000003e-52 < z < 1.8000000000000002e-30

    1. Initial program 94.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified96.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-undefine96.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    6. Applied egg-rr96.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+103}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-52}:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-30}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+123}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+109}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4e+123)
   (+ x (* y (/ z (- z a))))
   (if (<= z 7e+109)
     (+ x (/ (* y (- z t)) (- z a)))
     (+ x (/ y (/ (- z a) z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4e+123) {
		tmp = x + (y * (z / (z - a)));
	} else if (z <= 7e+109) {
		tmp = x + ((y * (z - t)) / (z - a));
	} else {
		tmp = x + (y / ((z - a) / 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 (z <= (-4d+123)) then
        tmp = x + (y * (z / (z - a)))
    else if (z <= 7d+109) then
        tmp = x + ((y * (z - t)) / (z - a))
    else
        tmp = x + (y / ((z - a) / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4e+123) {
		tmp = x + (y * (z / (z - a)));
	} else if (z <= 7e+109) {
		tmp = x + ((y * (z - t)) / (z - a));
	} else {
		tmp = x + (y / ((z - a) / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4e+123:
		tmp = x + (y * (z / (z - a)))
	elif z <= 7e+109:
		tmp = x + ((y * (z - t)) / (z - a))
	else:
		tmp = x + (y / ((z - a) / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4e+123)
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	elseif (z <= 7e+109)
		tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a)));
	else
		tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4e+123)
		tmp = x + (y * (z / (z - a)));
	elseif (z <= 7e+109)
		tmp = x + ((y * (z - t)) / (z - a));
	else
		tmp = x + (y / ((z - a) / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+123], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+109], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+123}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.99999999999999991e123

    1. Initial program 51.3%

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

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

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

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

    if -3.99999999999999991e123 < z < 6.99999999999999966e109

    1. Initial program 93.2%

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

    if 6.99999999999999966e109 < z

    1. Initial program 65.2%

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

        \[\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. Step-by-step derivation
      1. fma-undefine100.0%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    6. Applied egg-rr100.0%

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

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

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

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

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

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

Alternative 5: 80.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{-66} \lor \neg \left(z \leq 2.5 \cdot 10^{-117}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -4.2e-66) (not (<= z 2.5e-117)))
   (+ x (* y (/ (- z t) z)))
   (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -4.2e-66) || !(z <= 2.5e-117)) {
		tmp = x + (y * ((z - t) / z));
	} else {
		tmp = x + (y / (a / t));
	}
	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.2d-66)) .or. (.not. (z <= 2.5d-117))) then
        tmp = x + (y * ((z - t) / z))
    else
        tmp = x + (y / (a / t))
    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.2e-66) || !(z <= 2.5e-117)) {
		tmp = x + (y * ((z - t) / z));
	} else {
		tmp = x + (y / (a / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -4.2e-66) or not (z <= 2.5e-117):
		tmp = x + (y * ((z - t) / z))
	else:
		tmp = x + (y / (a / t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -4.2e-66) || !(z <= 2.5e-117))
		tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z)));
	else
		tmp = Float64(x + Float64(y / Float64(a / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -4.2e-66) || ~((z <= 2.5e-117)))
		tmp = x + (y * ((z - t) / z));
	else
		tmp = x + (y / (a / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e-66], N[Not[LessEqual[z, 2.5e-117]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-66} \lor \neg \left(z \leq 2.5 \cdot 10^{-117}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2000000000000001e-66 or 2.5e-117 < z

    1. Initial program 77.8%

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

        \[\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 a around 0 68.0%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} + x \]
    7. Simplified86.1%

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

    if -4.2000000000000001e-66 < z < 2.5e-117

    1. Initial program 93.8%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified95.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-undefine95.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    6. Applied egg-rr95.8%

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

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

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

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

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

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

Alternative 6: 76.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+82} \lor \neg \left(z \leq 4.3 \cdot 10^{-30}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.4999999999999999e82 or 4.29999999999999966e-30 < z

    1. Initial program 71.3%

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

        \[\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.3%

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

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

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

    if -7.4999999999999999e82 < z < 4.29999999999999966e-30

    1. Initial program 91.9%

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

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

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

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

      \[\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.4%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    6. Applied egg-rr97.4%

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

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

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

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

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

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

Alternative 7: 76.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+86} \lor \neg \left(z \leq 9 \cdot 10^{-32}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -2.15e+86) (not (<= z 9e-32))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -2.15e+86) || !(z <= 9e-32)) {
		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 <= (-2.15d+86)) .or. (.not. (z <= 9d-32))) 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 <= -2.15e+86) || !(z <= 9e-32)) {
		tmp = y + x;
	} else {
		tmp = x + (y * (t / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -2.15e+86) or not (z <= 9e-32):
		tmp = y + x
	else:
		tmp = x + (y * (t / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -2.15e+86) || !(z <= 9e-32))
		tmp = Float64(y + x);
	else
		tmp = Float64(x + Float64(y * Float64(t / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -2.15e+86) || ~((z <= 9e-32)))
		tmp = y + x;
	else
		tmp = x + (y * (t / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.15e+86], N[Not[LessEqual[z, 9e-32]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+86} \lor \neg \left(z \leq 9 \cdot 10^{-32}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1500000000000001e86 or 9.00000000000000009e-32 < z

    1. Initial program 71.3%

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

        \[\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.3%

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

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

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

    if -2.1500000000000001e86 < z < 9.00000000000000009e-32

    1. Initial program 91.9%

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

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

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

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

      \[\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.4%

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    6. Applied egg-rr97.4%

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

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

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

Alternative 8: 76.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{+82} \lor \neg \left(z \leq 8.8 \cdot 10^{-32}\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 -9.5e+82) (not (<= z 8.8e-32))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -9.5e+82) || !(z <= 8.8e-32)) {
		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 <= (-9.5d+82)) .or. (.not. (z <= 8.8d-32))) 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 <= -9.5e+82) || !(z <= 8.8e-32)) {
		tmp = y + x;
	} else {
		tmp = x + (t * (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -9.5e+82) or not (z <= 8.8e-32):
		tmp = y + x
	else:
		tmp = x + (t * (y / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -9.5e+82) || !(z <= 8.8e-32))
		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 <= -9.5e+82) || ~((z <= 8.8e-32)))
		tmp = y + x;
	else
		tmp = x + (t * (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e+82], N[Not[LessEqual[z, 8.8e-32]], $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 -9.5 \cdot 10^{+82} \lor \neg \left(z \leq 8.8 \cdot 10^{-32}\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 < -9.50000000000000049e82 or 8.7999999999999999e-32 < z

    1. Initial program 71.3%

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

        \[\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.3%

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

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

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

    if -9.50000000000000049e82 < z < 8.7999999999999999e-32

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{-64} \lor \neg \left(z \leq 4.7 \cdot 10^{-30}\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 -2.8e-64) (not (<= z 4.7e-30))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -2.8e-64) || !(z <= 4.7e-30)) {
		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 <= (-2.8d-64)) .or. (.not. (z <= 4.7d-30))) 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 <= -2.8e-64) || !(z <= 4.7e-30)) {
		tmp = y + x;
	} else {
		tmp = x + ((y * t) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -2.8e-64) or not (z <= 4.7e-30):
		tmp = y + x
	else:
		tmp = x + ((y * t) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -2.8e-64) || !(z <= 4.7e-30))
		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 <= -2.8e-64) || ~((z <= 4.7e-30)))
		tmp = y + x;
	else
		tmp = x + ((y * t) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e-64], N[Not[LessEqual[z, 4.7e-30]], $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 -2.8 \cdot 10^{-64} \lor \neg \left(z \leq 4.7 \cdot 10^{-30}\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 < -2.80000000000000004e-64 or 4.69999999999999969e-30 < z

    1. Initial program 74.8%

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

        \[\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.0%

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

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

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

    if -2.80000000000000004e-64 < z < 4.69999999999999969e-30

    1. Initial program 94.2%

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

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

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

Alternative 10: 60.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.8 \cdot 10^{+201} \lor \neg \left(t \leq 1.25 \cdot 10^{+146}\right):\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -2.8e+201) (not (<= t 1.25e+146))) (* t (/ y a)) (+ y x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -2.8e+201) || !(t <= 1.25e+146)) {
		tmp = t * (y / 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 ((t <= (-2.8d+201)) .or. (.not. (t <= 1.25d+146))) then
        tmp = t * (y / 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 ((t <= -2.8e+201) || !(t <= 1.25e+146)) {
		tmp = t * (y / a);
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -2.8e+201) or not (t <= 1.25e+146):
		tmp = t * (y / a)
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -2.8e+201) || !(t <= 1.25e+146))
		tmp = Float64(t * Float64(y / a));
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -2.8e+201) || ~((t <= 1.25e+146)))
		tmp = t * (y / a);
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.8e+201], N[Not[LessEqual[t, 1.25e+146]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+201} \lor \neg \left(t \leq 1.25 \cdot 10^{+146}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.80000000000000005e201 or 1.25e146 < t

    1. Initial program 81.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    7. Step-by-step derivation
      1. associate-/l*51.5%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified51.5%

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

    if -2.80000000000000005e201 < t < 1.25e146

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

Alternative 11: 59.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+140}:\\ \;\;\;\;y \cdot \frac{z - t}{z}\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+146}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -2.4e+140)
   (* y (/ (- z t) z))
   (if (<= t 1.25e+146) (+ y x) (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -2.4e+140) {
		tmp = y * ((z - t) / z);
	} else if (t <= 1.25e+146) {
		tmp = y + x;
	} else {
		tmp = 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 (t <= (-2.4d+140)) then
        tmp = y * ((z - t) / z)
    else if (t <= 1.25d+146) then
        tmp = y + x
    else
        tmp = 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 (t <= -2.4e+140) {
		tmp = y * ((z - t) / z);
	} else if (t <= 1.25e+146) {
		tmp = y + x;
	} else {
		tmp = t * (y / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= -2.4e+140:
		tmp = y * ((z - t) / z)
	elif t <= 1.25e+146:
		tmp = y + x
	else:
		tmp = t * (y / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= -2.4e+140)
		tmp = Float64(y * Float64(Float64(z - t) / z));
	elseif (t <= 1.25e+146)
		tmp = Float64(y + x);
	else
		tmp = Float64(t * Float64(y / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -2.4e+140)
		tmp = y * ((z - t) / z);
	elseif (t <= 1.25e+146)
		tmp = y + x;
	else
		tmp = t * (y / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.4e+140], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+146], N[(y + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 1.25 \cdot 10^{+146}:\\
\;\;\;\;y + x\\

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


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

    1. Initial program 73.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{z}} \]
    8. Simplified49.5%

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

    if -2.4e140 < t < 1.25e146

    1. Initial program 85.4%

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

        \[\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 72.4%

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

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

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

    if 1.25e146 < t

    1. Initial program 84.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    7. Step-by-step derivation
      1. associate-/l*58.0%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified58.0%

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

Alternative 12: 53.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+175}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+89}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -4.5e+175) y (if (<= y 4e+89) x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -4.5e+175) {
		tmp = y;
	} else if (y <= 4e+89) {
		tmp = x;
	} else {
		tmp = 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 (y <= (-4.5d+175)) then
        tmp = y
    else if (y <= 4d+89) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -4.5e+175) {
		tmp = y;
	} else if (y <= 4e+89) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -4.5e+175:
		tmp = y
	elif y <= 4e+89:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -4.5e+175)
		tmp = y;
	elseif (y <= 4e+89)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -4.5e+175)
		tmp = y;
	elseif (y <= 4e+89)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.5e+175], y, If[LessEqual[y, 4e+89], x, y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+175}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+89}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.49999999999999989e175 or 3.99999999999999998e89 < y

    1. Initial program 58.5%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative58.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 y around -inf 47.2%

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

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

    if -4.49999999999999989e175 < y < 3.99999999999999998e89

    1. Initial program 94.5%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified97.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 61.3%

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

Alternative 13: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Derivation
  1. Initial program 83.7%

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

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

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

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

    \[\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.4%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
  6. Applied egg-rr98.4%

    \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
  7. Final simplification98.4%

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

Alternative 14: 61.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 4.3 \cdot 10^{+206}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a) :precision binary64 (if (<= a 4.3e+206) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= 4.3e+206) {
		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 <= 4.3d+206) 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 <= 4.3e+206) {
		tmp = y + x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= 4.3e+206:
		tmp = y + x
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= 4.3e+206)
		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 <= 4.3e+206)
		tmp = y + x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 4.3e+206], N[(y + x), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.3 \cdot 10^{+206}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.29999999999999988e206

    1. Initial program 84.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified61.5%

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

    if 4.29999999999999988e206 < a

    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 y around 0 72.2%

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

Alternative 15: 50.4% 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 83.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  3. Simplified98.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 48.4%

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

Developer target: 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 2024100 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

  :alt
  (+ x (/ y (/ (- z a) (- z t))))

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