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

Percentage Accurate: 93.0% → 98.7%
Time: 9.2s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 93.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.7% 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 5 \cdot 10^{+298}\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 5e+298)))
     (+ 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 <= 5e+298)) {
		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 <= 5e+298)) {
		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 <= 5e+298):
		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 <= 5e+298))
		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 <= 5e+298)))
		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, 5e+298]], $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 5 \cdot 10^{+298}\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 5.0000000000000003e298 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 75.0%

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

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

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

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

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

    1. Initial program 99.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(z - x\right) \cdot y}{t} \leq -\infty \lor \neg \left(x + \frac{\left(z - x\right) \cdot y}{t} \leq 5 \cdot 10^{+298}\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: 53.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(-\frac{y}{t}\right)\\ t_2 := z \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -6.2 \cdot 10^{+56}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -3.25 \cdot 10^{-195}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-239}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-264}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 360000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- (/ y t)))) (t_2 (* z (/ y t))))
   (if (<= z -6.2e+56)
     t_2
     (if (<= z -3.25e-195)
       x
       (if (<= z -4e-239)
         t_1
         (if (<= z 2.5e-264)
           x
           (if (<= z 1.12e-64) t_1 (if (<= z 360000.0) x t_2))))))))
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 (z <= -6.2e+56) {
		tmp = t_2;
	} else if (z <= -3.25e-195) {
		tmp = x;
	} else if (z <= -4e-239) {
		tmp = t_1;
	} else if (z <= 2.5e-264) {
		tmp = x;
	} else if (z <= 1.12e-64) {
		tmp = t_1;
	} else if (z <= 360000.0) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	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 (z <= (-6.2d+56)) then
        tmp = t_2
    else if (z <= (-3.25d-195)) then
        tmp = x
    else if (z <= (-4d-239)) then
        tmp = t_1
    else if (z <= 2.5d-264) then
        tmp = x
    else if (z <= 1.12d-64) then
        tmp = t_1
    else if (z <= 360000.0d0) then
        tmp = x
    else
        tmp = t_2
    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 (z <= -6.2e+56) {
		tmp = t_2;
	} else if (z <= -3.25e-195) {
		tmp = x;
	} else if (z <= -4e-239) {
		tmp = t_1;
	} else if (z <= 2.5e-264) {
		tmp = x;
	} else if (z <= 1.12e-64) {
		tmp = t_1;
	} else if (z <= 360000.0) {
		tmp = x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * -(y / t)
	t_2 = z * (y / t)
	tmp = 0
	if z <= -6.2e+56:
		tmp = t_2
	elif z <= -3.25e-195:
		tmp = x
	elif z <= -4e-239:
		tmp = t_1
	elif z <= 2.5e-264:
		tmp = x
	elif z <= 1.12e-64:
		tmp = t_1
	elif z <= 360000.0:
		tmp = x
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(-Float64(y / t)))
	t_2 = Float64(z * Float64(y / t))
	tmp = 0.0
	if (z <= -6.2e+56)
		tmp = t_2;
	elseif (z <= -3.25e-195)
		tmp = x;
	elseif (z <= -4e-239)
		tmp = t_1;
	elseif (z <= 2.5e-264)
		tmp = x;
	elseif (z <= 1.12e-64)
		tmp = t_1;
	elseif (z <= 360000.0)
		tmp = x;
	else
		tmp = t_2;
	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 (z <= -6.2e+56)
		tmp = t_2;
	elseif (z <= -3.25e-195)
		tmp = x;
	elseif (z <= -4e-239)
		tmp = t_1;
	elseif (z <= 2.5e-264)
		tmp = x;
	elseif (z <= 1.12e-64)
		tmp = t_1;
	elseif (z <= 360000.0)
		tmp = x;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-N[(y / t), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+56], t$95$2, If[LessEqual[z, -3.25e-195], x, If[LessEqual[z, -4e-239], t$95$1, If[LessEqual[z, 2.5e-264], x, If[LessEqual[z, 1.12e-64], t$95$1, If[LessEqual[z, 360000.0], x, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.25 \cdot 10^{-195}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -4 \cdot 10^{-239}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.5 \cdot 10^{-264}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.12 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 360000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.20000000000000009e56 or 3.6e5 < z

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.20000000000000009e56 < z < -3.25000000000000002e-195 or -4.0000000000000003e-239 < z < 2.5e-264 or 1.12e-64 < z < 3.6e5

    1. Initial program 90.9%

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

        \[\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. Taylor expanded in y around 0 60.1%

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

    if -3.25000000000000002e-195 < z < -4.0000000000000003e-239 or 2.5e-264 < z < 1.12e-64

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+56}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -3.25 \cdot 10^{-195}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-239}:\\ \;\;\;\;x \cdot \left(-\frac{y}{t}\right)\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-264}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-64}:\\ \;\;\;\;x \cdot \left(-\frac{y}{t}\right)\\ \mathbf{elif}\;z \leq 360000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{if}\;x \leq -6.5 \cdot 10^{+62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-74}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{+28}:\\ \;\;\;\;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 (- 1.0 (/ y t)))))
   (if (<= x -6.5e+62)
     t_1
     (if (<= x 2.5e-74)
       (+ x (* y (/ z t)))
       (if (<= x 2.9e+28) (* y (/ (- z x) t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -6.5e+62) {
		tmp = t_1;
	} else if (x <= 2.5e-74) {
		tmp = x + (y * (z / t));
	} else if (x <= 2.9e+28) {
		tmp = y * ((z - x) / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / t))
    if (x <= (-6.5d+62)) then
        tmp = t_1
    else if (x <= 2.5d-74) then
        tmp = x + (y * (z / t))
    else if (x <= 2.9d+28) then
        tmp = y * ((z - x) / t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -6.5e+62) {
		tmp = t_1;
	} else if (x <= 2.5e-74) {
		tmp = x + (y * (z / t));
	} else if (x <= 2.9e+28) {
		tmp = y * ((z - x) / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / t))
	tmp = 0
	if x <= -6.5e+62:
		tmp = t_1
	elif x <= 2.5e-74:
		tmp = x + (y * (z / t))
	elif x <= 2.9e+28:
		tmp = y * ((z - x) / t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / t)))
	tmp = 0.0
	if (x <= -6.5e+62)
		tmp = t_1;
	elseif (x <= 2.5e-74)
		tmp = Float64(x + Float64(y * Float64(z / t)));
	elseif (x <= 2.9e+28)
		tmp = 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 * (1.0 - (y / t));
	tmp = 0.0;
	if (x <= -6.5e+62)
		tmp = t_1;
	elseif (x <= 2.5e-74)
		tmp = x + (y * (z / t));
	elseif (x <= 2.9e+28)
		tmp = 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[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+62], t$95$1, If[LessEqual[x, 2.5e-74], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+28], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.5000000000000003e62 or 2.9000000000000001e28 < x

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5000000000000003e62 < x < 2.49999999999999999e-74

    1. Initial program 89.9%

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

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

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

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

    if 2.49999999999999999e-74 < x < 2.9000000000000001e28

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{if}\;x \leq -8 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-73}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;x \leq 6.1 \cdot 10^{+28}:\\ \;\;\;\;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 (- 1.0 (/ y t)))))
   (if (<= x -8e+64)
     t_1
     (if (<= x 1.35e-73)
       (+ x (/ y (/ t z)))
       (if (<= x 6.1e+28) (* y (/ (- z x) t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -8e+64) {
		tmp = t_1;
	} else if (x <= 1.35e-73) {
		tmp = x + (y / (t / z));
	} else if (x <= 6.1e+28) {
		tmp = y * ((z - x) / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / t))
    if (x <= (-8d+64)) then
        tmp = t_1
    else if (x <= 1.35d-73) then
        tmp = x + (y / (t / z))
    else if (x <= 6.1d+28) then
        tmp = y * ((z - x) / t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -8e+64) {
		tmp = t_1;
	} else if (x <= 1.35e-73) {
		tmp = x + (y / (t / z));
	} else if (x <= 6.1e+28) {
		tmp = y * ((z - x) / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / t))
	tmp = 0
	if x <= -8e+64:
		tmp = t_1
	elif x <= 1.35e-73:
		tmp = x + (y / (t / z))
	elif x <= 6.1e+28:
		tmp = y * ((z - x) / t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / t)))
	tmp = 0.0
	if (x <= -8e+64)
		tmp = t_1;
	elseif (x <= 1.35e-73)
		tmp = Float64(x + Float64(y / Float64(t / z)));
	elseif (x <= 6.1e+28)
		tmp = 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 * (1.0 - (y / t));
	tmp = 0.0;
	if (x <= -8e+64)
		tmp = t_1;
	elseif (x <= 1.35e-73)
		tmp = x + (y / (t / z));
	elseif (x <= 6.1e+28)
		tmp = 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[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+64], t$95$1, If[LessEqual[x, 1.35e-73], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.1e+28], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.00000000000000017e64 or 6.1000000000000002e28 < x

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000017e64 < x < 1.34999999999999997e-73

    1. Initial program 89.9%

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

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

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

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

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

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

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

    if 1.34999999999999997e-73 < x < 6.1000000000000002e28

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+64}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{-73}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;x \leq 6.1 \cdot 10^{+28}:\\ \;\;\;\;y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 94.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{-99} \lor \neg \left(t \leq 1.7 \cdot 10^{-160}\right):\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.3000000000000003e-99 or 1.70000000000000011e-160 < t

    1. Initial program 85.8%

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

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

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

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

    if -5.3000000000000003e-99 < t < 1.70000000000000011e-160

    1. Initial program 98.7%

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

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

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

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

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

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

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

Alternative 6: 86.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -92000000000000 \lor \neg \left(z \leq 1.95 \cdot 10^{-64}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.2e13 or 1.9499999999999998e-64 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2e13 < z < 1.9499999999999998e-64

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -30000000000000 \lor \neg \left(z \leq 2.45 \cdot 10^{-64}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3e13 or 2.4500000000000001e-64 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e13 < z < 2.4500000000000001e-64

    1. Initial program 92.4%

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    4. Step-by-step derivation
      1. mul-1-neg45.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{-t} \cdot x} \]
      2. add-sqr-sqrt51.4%

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

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

        \[\leadsto x + \frac{y}{\sqrt{\color{blue}{t \cdot t}}} \cdot x \]
      5. sqrt-unprod18.7%

        \[\leadsto x + \frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \cdot x \]
      6. add-sqr-sqrt45.2%

        \[\leadsto x + \frac{y}{\color{blue}{t}} \cdot x \]
      7. cancel-sign-sub45.2%

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{-t}} \]
      10. add-sqr-sqrt26.5%

        \[\leadsto x - x \cdot \frac{y}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      11. sqrt-unprod59.5%

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

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

        \[\leadsto x - x \cdot \frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      14. add-sqr-sqrt92.0%

        \[\leadsto x - x \cdot \frac{y}{\color{blue}{t}} \]
    7. Applied egg-rr92.0%

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

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

Alternative 8: 86.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+14} \lor \neg \left(z \leq 2.3 \cdot 10^{-64}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e14 or 2.3000000000000001e-64 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e14 < z < 2.3000000000000001e-64

    1. Initial program 92.4%

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    4. Step-by-step derivation
      1. mul-1-neg45.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{-t} \cdot x} \]
      2. add-sqr-sqrt51.4%

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

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

        \[\leadsto x + \frac{y}{\sqrt{\color{blue}{t \cdot t}}} \cdot x \]
      5. sqrt-unprod18.7%

        \[\leadsto x + \frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \cdot x \]
      6. add-sqr-sqrt45.2%

        \[\leadsto x + \frac{y}{\color{blue}{t}} \cdot x \]
      7. cancel-sign-sub45.2%

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{-t}} \]
      10. add-sqr-sqrt26.5%

        \[\leadsto x - x \cdot \frac{y}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}} \]
      11. sqrt-unprod59.5%

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

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

        \[\leadsto x - x \cdot \frac{y}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      14. add-sqr-sqrt92.0%

        \[\leadsto x - x \cdot \frac{y}{\color{blue}{t}} \]
    7. Applied egg-rr92.0%

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

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

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

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

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

Alternative 9: 72.8% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 95.1%

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

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

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

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

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

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

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

    if -5.4999999999999996e186 < z < 1.12e7

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.12e7 < z

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

Alternative 10: 73.1% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 95.1%

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

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

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

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

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

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

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

    if -9.5999999999999998e186 < z < 3.7e6

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7e6 < z

    1. Initial program 82.8%

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

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

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

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

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

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

Alternative 11: 52.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+56} \lor \neg \left(z \leq 300000\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.60000000000000017e56 or 3e5 < z

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

    if -5.60000000000000017e56 < z < 3e5

    1. Initial program 92.6%

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

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

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

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

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

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

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

Alternative 12: 54.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5000000000000003e56 or 8600 < z

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000003e56 < z < 8600

    1. Initial program 92.6%

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

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

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

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

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

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

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

Alternative 13: 97.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 97.5% 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 90.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 38.3% 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 90.3%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification37.0%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 90.0% 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 2024095 
(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)))