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

Percentage Accurate: 92.9% → 98.5%
Time: 7.6s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 92.9% accurate, 1.0× speedup?

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

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

Alternative 1: 98.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+283}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0 or 1.99999999999999991e283 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 77.9%

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - x}{t}} \]
      2. clear-num99.9%

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 1.99999999999999991e283

    1. Initial program 99.3%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

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

Alternative 2: 54.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -6.2 \cdot 10^{-7}:\\
\;\;\;\;y \cdot \frac{-x}{t}\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{+68}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+251}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.9000000000000003e26

    1. Initial program 89.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative48.4%

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

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

      \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    9. Step-by-step derivation
      1. clear-num58.4%

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

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

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

    if -5.9000000000000003e26 < y < -6.1999999999999999e-7

    1. Initial program 99.7%

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

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

      \[\leadsto y \cdot \color{blue}{\left(-1 \cdot \frac{x}{t}\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg89.6%

        \[\leadsto y \cdot \color{blue}{\left(-\frac{x}{t}\right)} \]
      2. distribute-frac-neg289.6%

        \[\leadsto y \cdot \color{blue}{\frac{x}{-t}} \]
    6. Simplified89.6%

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

    if -6.1999999999999999e-7 < y < 1.09999999999999994e68

    1. Initial program 97.8%

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

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

    if 1.09999999999999994e68 < y < 4.2000000000000001e251

    1. Initial program 87.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative58.7%

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

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

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

    if 4.2000000000000001e251 < y

    1. Initial program 74.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    5. Step-by-step derivation
      1. mul-1-neg42.8%

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

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

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      4. mul-1-neg73.4%

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot y}{t}} \]
      6. mul-1-neg73.4%

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{t} \]
    6. Simplified73.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.9 \cdot 10^{+26}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-7}:\\ \;\;\;\;y \cdot \frac{-x}{t}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+68}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+251}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 54.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{t} \cdot \left(-x\right)\\ \mathbf{if}\;y \leq -1.22 \cdot 10^{+27}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+252}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ y t) (- x))))
   (if (<= y -1.22e+27)
     (/ z (/ t y))
     (if (<= y -6.2e-7)
       t_1
       (if (<= y 4.1e+67) x (if (<= y 5.4e+252) (* z (/ y t)) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / t) * -x;
	double tmp;
	if (y <= -1.22e+27) {
		tmp = z / (t / y);
	} else if (y <= -6.2e-7) {
		tmp = t_1;
	} else if (y <= 4.1e+67) {
		tmp = x;
	} else if (y <= 5.4e+252) {
		tmp = z * (y / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y / t) * -x
    if (y <= (-1.22d+27)) then
        tmp = z / (t / y)
    else if (y <= (-6.2d-7)) then
        tmp = t_1
    else if (y <= 4.1d+67) then
        tmp = x
    else if (y <= 5.4d+252) then
        tmp = z * (y / t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y / t) * -x;
	double tmp;
	if (y <= -1.22e+27) {
		tmp = z / (t / y);
	} else if (y <= -6.2e-7) {
		tmp = t_1;
	} else if (y <= 4.1e+67) {
		tmp = x;
	} else if (y <= 5.4e+252) {
		tmp = z * (y / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / t) * -x
	tmp = 0
	if y <= -1.22e+27:
		tmp = z / (t / y)
	elif y <= -6.2e-7:
		tmp = t_1
	elif y <= 4.1e+67:
		tmp = x
	elif y <= 5.4e+252:
		tmp = z * (y / t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y / t) * Float64(-x))
	tmp = 0.0
	if (y <= -1.22e+27)
		tmp = Float64(z / Float64(t / y));
	elseif (y <= -6.2e-7)
		tmp = t_1;
	elseif (y <= 4.1e+67)
		tmp = x;
	elseif (y <= 5.4e+252)
		tmp = Float64(z * Float64(y / t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y / t) * -x;
	tmp = 0.0;
	if (y <= -1.22e+27)
		tmp = z / (t / y);
	elseif (y <= -6.2e-7)
		tmp = t_1;
	elseif (y <= 4.1e+67)
		tmp = x;
	elseif (y <= 5.4e+252)
		tmp = z * (y / t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * (-x)), $MachinePrecision]}, If[LessEqual[y, -1.22e+27], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.2e-7], t$95$1, If[LessEqual[y, 4.1e+67], x, If[LessEqual[y, 5.4e+252], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y}{t} \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+27}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\

\mathbf{elif}\;y \leq -6.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.1 \cdot 10^{+67}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+252}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.2200000000000001e27

    1. Initial program 89.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative48.4%

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

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

      \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    9. Step-by-step derivation
      1. clear-num58.4%

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

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

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

    if -1.2200000000000001e27 < y < -6.1999999999999999e-7 or 5.40000000000000021e252 < y

    1. Initial program 82.0%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    5. Step-by-step derivation
      1. mul-1-neg56.2%

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

        \[\leadsto -\color{blue}{x \cdot \frac{y}{t}} \]
      3. distribute-rgt-neg-in77.9%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      4. mul-1-neg77.9%

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot y}{t}} \]
      6. mul-1-neg77.9%

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{t} \]
    6. Simplified77.9%

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

    if -6.1999999999999999e-7 < y < 4.09999999999999979e67

    1. Initial program 97.8%

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

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

    if 4.09999999999999979e67 < y < 5.40000000000000021e252

    1. Initial program 87.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative58.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.22 \cdot 10^{+27}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;y \leq -6.2 \cdot 10^{-7}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+252}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-7} \lor \neg \left(y \leq 6 \cdot 10^{+72}\right):\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.50000000000000024e-7 or 6.00000000000000006e72 < y

    1. Initial program 87.1%

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

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

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

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

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

    if -6.50000000000000024e-7 < y < 6.00000000000000006e72

    1. Initial program 97.9%

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

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

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

Alternative 5: 83.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-79} \lor \neg \left(z \leq 2.6 \cdot 10^{-96}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.5000000000000003e-79 or 2.6000000000000002e-96 < z

    1. Initial program 92.2%

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

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

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

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

    if -3.5000000000000003e-79 < z < 2.6000000000000002e-96

    1. Initial program 94.2%

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

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

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

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

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

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

Alternative 6: 76.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9000000000000003e-42 or 4.4999999999999998e66 < y

    1. Initial program 88.0%

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

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

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

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

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

    if -2.9000000000000003e-42 < y < 4.4999999999999998e66

    1. Initial program 97.7%

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

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

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

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

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

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

Alternative 7: 84.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{y}{\frac{t}{z - x}}\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+72}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\

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


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

    1. Initial program 90.2%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - x}{t}} \]
      2. clear-num99.7%

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

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

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

    if -6.50000000000000024e-7 < y < 5.19999999999999963e72

    1. Initial program 97.9%

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

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

    if 5.19999999999999963e72 < y

    1. Initial program 82.9%

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

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

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

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

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

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

Alternative 8: 72.8% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 87.0%

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

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

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

    if -7.0999999999999997e161 < z < 4.0000000000000002e149

    1. Initial program 95.4%

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

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

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

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

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

    if 4.0000000000000002e149 < z

    1. Initial program 86.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative59.4%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    8. Simplified70.9%

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

Alternative 9: 55.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-42} \lor \neg \left(y \leq 4.6 \cdot 10^{+67}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3e-42 or 4.5999999999999997e67 < y

    1. Initial program 87.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative48.3%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    8. Simplified57.7%

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

    if -1.3e-42 < y < 4.5999999999999997e67

    1. Initial program 97.7%

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

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

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

Alternative 10: 54.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.52 \cdot 10^{-40} \lor \neg \left(y \leq 3.85 \cdot 10^{+67}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.51999999999999992e-40 or 3.8500000000000001e67 < y

    1. Initial program 87.9%

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

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

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

    if -1.51999999999999992e-40 < y < 3.8500000000000001e67

    1. Initial program 97.7%

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

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

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

Alternative 11: 55.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{-42}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{+67}:\\
\;\;\;\;x\\

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


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

    1. Initial program 91.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative44.9%

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    8. Simplified53.2%

      \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    9. Step-by-step derivation
      1. clear-num53.2%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    10. Applied egg-rr53.3%

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

    if -3.7000000000000002e-42 < y < 5.2000000000000001e67

    1. Initial program 97.7%

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

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

    if 5.2000000000000001e67 < y

    1. Initial program 83.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative53.0%

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

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

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

Alternative 12: 97.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 13: 93.3% accurate, 1.0× speedup?

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

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

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

      \[\leadsto x + \color{blue}{y \cdot \frac{z - x}{t}} \]
    2. clear-num95.0%

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z - x}}} \]
  4. Applied egg-rr95.2%

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

Alternative 14: 38.5% accurate, 9.0× speedup?

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

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

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

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

Developer target: 91.2% accurate, 0.6× speedup?

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

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

Reproduce

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

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

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