Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E

Percentage Accurate: 93.1% → 97.3%
Time: 10.7s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
x + \frac{y \cdot \left(z - t\right)}{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 11 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: 93.1% accurate, 1.0× speedup?

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

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

Alternative 1: 97.3% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 47.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot y}{y}\\ t_2 := \frac{y}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -8.8 \cdot 10^{+32}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-267}:\\ \;\;\;\;\frac{t \cdot y}{-a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-132}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-43}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+94}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* x y) y)) (t_2 (/ y (/ a z))))
   (if (<= z -8.8e+32)
     t_2
     (if (<= z 8.5e-267)
       (/ (* t y) (- a))
       (if (<= z 1.4e-132)
         t_1
         (if (<= z 5e-43) (* t (/ y (- a))) (if (<= z 2e+94) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (x * y) / y;
	double t_2 = y / (a / z);
	double tmp;
	if (z <= -8.8e+32) {
		tmp = t_2;
	} else if (z <= 8.5e-267) {
		tmp = (t * y) / -a;
	} else if (z <= 1.4e-132) {
		tmp = t_1;
	} else if (z <= 5e-43) {
		tmp = t * (y / -a);
	} else if (z <= 2e+94) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (x * y) / y
    t_2 = y / (a / z)
    if (z <= (-8.8d+32)) then
        tmp = t_2
    else if (z <= 8.5d-267) then
        tmp = (t * y) / -a
    else if (z <= 1.4d-132) then
        tmp = t_1
    else if (z <= 5d-43) then
        tmp = t * (y / -a)
    else if (z <= 2d+94) then
        tmp = t_1
    else
        tmp = t_2
    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) / y;
	double t_2 = y / (a / z);
	double tmp;
	if (z <= -8.8e+32) {
		tmp = t_2;
	} else if (z <= 8.5e-267) {
		tmp = (t * y) / -a;
	} else if (z <= 1.4e-132) {
		tmp = t_1;
	} else if (z <= 5e-43) {
		tmp = t * (y / -a);
	} else if (z <= 2e+94) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (x * y) / y
	t_2 = y / (a / z)
	tmp = 0
	if z <= -8.8e+32:
		tmp = t_2
	elif z <= 8.5e-267:
		tmp = (t * y) / -a
	elif z <= 1.4e-132:
		tmp = t_1
	elif z <= 5e-43:
		tmp = t * (y / -a)
	elif z <= 2e+94:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(x * y) / y)
	t_2 = Float64(y / Float64(a / z))
	tmp = 0.0
	if (z <= -8.8e+32)
		tmp = t_2;
	elseif (z <= 8.5e-267)
		tmp = Float64(Float64(t * y) / Float64(-a));
	elseif (z <= 1.4e-132)
		tmp = t_1;
	elseif (z <= 5e-43)
		tmp = Float64(t * Float64(y / Float64(-a)));
	elseif (z <= 2e+94)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (x * y) / y;
	t_2 = y / (a / z);
	tmp = 0.0;
	if (z <= -8.8e+32)
		tmp = t_2;
	elseif (z <= 8.5e-267)
		tmp = (t * y) / -a;
	elseif (z <= 1.4e-132)
		tmp = t_1;
	elseif (z <= 5e-43)
		tmp = t * (y / -a);
	elseif (z <= 2e+94)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e+32], t$95$2, If[LessEqual[z, 8.5e-267], N[(N[(t * y), $MachinePrecision] / (-a)), $MachinePrecision], If[LessEqual[z, 1.4e-132], t$95$1, If[LessEqual[z, 5e-43], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+94], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{y}\\
t_2 := \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-132}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2 \cdot 10^{+94}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.80000000000000004e32 or 2e94 < z

    1. Initial program 89.6%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 81.8%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      2. un-div-inv61.7%

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    10. Applied egg-rr61.7%

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

    if -8.80000000000000004e32 < z < 8.49999999999999987e-267

    1. Initial program 97.0%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 89.3%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/60.1%

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t}{a}} \]
      2. mul-1-neg60.1%

        \[\leadsto y \cdot \frac{\color{blue}{-t}}{a} \]
    10. Simplified60.1%

      \[\leadsto y \cdot \color{blue}{\frac{-t}{a}} \]
    11. Step-by-step derivation
      1. *-commutative60.1%

        \[\leadsto \color{blue}{\frac{-t}{a} \cdot y} \]
      2. distribute-frac-neg60.1%

        \[\leadsto \color{blue}{\left(-\frac{t}{a}\right)} \cdot y \]
      3. distribute-frac-neg260.1%

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{-a}} \]
    12. Applied egg-rr62.9%

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

    if 8.49999999999999987e-267 < z < 1.40000000000000001e-132 or 5.00000000000000019e-43 < z < 2e94

    1. Initial program 94.6%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 75.5%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    9. Step-by-step derivation
      1. associate-*r/56.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} \]
    10. Applied egg-rr56.5%

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

    if 1.40000000000000001e-132 < z < 5.00000000000000019e-43

    1. Initial program 95.1%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 80.5%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/56.6%

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t}{a}} \]
      2. mul-1-neg56.6%

        \[\leadsto y \cdot \frac{\color{blue}{-t}}{a} \]
    10. Simplified56.6%

      \[\leadsto y \cdot \color{blue}{\frac{-t}{a}} \]
    11. Step-by-step derivation
      1. *-commutative56.6%

        \[\leadsto \color{blue}{\frac{-t}{a} \cdot y} \]
      2. distribute-frac-neg56.6%

        \[\leadsto \color{blue}{\left(-\frac{t}{a}\right)} \cdot y \]
      3. distribute-lft-neg-out56.6%

        \[\leadsto \color{blue}{-\frac{t}{a} \cdot y} \]
      4. div-inv56.7%

        \[\leadsto -\color{blue}{\left(t \cdot \frac{1}{a}\right)} \cdot y \]
      5. add-sqr-sqrt15.9%

        \[\leadsto -\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \frac{1}{a}\right) \cdot y \]
      6. sqrt-unprod16.6%

        \[\leadsto -\left(\color{blue}{\sqrt{t \cdot t}} \cdot \frac{1}{a}\right) \cdot y \]
      7. sqr-neg16.6%

        \[\leadsto -\left(\sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{1}{a}\right) \cdot y \]
      8. sqrt-unprod0.9%

        \[\leadsto -\left(\color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{1}{a}\right) \cdot y \]
      9. add-sqr-sqrt1.6%

        \[\leadsto -\left(\color{blue}{\left(-t\right)} \cdot \frac{1}{a}\right) \cdot y \]
      10. associate-*l*1.6%

        \[\leadsto -\color{blue}{\left(-t\right) \cdot \left(\frac{1}{a} \cdot y\right)} \]
      11. associate-/r/1.6%

        \[\leadsto -\left(-t\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      12. clear-num1.6%

        \[\leadsto -\left(-t\right) \cdot \color{blue}{\frac{y}{a}} \]
      13. add-sqr-sqrt0.8%

        \[\leadsto -\color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      14. sqrt-unprod21.3%

        \[\leadsto -\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{y}{a} \]
      15. sqr-neg21.3%

        \[\leadsto -\sqrt{\color{blue}{t \cdot t}} \cdot \frac{y}{a} \]
      16. sqrt-unprod25.1%

        \[\leadsto -\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \frac{y}{a} \]
      17. add-sqr-sqrt70.7%

        \[\leadsto -\color{blue}{t} \cdot \frac{y}{a} \]
    12. Applied egg-rr70.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+32}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-267}:\\ \;\;\;\;\frac{t \cdot y}{-a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-132}:\\ \;\;\;\;\frac{x \cdot y}{y}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-43}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+94}:\\ \;\;\;\;\frac{x \cdot y}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{-a}\\ t_2 := \frac{x \cdot y}{y}\\ t_3 := \frac{y}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -5.9 \cdot 10^{+31}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-267}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-133}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.15 \cdot 10^{+93}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y (- a)))) (t_2 (/ (* x y) y)) (t_3 (/ y (/ a z))))
   (if (<= z -5.9e+31)
     t_3
     (if (<= z 3.3e-267)
       t_1
       (if (<= z 7.5e-133)
         t_2
         (if (<= z 6.4e-44) t_1 (if (<= z 3.15e+93) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / -a);
	double t_2 = (x * y) / y;
	double t_3 = y / (a / z);
	double tmp;
	if (z <= -5.9e+31) {
		tmp = t_3;
	} else if (z <= 3.3e-267) {
		tmp = t_1;
	} else if (z <= 7.5e-133) {
		tmp = t_2;
	} else if (z <= 6.4e-44) {
		tmp = t_1;
	} else if (z <= 3.15e+93) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = t * (y / -a)
    t_2 = (x * y) / y
    t_3 = y / (a / z)
    if (z <= (-5.9d+31)) then
        tmp = t_3
    else if (z <= 3.3d-267) then
        tmp = t_1
    else if (z <= 7.5d-133) then
        tmp = t_2
    else if (z <= 6.4d-44) then
        tmp = t_1
    else if (z <= 3.15d+93) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / -a);
	double t_2 = (x * y) / y;
	double t_3 = y / (a / z);
	double tmp;
	if (z <= -5.9e+31) {
		tmp = t_3;
	} else if (z <= 3.3e-267) {
		tmp = t_1;
	} else if (z <= 7.5e-133) {
		tmp = t_2;
	} else if (z <= 6.4e-44) {
		tmp = t_1;
	} else if (z <= 3.15e+93) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / -a)
	t_2 = (x * y) / y
	t_3 = y / (a / z)
	tmp = 0
	if z <= -5.9e+31:
		tmp = t_3
	elif z <= 3.3e-267:
		tmp = t_1
	elif z <= 7.5e-133:
		tmp = t_2
	elif z <= 6.4e-44:
		tmp = t_1
	elif z <= 3.15e+93:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / Float64(-a)))
	t_2 = Float64(Float64(x * y) / y)
	t_3 = Float64(y / Float64(a / z))
	tmp = 0.0
	if (z <= -5.9e+31)
		tmp = t_3;
	elseif (z <= 3.3e-267)
		tmp = t_1;
	elseif (z <= 7.5e-133)
		tmp = t_2;
	elseif (z <= 6.4e-44)
		tmp = t_1;
	elseif (z <= 3.15e+93)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / -a);
	t_2 = (x * y) / y;
	t_3 = y / (a / z);
	tmp = 0.0;
	if (z <= -5.9e+31)
		tmp = t_3;
	elseif (z <= 3.3e-267)
		tmp = t_1;
	elseif (z <= 7.5e-133)
		tmp = t_2;
	elseif (z <= 6.4e-44)
		tmp = t_1;
	elseif (z <= 3.15e+93)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.9e+31], t$95$3, If[LessEqual[z, 3.3e-267], t$95$1, If[LessEqual[z, 7.5e-133], t$95$2, If[LessEqual[z, 6.4e-44], t$95$1, If[LessEqual[z, 3.15e+93], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{-a}\\
t_2 := \frac{x \cdot y}{y}\\
t_3 := \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -5.9 \cdot 10^{+31}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-133}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.15 \cdot 10^{+93}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.9000000000000004e31 or 3.14999999999999993e93 < z

    1. Initial program 89.6%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 81.8%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      2. un-div-inv61.7%

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    10. Applied egg-rr61.7%

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

    if -5.9000000000000004e31 < z < 3.30000000000000004e-267 or 7.4999999999999999e-133 < z < 6.3999999999999999e-44

    1. Initial program 96.6%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 87.4%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{t}{a}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/59.3%

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot t}{a}} \]
      2. mul-1-neg59.3%

        \[\leadsto y \cdot \frac{\color{blue}{-t}}{a} \]
    10. Simplified59.3%

      \[\leadsto y \cdot \color{blue}{\frac{-t}{a}} \]
    11. Step-by-step derivation
      1. *-commutative59.3%

        \[\leadsto \color{blue}{\frac{-t}{a} \cdot y} \]
      2. distribute-frac-neg59.3%

        \[\leadsto \color{blue}{\left(-\frac{t}{a}\right)} \cdot y \]
      3. distribute-lft-neg-out59.3%

        \[\leadsto \color{blue}{-\frac{t}{a} \cdot y} \]
      4. div-inv59.2%

        \[\leadsto -\color{blue}{\left(t \cdot \frac{1}{a}\right)} \cdot y \]
      5. add-sqr-sqrt24.0%

        \[\leadsto -\left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \frac{1}{a}\right) \cdot y \]
      6. sqrt-unprod23.5%

        \[\leadsto -\left(\color{blue}{\sqrt{t \cdot t}} \cdot \frac{1}{a}\right) \cdot y \]
      7. sqr-neg23.5%

        \[\leadsto -\left(\sqrt{\color{blue}{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{1}{a}\right) \cdot y \]
      8. sqrt-unprod0.9%

        \[\leadsto -\left(\color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{1}{a}\right) \cdot y \]
      9. add-sqr-sqrt1.6%

        \[\leadsto -\left(\color{blue}{\left(-t\right)} \cdot \frac{1}{a}\right) \cdot y \]
      10. associate-*l*2.7%

        \[\leadsto -\color{blue}{\left(-t\right) \cdot \left(\frac{1}{a} \cdot y\right)} \]
      11. associate-/r/2.7%

        \[\leadsto -\left(-t\right) \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      12. clear-num2.7%

        \[\leadsto -\left(-t\right) \cdot \color{blue}{\frac{y}{a}} \]
      13. add-sqr-sqrt2.0%

        \[\leadsto -\color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \frac{y}{a} \]
      14. sqrt-unprod25.5%

        \[\leadsto -\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot \frac{y}{a} \]
      15. sqr-neg25.5%

        \[\leadsto -\sqrt{\color{blue}{t \cdot t}} \cdot \frac{y}{a} \]
      16. sqrt-unprod28.0%

        \[\leadsto -\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot \frac{y}{a} \]
      17. add-sqr-sqrt64.5%

        \[\leadsto -\color{blue}{t} \cdot \frac{y}{a} \]
    12. Applied egg-rr64.5%

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

    if 3.30000000000000004e-267 < z < 7.4999999999999999e-133 or 6.3999999999999999e-44 < z < 3.14999999999999993e93

    1. Initial program 94.6%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 75.5%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
    9. Step-by-step derivation
      1. associate-*r/56.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{y}} \]
    10. Applied egg-rr56.5%

      \[\leadsto \color{blue}{\frac{y \cdot x}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.9 \cdot 10^{+31}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-267}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-133}:\\ \;\;\;\;\frac{x \cdot y}{y}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-44}:\\ \;\;\;\;t \cdot \frac{y}{-a}\\ \mathbf{elif}\;z \leq 3.15 \cdot 10^{+93}:\\ \;\;\;\;\frac{x \cdot y}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.3% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.09999999999999961e31 or 1.25e26 < z

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

    if -7.09999999999999961e31 < z < 1.25e26

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a}} \]
      5. associate-*r/90.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      7. *-commutative90.5%

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

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

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

        \[\leadsto x - \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr91.2%

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

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

Alternative 5: 86.2% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.1000000000000002e31 or 9.0000000000000006e25 < z

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

    if -3.1000000000000002e31 < z < 9.0000000000000006e25

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a}} \]
      5. associate-*r/90.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot t} \]
      7. *-commutative90.5%

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

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

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

Alternative 6: 77.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+73} \lor \neg \left(t \leq 8.2 \cdot 10^{+51}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.5e73 or 8.20000000000000021e51 < t

    1. Initial program 92.1%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 82.9%

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

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

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

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

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

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

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

    if -7.5e73 < t < 8.20000000000000021e51

    1. Initial program 93.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot z} \]
      2. *-commutative87.2%

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

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

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

Alternative 7: 68.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-187} \lor \neg \left(y \leq 9 \cdot 10^{-104}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.7999999999999998e-187 or 8.9999999999999995e-104 < y

    1. Initial program 91.5%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 92.8%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a}} \]
    10. Simplified77.0%

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

    if -7.7999999999999998e-187 < y < 8.9999999999999995e-104

    1. Initial program 98.0%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 68.2%

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

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

Alternative 8: 48.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-46} \lor \neg \left(y \leq 2.1 \cdot 10^{-102}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.55e-46 or 2.1e-102 < y

    1. Initial program 89.3%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 97.2%

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

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

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

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

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

    if -1.55e-46 < y < 2.1e-102

    1. Initial program 98.7%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 54.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{-46} \lor \neg \left(y \leq 2.1 \cdot 10^{-102}\right):\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 48.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-46}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-103}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.50000000000000001e-46

    1. Initial program 93.1%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 95.5%

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

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

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

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

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

    if -4.50000000000000001e-46 < y < 9.2000000000000003e-103

    1. Initial program 98.7%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 54.9%

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

    if 9.2000000000000003e-103 < y

    1. Initial program 86.1%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 98.6%

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    9. Step-by-step derivation
      1. clear-num52.3%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      2. un-div-inv52.4%

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    10. Applied egg-rr52.4%

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

Alternative 10: 93.2% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 11: 38.2% accurate, 9.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 93.2%

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

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

    \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 32.3%

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

Developer Target 1: 99.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024146 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))

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