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

Percentage Accurate: 92.8% → 99.1%
Time: 11.4s
Alternatives: 17
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 17 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.8% 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: 99.1% 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 10^{+308}\right):\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \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 1e+308)))
     (+ x (* y (/ (- z x) t)))
     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 <= 1e+308)) {
		tmp = x + (y * ((z - x) / t));
	} 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 <= 1e+308)) {
		tmp = x + (y * ((z - x) / t));
	} 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 <= 1e+308):
		tmp = x + (y * ((z - x) / t))
	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 <= 1e+308))
		tmp = Float64(x + Float64(y * Float64(Float64(z - x) / t)));
	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 <= 1e+308)))
		tmp = x + (y * ((z - x) / t));
	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, 1e+308]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - x), $MachinePrecision] / t), $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 10^{+308}\right):\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\

\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 1e308 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 76.2%

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

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

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

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

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

    1. Initial program 99.8%

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

    \[\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 10^{+308}\right):\\ \;\;\;\;x + y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(z - x\right) \cdot y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 52.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot y}{t}\\ \mathbf{if}\;t \leq -8.1 \cdot 10^{+30}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq -7.2 \cdot 10^{-264}:\\ \;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{-267}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-156}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+32}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* z y) t)))
   (if (<= t -8.1e+30)
     x
     (if (<= t -9.2e-82)
       (* z (/ y t))
       (if (<= t -7.2e-264)
         (* (- y) (/ x t))
         (if (<= t 3.1e-267)
           t_1
           (if (<= t 2.05e-156)
             (* x (/ y (- t)))
             (if (<= t 1.4e+32) t_1 x))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * y) / t;
	double tmp;
	if (t <= -8.1e+30) {
		tmp = x;
	} else if (t <= -9.2e-82) {
		tmp = z * (y / t);
	} else if (t <= -7.2e-264) {
		tmp = -y * (x / t);
	} else if (t <= 3.1e-267) {
		tmp = t_1;
	} else if (t <= 2.05e-156) {
		tmp = x * (y / -t);
	} else if (t <= 1.4e+32) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (z * y) / t
    if (t <= (-8.1d+30)) then
        tmp = x
    else if (t <= (-9.2d-82)) then
        tmp = z * (y / t)
    else if (t <= (-7.2d-264)) then
        tmp = -y * (x / t)
    else if (t <= 3.1d-267) then
        tmp = t_1
    else if (t <= 2.05d-156) then
        tmp = x * (y / -t)
    else if (t <= 1.4d+32) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z * y) / t;
	double tmp;
	if (t <= -8.1e+30) {
		tmp = x;
	} else if (t <= -9.2e-82) {
		tmp = z * (y / t);
	} else if (t <= -7.2e-264) {
		tmp = -y * (x / t);
	} else if (t <= 3.1e-267) {
		tmp = t_1;
	} else if (t <= 2.05e-156) {
		tmp = x * (y / -t);
	} else if (t <= 1.4e+32) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z * y) / t
	tmp = 0
	if t <= -8.1e+30:
		tmp = x
	elif t <= -9.2e-82:
		tmp = z * (y / t)
	elif t <= -7.2e-264:
		tmp = -y * (x / t)
	elif t <= 3.1e-267:
		tmp = t_1
	elif t <= 2.05e-156:
		tmp = x * (y / -t)
	elif t <= 1.4e+32:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z * y) / t)
	tmp = 0.0
	if (t <= -8.1e+30)
		tmp = x;
	elseif (t <= -9.2e-82)
		tmp = Float64(z * Float64(y / t));
	elseif (t <= -7.2e-264)
		tmp = Float64(Float64(-y) * Float64(x / t));
	elseif (t <= 3.1e-267)
		tmp = t_1;
	elseif (t <= 2.05e-156)
		tmp = Float64(x * Float64(y / Float64(-t)));
	elseif (t <= 1.4e+32)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z * y) / t;
	tmp = 0.0;
	if (t <= -8.1e+30)
		tmp = x;
	elseif (t <= -9.2e-82)
		tmp = z * (y / t);
	elseif (t <= -7.2e-264)
		tmp = -y * (x / t);
	elseif (t <= 3.1e-267)
		tmp = t_1;
	elseif (t <= 2.05e-156)
		tmp = x * (y / -t);
	elseif (t <= 1.4e+32)
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -8.1e+30], x, If[LessEqual[t, -9.2e-82], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.2e-264], N[((-y) * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e-267], t$95$1, If[LessEqual[t, 2.05e-156], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+32], t$95$1, x]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t}\\
\mathbf{if}\;t \leq -8.1 \cdot 10^{+30}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

\mathbf{elif}\;t \leq -7.2 \cdot 10^{-264}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\

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

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

\mathbf{elif}\;t \leq 1.4 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -8.0999999999999996e30 or 1.4e32 < t

    1. Initial program 82.1%

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

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

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

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

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

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

    if -8.0999999999999996e30 < t < -9.19999999999999988e-82

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    10. Applied egg-rr56.2%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/56.4%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. *-commutative56.4%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    12. Applied egg-rr56.4%

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

    if -9.19999999999999988e-82 < t < -7.2000000000000004e-264

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.2000000000000004e-264 < t < 3.1000000000000001e-267 or 2.0500000000000001e-156 < t < 1.4e32

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if 3.1000000000000001e-267 < t < 2.0500000000000001e-156

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{t} \]
    8. Simplified68.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.1 \cdot 10^{+30}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq -7.2 \cdot 10^{-264}:\\ \;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;t \leq 3.1 \cdot 10^{-267}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-156}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+32}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{t}\\ \mathbf{if}\;t \leq -1.32 \cdot 10^{+37}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.12 \cdot 10^{-259}:\\ \;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{-253}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-155}:\\ \;\;\;\;\frac{x}{\frac{t}{-y}}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+30}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ y t))))
   (if (<= t -1.32e+37)
     x
     (if (<= t -9.2e-82)
       t_1
       (if (<= t -1.12e-259)
         (* (- y) (/ x t))
         (if (<= t 4.4e-253)
           t_1
           (if (<= t 3.7e-155)
             (/ x (/ t (- y)))
             (if (<= t 4.1e+30) (/ (* z y) t) x))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (y / t);
	double tmp;
	if (t <= -1.32e+37) {
		tmp = x;
	} else if (t <= -9.2e-82) {
		tmp = t_1;
	} else if (t <= -1.12e-259) {
		tmp = -y * (x / t);
	} else if (t <= 4.4e-253) {
		tmp = t_1;
	} else if (t <= 3.7e-155) {
		tmp = x / (t / -y);
	} else if (t <= 4.1e+30) {
		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) :: t_1
    real(8) :: tmp
    t_1 = z * (y / t)
    if (t <= (-1.32d+37)) then
        tmp = x
    else if (t <= (-9.2d-82)) then
        tmp = t_1
    else if (t <= (-1.12d-259)) then
        tmp = -y * (x / t)
    else if (t <= 4.4d-253) then
        tmp = t_1
    else if (t <= 3.7d-155) then
        tmp = x / (t / -y)
    else if (t <= 4.1d+30) 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 t_1 = z * (y / t);
	double tmp;
	if (t <= -1.32e+37) {
		tmp = x;
	} else if (t <= -9.2e-82) {
		tmp = t_1;
	} else if (t <= -1.12e-259) {
		tmp = -y * (x / t);
	} else if (t <= 4.4e-253) {
		tmp = t_1;
	} else if (t <= 3.7e-155) {
		tmp = x / (t / -y);
	} else if (t <= 4.1e+30) {
		tmp = (z * y) / t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (y / t)
	tmp = 0
	if t <= -1.32e+37:
		tmp = x
	elif t <= -9.2e-82:
		tmp = t_1
	elif t <= -1.12e-259:
		tmp = -y * (x / t)
	elif t <= 4.4e-253:
		tmp = t_1
	elif t <= 3.7e-155:
		tmp = x / (t / -y)
	elif t <= 4.1e+30:
		tmp = (z * y) / t
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(y / t))
	tmp = 0.0
	if (t <= -1.32e+37)
		tmp = x;
	elseif (t <= -9.2e-82)
		tmp = t_1;
	elseif (t <= -1.12e-259)
		tmp = Float64(Float64(-y) * Float64(x / t));
	elseif (t <= 4.4e-253)
		tmp = t_1;
	elseif (t <= 3.7e-155)
		tmp = Float64(x / Float64(t / Float64(-y)));
	elseif (t <= 4.1e+30)
		tmp = Float64(Float64(z * y) / t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (y / t);
	tmp = 0.0;
	if (t <= -1.32e+37)
		tmp = x;
	elseif (t <= -9.2e-82)
		tmp = t_1;
	elseif (t <= -1.12e-259)
		tmp = -y * (x / t);
	elseif (t <= 4.4e-253)
		tmp = t_1;
	elseif (t <= 3.7e-155)
		tmp = x / (t / -y);
	elseif (t <= 4.1e+30)
		tmp = (z * y) / t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.32e+37], x, If[LessEqual[t, -9.2e-82], t$95$1, If[LessEqual[t, -1.12e-259], N[((-y) * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-253], t$95$1, If[LessEqual[t, 3.7e-155], N[(x / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+30], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -1.32 \cdot 10^{+37}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.12 \cdot 10^{-259}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\

\mathbf{elif}\;t \leq 4.4 \cdot 10^{-253}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.3199999999999999e37 or 4.10000000000000005e30 < t

    1. Initial program 82.1%

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

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

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

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

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

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

    if -1.3199999999999999e37 < t < -9.19999999999999988e-82 or -1.1199999999999999e-259 < t < 4.39999999999999992e-253

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/59.0%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. *-commutative59.0%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    12. Applied egg-rr59.0%

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

    if -9.19999999999999988e-82 < t < -1.1199999999999999e-259

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.39999999999999992e-253 < t < 3.7e-155

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{t} \]
    8. Simplified72.7%

      \[\leadsto \color{blue}{x \cdot \frac{-y}{t}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt29.7%

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

        \[\leadsto x \cdot \color{blue}{\sqrt{\frac{-y}{t} \cdot \frac{-y}{t}}} \]
      3. distribute-frac-neg30.1%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\frac{y}{t}} \cdot \sqrt{\frac{y}{t}}\right)} \]
      7. add-sqr-sqrt5.5%

        \[\leadsto x \cdot \color{blue}{\frac{y}{t}} \]
      8. clear-num5.5%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      9. div-inv5.5%

        \[\leadsto \color{blue}{\frac{x}{\frac{t}{y}}} \]
      10. frac-2neg5.5%

        \[\leadsto \color{blue}{\frac{-x}{-\frac{t}{y}}} \]
      11. distribute-frac-neg25.5%

        \[\leadsto \frac{-x}{\color{blue}{\frac{t}{-y}}} \]
      12. add-sqr-sqrt5.1%

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

        \[\leadsto \frac{-x}{\frac{t}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}} \]
      14. sqr-neg43.6%

        \[\leadsto \frac{-x}{\frac{t}{\sqrt{\color{blue}{y \cdot y}}}} \]
      15. sqrt-unprod42.9%

        \[\leadsto \frac{-x}{\frac{t}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}} \]
      16. add-sqr-sqrt72.8%

        \[\leadsto \frac{-x}{\frac{t}{\color{blue}{y}}} \]
    10. Applied egg-rr72.8%

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

    if 3.7e-155 < t < 4.10000000000000005e30

    1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.32 \cdot 10^{+37}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq -1.12 \cdot 10^{-259}:\\ \;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\ \mathbf{elif}\;t \leq 4.4 \cdot 10^{-253}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{-155}:\\ \;\;\;\;\frac{x}{\frac{t}{-y}}\\ \mathbf{elif}\;t \leq 4.1 \cdot 10^{+30}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 53.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot \left(-y\right)}{t}\\ t_2 := z \cdot \frac{y}{t}\\ \mathbf{if}\;t \leq -1.58 \cdot 10^{+31}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-81}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -2.25 \cdot 10^{-276}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-251}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-155}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+35}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* x (- y)) t)) (t_2 (* z (/ y t))))
   (if (<= t -1.58e+31)
     x
     (if (<= t -1.45e-81)
       t_2
       (if (<= t -2.25e-276)
         t_1
         (if (<= t 1.2e-251)
           t_2
           (if (<= t 1.3e-155) t_1 (if (<= t 2.2e+35) (/ (* z y) t) x))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (x * -y) / t;
	double t_2 = z * (y / t);
	double tmp;
	if (t <= -1.58e+31) {
		tmp = x;
	} else if (t <= -1.45e-81) {
		tmp = t_2;
	} else if (t <= -2.25e-276) {
		tmp = t_1;
	} else if (t <= 1.2e-251) {
		tmp = t_2;
	} else if (t <= 1.3e-155) {
		tmp = t_1;
	} else if (t <= 2.2e+35) {
		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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * -y) / t
    t_2 = z * (y / t)
    if (t <= (-1.58d+31)) then
        tmp = x
    else if (t <= (-1.45d-81)) then
        tmp = t_2
    else if (t <= (-2.25d-276)) then
        tmp = t_1
    else if (t <= 1.2d-251) then
        tmp = t_2
    else if (t <= 1.3d-155) then
        tmp = t_1
    else if (t <= 2.2d+35) 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 t_1 = (x * -y) / t;
	double t_2 = z * (y / t);
	double tmp;
	if (t <= -1.58e+31) {
		tmp = x;
	} else if (t <= -1.45e-81) {
		tmp = t_2;
	} else if (t <= -2.25e-276) {
		tmp = t_1;
	} else if (t <= 1.2e-251) {
		tmp = t_2;
	} else if (t <= 1.3e-155) {
		tmp = t_1;
	} else if (t <= 2.2e+35) {
		tmp = (z * y) / t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x * -y) / t
	t_2 = z * (y / t)
	tmp = 0
	if t <= -1.58e+31:
		tmp = x
	elif t <= -1.45e-81:
		tmp = t_2
	elif t <= -2.25e-276:
		tmp = t_1
	elif t <= 1.2e-251:
		tmp = t_2
	elif t <= 1.3e-155:
		tmp = t_1
	elif t <= 2.2e+35:
		tmp = (z * y) / t
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x * Float64(-y)) / t)
	t_2 = Float64(z * Float64(y / t))
	tmp = 0.0
	if (t <= -1.58e+31)
		tmp = x;
	elseif (t <= -1.45e-81)
		tmp = t_2;
	elseif (t <= -2.25e-276)
		tmp = t_1;
	elseif (t <= 1.2e-251)
		tmp = t_2;
	elseif (t <= 1.3e-155)
		tmp = t_1;
	elseif (t <= 2.2e+35)
		tmp = Float64(Float64(z * y) / t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x * -y) / t;
	t_2 = z * (y / t);
	tmp = 0.0;
	if (t <= -1.58e+31)
		tmp = x;
	elseif (t <= -1.45e-81)
		tmp = t_2;
	elseif (t <= -2.25e-276)
		tmp = t_1;
	elseif (t <= 1.2e-251)
		tmp = t_2;
	elseif (t <= 1.3e-155)
		tmp = t_1;
	elseif (t <= 2.2e+35)
		tmp = (z * y) / t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * (-y)), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.58e+31], x, If[LessEqual[t, -1.45e-81], t$95$2, If[LessEqual[t, -2.25e-276], t$95$1, If[LessEqual[t, 1.2e-251], t$95$2, If[LessEqual[t, 1.3e-155], t$95$1, If[LessEqual[t, 2.2e+35], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.45 \cdot 10^{-81}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -2.25 \cdot 10^{-276}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{-251}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.57999999999999992e31 or 2.1999999999999999e35 < t

    1. Initial program 82.1%

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

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

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

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

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

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

    if -1.57999999999999992e31 < t < -1.44999999999999994e-81 or -2.24999999999999981e-276 < t < 1.19999999999999998e-251

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    10. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/59.4%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. *-commutative59.4%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    12. Applied egg-rr59.4%

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

    if -1.44999999999999994e-81 < t < -2.24999999999999981e-276 or 1.19999999999999998e-251 < t < 1.30000000000000004e-155

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{t} \]
      3. distribute-lft-neg-out73.1%

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

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

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

    if 1.30000000000000004e-155 < t < 2.1999999999999999e35

    1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.58 \cdot 10^{+31}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-81}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq -2.25 \cdot 10^{-276}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{t}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-251}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{-155}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{t}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{+35}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 53.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+34}:\\
\;\;\;\;x\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -9.1999999999999993e34 or 4.89999999999999981e36 < t

    1. Initial program 82.1%

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

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

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

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

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

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

    if -9.1999999999999993e34 < t < -5.4000000000000003e-82

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    10. Applied egg-rr56.2%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/56.4%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. *-commutative56.4%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    12. Applied egg-rr56.4%

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

    if -5.4000000000000003e-82 < t < 9.50000000000000019e-157

    1. Initial program 99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    7. Step-by-step derivation
      1. mul-1-neg64.0%

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{t} \]
    8. Simplified61.7%

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

    if 9.50000000000000019e-157 < t < 4.89999999999999981e36

    1. Initial program 99.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.2 \cdot 10^{+34}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -5.4 \cdot 10^{-82}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-157}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;t \leq 4.9 \cdot 10^{+36}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.8% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9499999999999999e-147 or 9.19999999999999967e-61 < x

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in84.4%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in84.4%

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

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

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

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

    if -1.9499999999999999e-147 < x < 9.19999999999999967e-61

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    10. Applied egg-rr61.1%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/66.3%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. *-commutative66.3%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    12. Applied egg-rr66.3%

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

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

Alternative 7: 76.2% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e18 or 9.00000000000000042e102 < y

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

    if -1e18 < y < 9.00000000000000042e102

    1. Initial program 97.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg76.3%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in78.8%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in78.8%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
      7. mul-1-neg78.8%

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

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

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

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

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

Alternative 8: 83.7% accurate, 0.5× speedup?

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

\mathbf{elif}\;x \leq 2.7 \cdot 10^{-58}:\\
\;\;\;\;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 3 regimes
  2. if x < -2.9e110

    1. Initial program 87.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg83.5%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in94.6%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in94.6%

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

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

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

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

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

    if -2.9e110 < x < 2.6999999999999999e-58

    1. Initial program 94.1%

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

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

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

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

    if 2.6999999999999999e-58 < x

    1. Initial program 90.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg80.9%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in88.8%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in88.8%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
      7. mul-1-neg88.8%

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

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

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

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

Alternative 9: 83.8% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.49999999999999972e109

    1. Initial program 87.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg83.5%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in94.6%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in94.6%

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

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

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

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

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

    if -9.49999999999999972e109 < x < 2.6999999999999999e-58

    1. Initial program 94.1%

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

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

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

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

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

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

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

    if 2.6999999999999999e-58 < x

    1. Initial program 90.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg80.9%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in88.8%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in88.8%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
      7. mul-1-neg88.8%

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

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

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

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

Alternative 10: 84.3% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.65000000000000013e-138

    1. Initial program 92.5%

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

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

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

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

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

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

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

    if -2.65000000000000013e-138 < z < 7.2000000000000005e-78

    1. Initial program 94.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg90.2%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in93.3%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in93.3%

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

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

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

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

    if 7.2000000000000005e-78 < z

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 84.2% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.2000000000000001e-136

    1. Initial program 92.5%

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

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

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

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

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

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

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

    if -2.2000000000000001e-136 < z < 3.49999999999999985e-75

    1. Initial program 94.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg90.2%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in93.3%

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

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in93.3%

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

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

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

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

    if 3.49999999999999985e-75 < z

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 84.8% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.45e-20

    1. Initial program 85.4%

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

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

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

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

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

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

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

    if -1.45e-20 < t < 1.99999999999999992e-74

    1. Initial program 99.8%

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

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

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

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

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

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

    if 1.99999999999999992e-74 < t

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 54.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+17} \lor \neg \left(y \leq 7.2 \cdot 10^{+102}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5e17 or 7.2000000000000003e102 < y

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

    if -2.5e17 < y < 7.2000000000000003e102

    1. Initial program 97.5%

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

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

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

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

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

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

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

Alternative 14: 54.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+17} \lor \neg \left(y \leq 7.3 \cdot 10^{+102}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8e17 or 7.29999999999999989e102 < y

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    10. Applied egg-rr47.7%

      \[\leadsto \color{blue}{\frac{z \cdot y}{t}} \]
    11. Step-by-step derivation
      1. associate-*r/60.4%

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. *-commutative60.4%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    12. Applied egg-rr60.4%

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

    if -2.8e17 < y < 7.29999999999999989e102

    1. Initial program 97.5%

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

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

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

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

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

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

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

Alternative 15: 92.4% accurate, 1.0× speedup?

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

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

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

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

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

    \[\leadsto x + \color{blue}{\frac{z - x}{t} \cdot y} \]
  5. Final simplification92.9%

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

Alternative 16: 97.6% 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 91.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 38.1% 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 91.7%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification42.4%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 90.4% 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 2024077 
(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)))