Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.8% → 95.3%
Time: 8.5s
Alternatives: 14
Speedup: 1.0×

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

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

Initial Program: 92.8% 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: 95.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.90000000000000014e91

    1. Initial program 79.4%

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

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

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

    if -2.90000000000000014e91 < t

    1. Initial program 98.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{+91}:\\ \;\;\;\;x + z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \end{array} \]

Alternative 2: 54.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{t}\\ t_2 := x \cdot \frac{-z}{t}\\ \mathbf{if}\;z \leq -6.1 \cdot 10^{+147}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{+88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1400:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+198}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+277}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ z t))) (t_2 (* x (/ (- z) t))))
   (if (<= z -6.1e+147)
     (* z (/ y t))
     (if (<= z -1.2e+88)
       t_2
       (if (<= z -1.26e+30)
         t_1
         (if (<= z 1400.0)
           x
           (if (<= z 3e+198) t_1 (if (<= z 3e+277) t_2 (/ y (/ t z))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double t_2 = x * (-z / t);
	double tmp;
	if (z <= -6.1e+147) {
		tmp = z * (y / t);
	} else if (z <= -1.2e+88) {
		tmp = t_2;
	} else if (z <= -1.26e+30) {
		tmp = t_1;
	} else if (z <= 1400.0) {
		tmp = x;
	} else if (z <= 3e+198) {
		tmp = t_1;
	} else if (z <= 3e+277) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (z / t)
    t_2 = x * (-z / t)
    if (z <= (-6.1d+147)) then
        tmp = z * (y / t)
    else if (z <= (-1.2d+88)) then
        tmp = t_2
    else if (z <= (-1.26d+30)) then
        tmp = t_1
    else if (z <= 1400.0d0) then
        tmp = x
    else if (z <= 3d+198) then
        tmp = t_1
    else if (z <= 3d+277) then
        tmp = t_2
    else
        tmp = y / (t / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double t_2 = x * (-z / t);
	double tmp;
	if (z <= -6.1e+147) {
		tmp = z * (y / t);
	} else if (z <= -1.2e+88) {
		tmp = t_2;
	} else if (z <= -1.26e+30) {
		tmp = t_1;
	} else if (z <= 1400.0) {
		tmp = x;
	} else if (z <= 3e+198) {
		tmp = t_1;
	} else if (z <= 3e+277) {
		tmp = t_2;
	} else {
		tmp = y / (t / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (z / t)
	t_2 = x * (-z / t)
	tmp = 0
	if z <= -6.1e+147:
		tmp = z * (y / t)
	elif z <= -1.2e+88:
		tmp = t_2
	elif z <= -1.26e+30:
		tmp = t_1
	elif z <= 1400.0:
		tmp = x
	elif z <= 3e+198:
		tmp = t_1
	elif z <= 3e+277:
		tmp = t_2
	else:
		tmp = y / (t / z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(z / t))
	t_2 = Float64(x * Float64(Float64(-z) / t))
	tmp = 0.0
	if (z <= -6.1e+147)
		tmp = Float64(z * Float64(y / t));
	elseif (z <= -1.2e+88)
		tmp = t_2;
	elseif (z <= -1.26e+30)
		tmp = t_1;
	elseif (z <= 1400.0)
		tmp = x;
	elseif (z <= 3e+198)
		tmp = t_1;
	elseif (z <= 3e+277)
		tmp = t_2;
	else
		tmp = Float64(y / Float64(t / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (z / t);
	t_2 = x * (-z / t);
	tmp = 0.0;
	if (z <= -6.1e+147)
		tmp = z * (y / t);
	elseif (z <= -1.2e+88)
		tmp = t_2;
	elseif (z <= -1.26e+30)
		tmp = t_1;
	elseif (z <= 1400.0)
		tmp = x;
	elseif (z <= 3e+198)
		tmp = t_1;
	elseif (z <= 3e+277)
		tmp = t_2;
	else
		tmp = y / (t / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.1e+147], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e+88], t$95$2, If[LessEqual[z, -1.26e+30], t$95$1, If[LessEqual[z, 1400.0], x, If[LessEqual[z, 3e+198], t$95$1, If[LessEqual[z, 3e+277], t$95$2, N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{+88}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -1.26 \cdot 10^{+30}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3 \cdot 10^{+198}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+277}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.10000000000000033e147

    1. Initial program 82.4%

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

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

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

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

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

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

    if -6.10000000000000033e147 < z < -1.2e88 or 3.00000000000000019e198 < z < 2.99999999999999981e277

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

    if -1.2e88 < z < -1.26e30 or 1400 < z < 3.00000000000000019e198

    1. Initial program 90.6%

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

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

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

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

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

    if -1.26e30 < z < 1400

    1. Initial program 98.9%

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

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

    if 2.99999999999999981e277 < z

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.1 \cdot 10^{+147}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{+88}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -1.26 \cdot 10^{+30}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 1400:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+198}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+277}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 3: 70.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-67}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{-106} \lor \neg \left(z \leq 15.6\right):\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\

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


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

    1. Initial program 86.9%

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

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

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

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

    if -2e-19 < z < -1.60000000000000011e-67 or -1.8499999999999999e-106 < z < 15.5999999999999996

    1. Initial program 98.8%

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

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

    if -1.60000000000000011e-67 < z < -1.8499999999999999e-106 or 15.5999999999999996 < z

    1. Initial program 91.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-19}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-67}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-106} \lor \neg \left(z \leq 15.6\right):\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 83.0% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.8e29

    1. Initial program 85.7%

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

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

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

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

    if -2.8e29 < z < -6.9999999999999997e-91

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
      2. distribute-lft-in87.2%

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

        \[\leadsto \color{blue}{x} + x \cdot \left(-1 \cdot \frac{z}{t}\right) \]
      4. mul-1-neg87.2%

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \frac{z}{t}\right)} \]
      6. unsub-neg87.2%

        \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    4. Simplified87.2%

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

    if -6.9999999999999997e-91 < z < 1.6e66

    1. Initial program 98.0%

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

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

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

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

    if 1.6e66 < z

    1. Initial program 90.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+29}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-91}:\\ \;\;\;\;x - x \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+66}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \end{array} \]

Alternative 5: 83.1% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.65000000000000013e30

    1. Initial program 85.7%

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

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

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

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

    if -1.65000000000000013e30 < z < -7.50000000000000051e-91

    1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{z}{t}\right)} \]
      2. distribute-lft-in87.2%

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

        \[\leadsto \color{blue}{x} + x \cdot \left(-1 \cdot \frac{z}{t}\right) \]
      4. mul-1-neg87.2%

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \frac{z}{t}\right)} \]
      6. unsub-neg87.2%

        \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    4. Simplified87.2%

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

    if -7.50000000000000051e-91 < z < 2.8e68

    1. Initial program 98.0%

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

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

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

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

    if 2.8e68 < z

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} - z \cdot \frac{x}{t} \]
      8. *-commutative71.6%

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

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

        \[\leadsto \frac{y}{\frac{t}{z}} - \color{blue}{\frac{x}{\frac{t}{z}}} \]
      11. div-sub91.9%

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      12. associate-/l*87.4%

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y - x}}} \]
    7. Simplified90.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+30}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-91}:\\ \;\;\;\;x - x \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+68}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - x}{\frac{t}{z}}\\ \end{array} \]

Alternative 6: 95.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25000000000000006e-102 or 4.54999999999999998e-159 < z

    1. Initial program 91.4%

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

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

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

    if -1.25000000000000006e-102 < z < 4.54999999999999998e-159

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{-102} \lor \neg \left(z \leq 4.55 \cdot 10^{-159}\right):\\ \;\;\;\;x + z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \end{array} \]

Alternative 7: 71.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.24999999999999993e57 or 1.24000000000000001e51 < t

    1. Initial program 87.9%

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

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

    if -1.24999999999999993e57 < t < 1.24000000000000001e51

    1. Initial program 98.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+57}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.24 \cdot 10^{+51}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 84.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 84.5%

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

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

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

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

    if -1.35000000000000005e54 < z < 2.8999999999999998e69

    1. Initial program 98.3%

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

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

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

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

    if 2.8999999999999998e69 < z

    1. Initial program 90.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+54}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+69}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \end{array} \]

Alternative 9: 84.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 84.5%

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

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

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

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

    if -1.4500000000000001e53 < z < 1.8000000000000001e69

    1. Initial program 98.3%

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

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

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

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

    if 1.8000000000000001e69 < z

    1. Initial program 90.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+53}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+69}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\ \end{array} \]

Alternative 10: 55.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2000000000000001e29 or 360 < z

    1. Initial program 88.4%

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

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

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

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

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

    if -2.2000000000000001e29 < z < 360

    1. Initial program 98.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+29} \lor \neg \left(z \leq 360\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 55.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 85.7%

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

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

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

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

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

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

    if -1.59999999999999986e30 < z < 3600

    1. Initial program 98.9%

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

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

    if 3600 < z

    1. Initial program 90.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+30}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 3600:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 12: 55.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 85.7%

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

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

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

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

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

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

    if -1.7000000000000001e30 < z < 550

    1. Initial program 98.9%

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

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

    if 550 < z

    1. Initial program 90.6%

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    6. Step-by-step derivation
      1. clear-num63.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+30}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 550:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 13: 97.6% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 14: 38.8% 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.9%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification42.7%

    \[\leadsto x \]

Developer target: 97.7% accurate, 0.7× 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 2023181 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (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)))