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

Percentage Accurate: 85.5% → 98.0%
Time: 10.6s
Alternatives: 13
Speedup: 0.8×

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 13 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.5% 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.0% 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 91.5%

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

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

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

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

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

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

Alternative 2: 96.6% 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 -4 \cdot 10^{+306}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+292}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z - t}{\frac{z - a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (<= t_1 -4e+306)
     (* (- z t) (/ y (- z a)))
     (if (<= t_1 5e+292) (+ x t_1) (/ (- z t) (/ (- z a) y))))))
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 <= -4e+306) {
		tmp = (z - t) * (y / (z - a));
	} else if (t_1 <= 5e+292) {
		tmp = x + t_1;
	} else {
		tmp = (z - t) / ((z - 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) :: t_1
    real(8) :: tmp
    t_1 = (y * (z - t)) / (z - a)
    if (t_1 <= (-4d+306)) then
        tmp = (z - t) * (y / (z - a))
    else if (t_1 <= 5d+292) then
        tmp = x + t_1
    else
        tmp = (z - t) / ((z - a) / y)
    end if
    code = tmp
end function
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 <= -4e+306) {
		tmp = (z - t) * (y / (z - a));
	} else if (t_1 <= 5e+292) {
		tmp = x + t_1;
	} else {
		tmp = (z - t) / ((z - a) / y);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if t_1 <= -4e+306:
		tmp = (z - t) * (y / (z - a))
	elif t_1 <= 5e+292:
		tmp = x + t_1
	else:
		tmp = (z - t) / ((z - a) / y)
	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 <= -4e+306)
		tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a)));
	elseif (t_1 <= 5e+292)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(Float64(z - t) / Float64(Float64(z - a) / y));
	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 <= -4e+306)
		tmp = (z - t) * (y / (z - a));
	elseif (t_1 <= 5e+292)
		tmp = x + t_1;
	else
		tmp = (z - t) / ((z - a) / y);
	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, -4e+306], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+292], N[(x + t$95$1), $MachinePrecision], N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+306}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;x + t\_1\\

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


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

    1. Initial program 64.2%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    6. Step-by-step derivation
      1. div-sub95.6%

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

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

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

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

    if -4.00000000000000007e306 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.9999999999999996e292

    1. Initial program 99.5%

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

    if 4.9999999999999996e292 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 51.1%

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

        \[\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 y around inf 78.9%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    6. Step-by-step derivation
      1. div-sub78.9%

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
    8. Step-by-step derivation
      1. *-commutative78.7%

        \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{z - a}} \]
      2. clear-num78.8%

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

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

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

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

Alternative 3: 79.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{z - a}\\ \mathbf{if}\;z \leq -9 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-125}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-103}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq 6000000000:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \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 -9e+17)
     t_1
     (if (<= z 6e-125)
       (+ x (* y (/ t a)))
       (if (<= z 1.85e-103)
         (* (- z t) (/ y (- z a)))
         (if (<= z 6000000000.0) (+ x (/ (* y t) a)) 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 <= -9e+17) {
		tmp = t_1;
	} else if (z <= 6e-125) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.85e-103) {
		tmp = (z - t) * (y / (z - a));
	} else if (z <= 6000000000.0) {
		tmp = x + ((y * t) / a);
	} 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 <= (-9d+17)) then
        tmp = t_1
    else if (z <= 6d-125) then
        tmp = x + (y * (t / a))
    else if (z <= 1.85d-103) then
        tmp = (z - t) * (y / (z - a))
    else if (z <= 6000000000.0d0) then
        tmp = x + ((y * t) / a)
    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 <= -9e+17) {
		tmp = t_1;
	} else if (z <= 6e-125) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.85e-103) {
		tmp = (z - t) * (y / (z - a));
	} else if (z <= 6000000000.0) {
		tmp = x + ((y * t) / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (z / (z - a)))
	tmp = 0
	if z <= -9e+17:
		tmp = t_1
	elif z <= 6e-125:
		tmp = x + (y * (t / a))
	elif z <= 1.85e-103:
		tmp = (z - t) * (y / (z - a))
	elif z <= 6000000000.0:
		tmp = x + ((y * t) / a)
	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 <= -9e+17)
		tmp = t_1;
	elseif (z <= 6e-125)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 1.85e-103)
		tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a)));
	elseif (z <= 6000000000.0)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	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 <= -9e+17)
		tmp = t_1;
	elseif (z <= 6e-125)
		tmp = x + (y * (t / a));
	elseif (z <= 1.85e-103)
		tmp = (z - t) * (y / (z - a));
	elseif (z <= 6000000000.0)
		tmp = x + ((y * t) / a);
	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, -9e+17], t$95$1, If[LessEqual[z, 6e-125], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-103], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6000000000.0], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq 1.85 \cdot 10^{-103}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\

\mathbf{elif}\;z \leq 6000000000:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -9e17 or 6e9 < z

    1. Initial program 83.5%

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

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

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

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

    if -9e17 < z < 5.99999999999999981e-125

    1. Initial program 96.7%

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

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

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

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

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

    if 5.99999999999999981e-125 < z < 1.85e-103

    1. Initial program 99.5%

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

        \[\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 y around inf 95.6%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    6. Step-by-step derivation
      1. div-sub95.6%

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

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

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
    7. Simplified95.6%

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

    if 1.85e-103 < z < 6e9

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+17}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-125}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-103}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq 6000000000:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y}{1 - \frac{a}{z}}\\ \mathbf{if}\;z \leq -13000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-125}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 1.92 \cdot 10^{-103}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq 5600000000:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ y (- 1.0 (/ a z))))))
   (if (<= z -13000000.0)
     t_1
     (if (<= z 7.2e-125)
       (+ x (* y (/ t a)))
       (if (<= z 1.92e-103)
         (* (- z t) (/ y (- z a)))
         (if (<= z 5600000000.0) (+ x (/ (* y t) a)) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y / (1.0 - (a / z)));
	double tmp;
	if (z <= -13000000.0) {
		tmp = t_1;
	} else if (z <= 7.2e-125) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.92e-103) {
		tmp = (z - t) * (y / (z - a));
	} else if (z <= 5600000000.0) {
		tmp = x + ((y * t) / a);
	} 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 / (1.0d0 - (a / z)))
    if (z <= (-13000000.0d0)) then
        tmp = t_1
    else if (z <= 7.2d-125) then
        tmp = x + (y * (t / a))
    else if (z <= 1.92d-103) then
        tmp = (z - t) * (y / (z - a))
    else if (z <= 5600000000.0d0) then
        tmp = x + ((y * t) / a)
    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 / (1.0 - (a / z)));
	double tmp;
	if (z <= -13000000.0) {
		tmp = t_1;
	} else if (z <= 7.2e-125) {
		tmp = x + (y * (t / a));
	} else if (z <= 1.92e-103) {
		tmp = (z - t) * (y / (z - a));
	} else if (z <= 5600000000.0) {
		tmp = x + ((y * t) / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y / (1.0 - (a / z)))
	tmp = 0
	if z <= -13000000.0:
		tmp = t_1
	elif z <= 7.2e-125:
		tmp = x + (y * (t / a))
	elif z <= 1.92e-103:
		tmp = (z - t) * (y / (z - a))
	elif z <= 5600000000.0:
		tmp = x + ((y * t) / a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y / Float64(1.0 - Float64(a / z))))
	tmp = 0.0
	if (z <= -13000000.0)
		tmp = t_1;
	elseif (z <= 7.2e-125)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 1.92e-103)
		tmp = Float64(Float64(z - t) * Float64(y / Float64(z - a)));
	elseif (z <= 5600000000.0)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y / (1.0 - (a / z)));
	tmp = 0.0;
	if (z <= -13000000.0)
		tmp = t_1;
	elseif (z <= 7.2e-125)
		tmp = x + (y * (t / a));
	elseif (z <= 1.92e-103)
		tmp = (z - t) * (y / (z - a));
	elseif (z <= 5600000000.0)
		tmp = x + ((y * t) / a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -13000000.0], t$95$1, If[LessEqual[z, 7.2e-125], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.92e-103], N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5600000000.0], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{if}\;z \leq -13000000:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.92 \cdot 10^{-103}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\

\mathbf{elif}\;z \leq 5600000000:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.3e7 or 5.6e9 < z

    1. Initial program 83.5%

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

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

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

      \[\leadsto x + \color{blue}{{\left(\frac{z - a}{y \cdot \left(z - t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-183.5%

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

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

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

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

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

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

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

    if -1.3e7 < z < 7.2000000000000004e-125

    1. Initial program 96.7%

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

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

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

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

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

    if 7.2000000000000004e-125 < z < 1.9200000000000001e-103

    1. Initial program 99.5%

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

        \[\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 y around inf 95.6%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    6. Step-by-step derivation
      1. div-sub95.6%

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

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

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
    7. Simplified95.6%

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

    if 1.9200000000000001e-103 < z < 5.6e9

    1. Initial program 99.9%

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

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

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

Alternative 5: 79.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y}{1 - \frac{a}{z}}\\ \mathbf{if}\;z \leq -3200000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.35 \cdot 10^{-147}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-84}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z}\\ \mathbf{elif}\;z \leq 5600000000:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ y (- 1.0 (/ a z))))))
   (if (<= z -3200000000000.0)
     t_1
     (if (<= z 4.35e-147)
       (+ x (* y (/ t a)))
       (if (<= z 2.1e-84)
         (+ x (/ (* y (- z t)) z))
         (if (<= z 5600000000.0) (+ x (/ (* y t) a)) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y / (1.0 - (a / z)));
	double tmp;
	if (z <= -3200000000000.0) {
		tmp = t_1;
	} else if (z <= 4.35e-147) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.1e-84) {
		tmp = x + ((y * (z - t)) / z);
	} else if (z <= 5600000000.0) {
		tmp = x + ((y * t) / a);
	} 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 / (1.0d0 - (a / z)))
    if (z <= (-3200000000000.0d0)) then
        tmp = t_1
    else if (z <= 4.35d-147) then
        tmp = x + (y * (t / a))
    else if (z <= 2.1d-84) then
        tmp = x + ((y * (z - t)) / z)
    else if (z <= 5600000000.0d0) then
        tmp = x + ((y * t) / a)
    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 / (1.0 - (a / z)));
	double tmp;
	if (z <= -3200000000000.0) {
		tmp = t_1;
	} else if (z <= 4.35e-147) {
		tmp = x + (y * (t / a));
	} else if (z <= 2.1e-84) {
		tmp = x + ((y * (z - t)) / z);
	} else if (z <= 5600000000.0) {
		tmp = x + ((y * t) / a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y / (1.0 - (a / z)))
	tmp = 0
	if z <= -3200000000000.0:
		tmp = t_1
	elif z <= 4.35e-147:
		tmp = x + (y * (t / a))
	elif z <= 2.1e-84:
		tmp = x + ((y * (z - t)) / z)
	elif z <= 5600000000.0:
		tmp = x + ((y * t) / a)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y / Float64(1.0 - Float64(a / z))))
	tmp = 0.0
	if (z <= -3200000000000.0)
		tmp = t_1;
	elseif (z <= 4.35e-147)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif (z <= 2.1e-84)
		tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / z));
	elseif (z <= 5600000000.0)
		tmp = Float64(x + Float64(Float64(y * t) / a));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y / (1.0 - (a / z)));
	tmp = 0.0;
	if (z <= -3200000000000.0)
		tmp = t_1;
	elseif (z <= 4.35e-147)
		tmp = x + (y * (t / a));
	elseif (z <= 2.1e-84)
		tmp = x + ((y * (z - t)) / z);
	elseif (z <= 5600000000.0)
		tmp = x + ((y * t) / a);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3200000000000.0], t$95$1, If[LessEqual[z, 4.35e-147], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-84], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5600000000.0], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y}{1 - \frac{a}{z}}\\
\mathbf{if}\;z \leq -3200000000000:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;z \leq 5600000000:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.2e12 or 5.6e9 < z

    1. Initial program 83.5%

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

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

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

      \[\leadsto x + \color{blue}{{\left(\frac{z - a}{y \cdot \left(z - t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-183.5%

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

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

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

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

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

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

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

    if -3.2e12 < z < 4.3500000000000002e-147

    1. Initial program 96.5%

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

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

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

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

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

    if 4.3500000000000002e-147 < z < 2.09999999999999998e-84

    1. Initial program 99.8%

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

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

    if 2.09999999999999998e-84 < z < 5.6e9

    1. Initial program 99.8%

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

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

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

Alternative 6: 73.8% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 4 \cdot 10^{-103}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.4000000000000003e28 or 9.50000000000000061e75 < z

    1. Initial program 81.9%

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

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

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

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

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

    if -5.4000000000000003e28 < z < 4.8000000000000003e-125

    1. Initial program 96.7%

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

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

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

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

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

    if 4.8000000000000003e-125 < z < 3.99999999999999983e-103

    1. Initial program 99.5%

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

        \[\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 y around inf 95.6%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    6. Step-by-step derivation
      1. div-sub95.6%

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

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

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
    7. Simplified95.6%

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

    if 3.99999999999999983e-103 < z < 9.50000000000000061e75

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+28}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-125}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-103}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+75}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 79.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.95 \cdot 10^{-28}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;a \leq 245:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\

\mathbf{elif}\;a \leq 5 \cdot 10^{+185}:\\
\;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\

\mathbf{elif}\;a \leq 9.6 \cdot 10^{+264}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -3.9499999999999999e-28

    1. Initial program 89.6%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. *-commutative87.0%

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

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

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

    if -3.9499999999999999e-28 < a < 245

    1. Initial program 92.3%

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

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

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

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

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

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

    if 245 < a < 4.9999999999999999e185

    1. Initial program 90.0%

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

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

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

      \[\leadsto x + \color{blue}{{\left(\frac{z - a}{y \cdot \left(z - t\right)}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-189.9%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{z - a}{z - t}}{y}}} \]
    6. Simplified99.9%

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

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

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

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

    if 4.9999999999999999e185 < a < 9.59999999999999971e264

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if 9.59999999999999971e264 < a

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.95 \cdot 10^{-28}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;a \leq 245:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{elif}\;a \leq 5 \cdot 10^{+185}:\\ \;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{+264}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 82.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{-28} \lor \neg \left(a \leq 1.1 \cdot 10^{+31}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.99999999999999988e-28 or 1.10000000000000005e31 < a

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999988e-28 < a < 1.10000000000000005e31

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 74.6% accurate, 0.6× speedup?

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

    1. Initial program 81.9%

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

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

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

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

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

    if -8.8e18 < z < 9.50000000000000061e75

    1. Initial program 97.5%

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

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

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

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

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

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

Alternative 10: 97.5% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{z - a}{z - t}}{y}}} \]
  6. Simplified98.7%

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

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

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

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

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

Alternative 11: 62.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 8.1 \cdot 10^{+93}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.79999999999999996e144 or 8.09999999999999983e93 < a

    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*99.4%

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

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

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

    if -5.79999999999999996e144 < a < 8.09999999999999983e93

    1. Initial program 91.0%

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

        \[\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 z around inf 65.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.8 \cdot 10^{+144}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 8.1 \cdot 10^{+93}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 98.0% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{z - a}{z - t}}{y}}} \]
  6. Simplified98.7%

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

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

Alternative 13: 49.6% 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 91.5%

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

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

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

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

    \[\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} \]
  6. Final simplification56.6%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 98.1% 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 2024054 
(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))))