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

Percentage Accurate: 92.4% → 98.5%
Time: 7.6s
Alternatives: 13
Speedup: 0.6×

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 13 alternatives:

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

Initial Program: 92.4% accurate, 1.0× speedup?

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

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

Alternative 1: 98.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+285} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+307}\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 (/ (* y (- z x)) t))))
   (if (or (<= t_1 -5e+285) (not (<= t_1 2e+307)))
     (+ x (* y (/ (- z x) t)))
     t_1)))
double code(double x, double y, double z, double t) {
	double t_1 = x + ((y * (z - x)) / t);
	double tmp;
	if ((t_1 <= -5e+285) || !(t_1 <= 2e+307)) {
		tmp = x + (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 + ((y * (z - x)) / t)
    if ((t_1 <= (-5d+285)) .or. (.not. (t_1 <= 2d+307))) then
        tmp = x + (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 + ((y * (z - x)) / t);
	double tmp;
	if ((t_1 <= -5e+285) || !(t_1 <= 2e+307)) {
		tmp = x + (y * ((z - x) / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + ((y * (z - x)) / t)
	tmp = 0
	if (t_1 <= -5e+285) or not (t_1 <= 2e+307):
		tmp = x + (y * ((z - x) / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(Float64(y * Float64(z - x)) / t))
	tmp = 0.0
	if ((t_1 <= -5e+285) || !(t_1 <= 2e+307))
		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 + ((y * (z - x)) / t);
	tmp = 0.0;
	if ((t_1 <= -5e+285) || ~((t_1 <= 2e+307)))
		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[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+285], N[Not[LessEqual[t$95$1, 2e+307]], $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{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+285} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+307}\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)) < -5.00000000000000016e285 or 1.99999999999999997e307 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 83.2%

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

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

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

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

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

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

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

    if -5.00000000000000016e285 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 1.99999999999999997e307

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

Alternative 2: 75.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z - x}{t}\\ t_2 := x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{if}\;x \leq -2.6 \cdot 10^{-52}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-199}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-198}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;x \leq 0.000235:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ (- z x) t))) (t_2 (* x (- 1.0 (/ y t)))))
   (if (<= x -2.6e-52)
     t_2
     (if (<= x -1.6e-199)
       t_1
       (if (<= x 6.5e-198) (/ (* y z) t) (if (<= x 0.000235) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * ((z - x) / t);
	double t_2 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -2.6e-52) {
		tmp = t_2;
	} else if (x <= -1.6e-199) {
		tmp = t_1;
	} else if (x <= 6.5e-198) {
		tmp = (y * z) / t;
	} else if (x <= 0.000235) {
		tmp = t_1;
	} 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 = y * ((z - x) / t)
    t_2 = x * (1.0d0 - (y / t))
    if (x <= (-2.6d-52)) then
        tmp = t_2
    else if (x <= (-1.6d-199)) then
        tmp = t_1
    else if (x <= 6.5d-198) then
        tmp = (y * z) / t
    else if (x <= 0.000235d0) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * ((z - x) / t);
	double t_2 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -2.6e-52) {
		tmp = t_2;
	} else if (x <= -1.6e-199) {
		tmp = t_1;
	} else if (x <= 6.5e-198) {
		tmp = (y * z) / t;
	} else if (x <= 0.000235) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * ((z - x) / t)
	t_2 = x * (1.0 - (y / t))
	tmp = 0
	if x <= -2.6e-52:
		tmp = t_2
	elif x <= -1.6e-199:
		tmp = t_1
	elif x <= 6.5e-198:
		tmp = (y * z) / t
	elif x <= 0.000235:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(Float64(z - x) / t))
	t_2 = Float64(x * Float64(1.0 - Float64(y / t)))
	tmp = 0.0
	if (x <= -2.6e-52)
		tmp = t_2;
	elseif (x <= -1.6e-199)
		tmp = t_1;
	elseif (x <= 6.5e-198)
		tmp = Float64(Float64(y * z) / t);
	elseif (x <= 0.000235)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * ((z - x) / t);
	t_2 = x * (1.0 - (y / t));
	tmp = 0.0;
	if (x <= -2.6e-52)
		tmp = t_2;
	elseif (x <= -1.6e-199)
		tmp = t_1;
	elseif (x <= 6.5e-198)
		tmp = (y * z) / t;
	elseif (x <= 0.000235)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e-52], t$95$2, If[LessEqual[x, -1.6e-199], t$95$1, If[LessEqual[x, 6.5e-198], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[x, 0.000235], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.6 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{-198}:\\
\;\;\;\;\frac{y \cdot z}{t}\\

\mathbf{elif}\;x \leq 0.000235:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.5999999999999999e-52 or 2.34999999999999993e-4 < x

    1. Initial program 90.1%

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

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

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

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

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

    if -2.5999999999999999e-52 < x < -1.6e-199 or 6.5000000000000004e-198 < x < 2.34999999999999993e-4

    1. Initial program 98.2%

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

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

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

        \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} \]
    5. Applied egg-rr75.5%

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

    if -1.6e-199 < x < 6.5000000000000004e-198

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-52}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-199}:\\ \;\;\;\;y \cdot \frac{z - x}{t}\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-198}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;x \leq 0.000235:\\ \;\;\;\;y \cdot \frac{z - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 54.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -6.8 \cdot 10^{+30} \lor \neg \left(t \leq -125\right) \land t \leq 3.7 \cdot 10^{+22}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.9499999999999999e102 or -6.8000000000000005e30 < t < -125 or 3.6999999999999998e22 < t

    1. Initial program 86.3%

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

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

    if -1.9499999999999999e102 < t < -6.8000000000000005e30 or -125 < t < 3.6999999999999998e22

    1. Initial program 99.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.95 \cdot 10^{+102}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -6.8 \cdot 10^{+30} \lor \neg \left(t \leq -125\right) \land t \leq 3.7 \cdot 10^{+22}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 51.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -3.4 \cdot 10^{+29} \lor \neg \left(t \leq -2.25 \cdot 10^{-65}\right) \land t \leq 3.5 \cdot 10^{+17}:\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.89999999999999989e102 or -3.39999999999999981e29 < t < -2.2499999999999999e-65 or 3.5e17 < t

    1. Initial program 87.9%

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

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

    if -1.89999999999999989e102 < t < -3.39999999999999981e29 or -2.2499999999999999e-65 < t < 3.5e17

    1. Initial program 99.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{+102}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -3.4 \cdot 10^{+29} \lor \neg \left(t \leq -2.25 \cdot 10^{-65}\right) \land t \leq 3.5 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 54.8% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;t \leq -110:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.89999999999999989e102 or -2.59999999999999988e30 < t < -110 or 3.5e18 < t

    1. Initial program 86.3%

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

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

    if -1.89999999999999989e102 < t < -2.59999999999999988e30

    1. Initial program 99.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Applied egg-rr65.2%

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

    if -110 < t < 3.5e18

    1. Initial program 99.1%

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

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

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

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

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

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

Alternative 6: 53.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4700:\\
\;\;\;\;z \cdot \frac{y}{t}\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-122}:\\
\;\;\;\;x\\

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

    if -4700 < y < 8.2000000000000001e-122

    1. Initial program 99.0%

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

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

    if 8.2000000000000001e-122 < y < 9e19

    1. Initial program 99.9%

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

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

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

    if 9e19 < y

    1. Initial program 85.0%

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

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

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

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

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

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

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

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

Alternative 7: 82.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -105:\\
\;\;\;\;\frac{y \cdot \left(z - x\right)}{t}\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-37}:\\
\;\;\;\;x + \frac{1}{\frac{t}{y \cdot z}}\\

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


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

    1. Initial program 90.2%

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

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

    if -105 < y < 4.2000000000000002e-37

    1. Initial program 99.1%

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

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

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

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

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

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

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

    if 4.2000000000000002e-37 < y

    1. Initial program 86.5%

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

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

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

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

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

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

Alternative 8: 84.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+15} \lor \neg \left(y \leq 6.9 \cdot 10^{-37}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.2e15 or 6.8999999999999999e-37 < y

    1. Initial program 88.1%

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

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

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

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

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

    if -7.2e15 < y < 6.8999999999999999e-37

    1. Initial program 99.1%

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

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

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

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

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

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

Alternative 9: 82.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.3e18 or 2.7e-40 < y

    1. Initial program 88.2%

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

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

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

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

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

    if -8.3e18 < y < 2.7e-40

    1. Initial program 99.1%

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

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

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

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

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

Alternative 10: 73.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-146} \lor \neg \left(x \leq 1.4 \cdot 10^{-71}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5499999999999999e-146 or 1.4e-71 < x

    1. Initial program 91.8%

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

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

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

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

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

    if -1.5499999999999999e-146 < x < 1.4e-71

    1. Initial program 98.4%

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

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

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

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

Alternative 11: 82.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -180000:\\
\;\;\;\;\frac{y \cdot \left(z - x\right)}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.8e5

    1. Initial program 90.2%

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

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

    if -1.8e5 < y < 6.8999999999999999e-37

    1. Initial program 99.1%

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

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

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

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

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

    if 6.8999999999999999e-37 < y

    1. Initial program 86.5%

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

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

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

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

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

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

Alternative 12: 93.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+151}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.00000000000000007e151

    1. Initial program 79.2%

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

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

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

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

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

    if -4.00000000000000007e151 < x

    1. Initial program 96.0%

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

Alternative 13: 38.4% 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 93.6%

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

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

Developer target: 90.8% 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 2024086 
(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)))