Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 93.1% → 99.0%
Time: 7.8s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 93.1% 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: 99.0% accurate, 0.3× speedup?

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

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

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

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

    1. Initial program 98.9%

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

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

Alternative 2: 54.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -4.1 \cdot 10^{+201}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.55 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-44} \lor \neg \left(z \leq 7.5 \cdot 10^{+15}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ y t))))
   (if (<= z -4.1e+201)
     t_1
     (if (<= z -3.55e+28)
       (* x (/ (- z) t))
       (if (or (<= z -6.2e-44) (not (<= z 7.5e+15))) t_1 x)))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (y / t);
	double tmp;
	if (z <= -4.1e+201) {
		tmp = t_1;
	} else if (z <= -3.55e+28) {
		tmp = x * (-z / t);
	} else if ((z <= -6.2e-44) || !(z <= 7.5e+15)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (y / t)
    if (z <= (-4.1d+201)) then
        tmp = t_1
    else if (z <= (-3.55d+28)) then
        tmp = x * (-z / t)
    else if ((z <= (-6.2d-44)) .or. (.not. (z <= 7.5d+15))) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (y / t);
	double tmp;
	if (z <= -4.1e+201) {
		tmp = t_1;
	} else if (z <= -3.55e+28) {
		tmp = x * (-z / t);
	} else if ((z <= -6.2e-44) || !(z <= 7.5e+15)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (y / t)
	tmp = 0
	if z <= -4.1e+201:
		tmp = t_1
	elif z <= -3.55e+28:
		tmp = x * (-z / t)
	elif (z <= -6.2e-44) or not (z <= 7.5e+15):
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(y / t))
	tmp = 0.0
	if (z <= -4.1e+201)
		tmp = t_1;
	elseif (z <= -3.55e+28)
		tmp = Float64(x * Float64(Float64(-z) / t));
	elseif ((z <= -6.2e-44) || !(z <= 7.5e+15))
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (y / t);
	tmp = 0.0;
	if (z <= -4.1e+201)
		tmp = t_1;
	elseif (z <= -3.55e+28)
		tmp = x * (-z / t);
	elseif ((z <= -6.2e-44) || ~((z <= 7.5e+15)))
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+201], t$95$1, If[LessEqual[z, -3.55e+28], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -6.2e-44], N[Not[LessEqual[z, 7.5e+15]], $MachinePrecision]], t$95$1, x]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -6.2 \cdot 10^{-44} \lor \neg \left(z \leq 7.5 \cdot 10^{+15}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.1000000000000002e201 or -3.55e28 < z < -6.19999999999999968e-44 or 7.5e15 < z

    1. Initial program 87.6%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in z around inf 77.7%

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

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

    if -4.1000000000000002e201 < z < -3.55e28

    1. Initial program 93.9%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 69.8%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(-\frac{z}{t}\right)} \]
      2. distribute-frac-neg56.0%

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

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

    if -6.19999999999999968e-44 < z < 7.5e15

    1. Initial program 98.6%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in t around inf 61.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+201}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -3.55 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \frac{-z}{t}\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-44} \lor \neg \left(z \leq 7.5 \cdot 10^{+15}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 73.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-208} \lor \neg \left(x \leq 5.8 \cdot 10^{-103}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.60000000000000017e-208 or 5.7999999999999997e-103 < x

    1. Initial program 93.4%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 80.7%

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

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

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

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

    if -2.60000000000000017e-208 < x < 5.7999999999999997e-103

    1. Initial program 94.6%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in z around inf 72.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-208} \lor \neg \left(x \leq 5.8 \cdot 10^{-103}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]

Alternative 4: 77.0% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.20000000000000021e-40 or 2.44999999999999988e-68 < z

    1. Initial program 90.0%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in z around inf 77.9%

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{y}{t} - \frac{x}{t}\right)} \]
      4. div-sub80.0%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
    7. Simplified80.0%

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

    if -6.20000000000000021e-40 < z < 2.44999999999999988e-68

    1. Initial program 98.5%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 78.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{-40} \lor \neg \left(z \leq 2.45 \cdot 10^{-68}\right):\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \end{array} \]

Alternative 5: 84.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -26500 \lor \neg \left(x \leq 1.12 \cdot 10^{+30}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -26500 or 1.12e30 < x

    1. Initial program 92.0%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 88.7%

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

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

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

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

    if -26500 < x < 1.12e30

    1. Initial program 95.3%

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

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

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

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

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

Alternative 6: 85.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+23} \lor \neg \left(y \leq 1.5 \cdot 10^{-107}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.0000000000000001e23 or 1.4999999999999999e-107 < y

    1. Initial program 92.4%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in y around inf 84.0%

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

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

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

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

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

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

    if -3.0000000000000001e23 < y < 1.4999999999999999e-107

    1. Initial program 95.3%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 87.5%

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

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

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

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

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

Alternative 7: 85.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 90.4%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in y around inf 83.0%

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

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

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

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

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

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

    if -5.1999999999999997e24 < y < 4.0000000000000002e-110

    1. Initial program 95.3%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 87.5%

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

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

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

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

    if 4.0000000000000002e-110 < y

    1. Initial program 93.5%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in y around inf 84.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+24}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-110}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \end{array} \]

Alternative 8: 93.0% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 90.8%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 97.6%

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

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

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

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

    if -6.0000000000000001e114 < x

    1. Initial program 94.3%

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

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

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

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

Alternative 9: 93.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 93.7%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in x around inf 96.6%

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

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

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

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

    if -4.59999999999999987e162 < x

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

Alternative 10: 56.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{-46} \lor \neg \left(z \leq 5.7 \cdot 10^{+16}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.5999999999999993e-46 or 5.7e16 < z

    1. Initial program 89.2%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in z around inf 79.0%

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

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

    if -7.5999999999999993e-46 < z < 5.7e16

    1. Initial program 98.6%

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

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

      \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
    4. Taylor expanded in t around inf 61.0%

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

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

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

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

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

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

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

Alternative 12: 38.9% 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.7%

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

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

    \[\leadsto \color{blue}{x + \frac{y - x}{\frac{t}{z}}} \]
  4. Taylor expanded in t around inf 38.0%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification38.0%

    \[\leadsto x \]

Developer target: 97.5% 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 2023318 
(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)))