Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.5% → 97.3%
Time: 8.8s
Alternatives: 11
Speedup: 0.6×

Specification

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

\\
x + \frac{\left(y - x\right) \cdot z}{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 11 alternatives:

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

Initial Program: 92.5% accurate, 1.0× speedup?

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

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

Alternative 1: 97.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.50000000000000038e-115

    1. Initial program 91.0%

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

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

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

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

    if -7.50000000000000038e-115 < t

    1. Initial program 92.9%

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

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

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

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

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

Alternative 2: 98.9% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.5%

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

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

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

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

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

    1. Initial program 98.3%

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

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

Alternative 3: 50.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{+19}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+226}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.25e19 or 4.00000000000000009e-91 < x < 4.19999999999999986e226

    1. Initial program 92.1%

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

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

    if -2.25e19 < x < 4.00000000000000009e-91

    1. Initial program 92.9%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num69.1%

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

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

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

    if 4.19999999999999986e226 < x

    1. Initial program 86.3%

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot z}}{t} \]
      2. distribute-rgt-neg-in72.9%

        \[\leadsto \frac{\color{blue}{x \cdot \left(-z\right)}}{t} \]
    6. Simplified72.9%

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

Alternative 4: 51.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+16}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+225}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.8e16 or 4.29999999999999987e-89 < x < 2.1e225

    1. Initial program 92.1%

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

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

    if -4.8e16 < x < 4.29999999999999987e-89

    1. Initial program 92.9%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num69.1%

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

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

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

    if 2.1e225 < x

    1. Initial program 86.3%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. associate-/r/72.7%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{t}} \]
    7. Step-by-step derivation
      1. mul-1-neg72.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{-89}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+225}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 94.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-162} \lor \neg \left(t \leq 1.55 \cdot 10^{-205}\right):\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.3e-162 or 1.54999999999999991e-205 < t

    1. Initial program 90.9%

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

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

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

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

    if -1.3e-162 < t < 1.54999999999999991e-205

    1. Initial program 97.9%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. associate-/r/95.2%

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

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

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

Alternative 6: 84.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+156} \lor \neg \left(x \leq 3.8 \cdot 10^{+50}\right):\\
\;\;\;\;x - x \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.90000000000000012e156 or 3.79999999999999987e50 < x

    1. Initial program 90.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
    4. Step-by-step derivation
      1. distribute-lft-in97.0%

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

        \[\leadsto \color{blue}{x} + x \cdot \left(-1 \cdot \frac{z}{t}\right) \]
      3. mul-1-neg97.0%

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \frac{z}{t}\right)} \]
      5. distribute-lft-neg-in97.0%

        \[\leadsto x + \color{blue}{\left(-x\right) \cdot \frac{z}{t}} \]
      6. cancel-sign-sub-inv97.0%

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

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

    if -1.90000000000000012e156 < x < 3.79999999999999987e50

    1. Initial program 93.2%

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

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

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

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

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

Alternative 7: 51.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+16} \lor \neg \left(x \leq 3 \cdot 10^{-87}\right):\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.35e16 or 3.00000000000000016e-87 < x

    1. Initial program 91.5%

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

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

    if -1.35e16 < x < 3.00000000000000016e-87

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 51.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{+17}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.9e17 or 1.40000000000000008e-85 < x

    1. Initial program 91.5%

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

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

    if -3.9e17 < x < 1.40000000000000008e-85

    1. Initial program 92.9%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num69.1%

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

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

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

Alternative 9: 51.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3700000000000:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.7e12 or 8.9999999999999995e-86 < x

    1. Initial program 91.5%

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

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

    if -3.7e12 < x < 8.9999999999999995e-86

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

Alternative 10: 76.2% accurate, 1.3× speedup?

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

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

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

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

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

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

Alternative 11: 37.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 92.2%

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

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

Developer target: 97.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
\;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\

\mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024097 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :alt
  (if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

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