Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 93.2% → 97.8%
Time: 8.1s
Alternatives: 8
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 8 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 97.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y - x\right) \cdot \frac{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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - x\right) \cdot \frac{z}{t}
\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.8%

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

    \[\leadsto \color{blue}{x + \left(y - x\right) \cdot \frac{z}{t}} \]
  4. Add Preprocessing
  5. Final simplification98.8%

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

Alternative 2: 70.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{t}\\ t_2 := x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{if}\;y \leq -4 \cdot 10^{+204}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{+43}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{-27}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+112}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ z t))) (t_2 (* x (- 1.0 (/ z t)))))
   (if (<= y -4e+204)
     t_1
     (if (<= y -5.2e+43)
       t_2
       (if (<= y -6.4e-27) (* z (/ y t)) (if (<= y 1.6e+112) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double t_2 = x * (1.0 - (z / t));
	double tmp;
	if (y <= -4e+204) {
		tmp = t_1;
	} else if (y <= -5.2e+43) {
		tmp = t_2;
	} else if (y <= -6.4e-27) {
		tmp = z * (y / t);
	} else if (y <= 1.6e+112) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (z / t)
    t_2 = x * (1.0d0 - (z / t))
    if (y <= (-4d+204)) then
        tmp = t_1
    else if (y <= (-5.2d+43)) then
        tmp = t_2
    else if (y <= (-6.4d-27)) then
        tmp = z * (y / t)
    else if (y <= 1.6d+112) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double t_2 = x * (1.0 - (z / t));
	double tmp;
	if (y <= -4e+204) {
		tmp = t_1;
	} else if (y <= -5.2e+43) {
		tmp = t_2;
	} else if (y <= -6.4e-27) {
		tmp = z * (y / t);
	} else if (y <= 1.6e+112) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (z / t)
	t_2 = x * (1.0 - (z / t))
	tmp = 0
	if y <= -4e+204:
		tmp = t_1
	elif y <= -5.2e+43:
		tmp = t_2
	elif y <= -6.4e-27:
		tmp = z * (y / t)
	elif y <= 1.6e+112:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(z / t))
	t_2 = Float64(x * Float64(1.0 - Float64(z / t)))
	tmp = 0.0
	if (y <= -4e+204)
		tmp = t_1;
	elseif (y <= -5.2e+43)
		tmp = t_2;
	elseif (y <= -6.4e-27)
		tmp = Float64(z * Float64(y / t));
	elseif (y <= 1.6e+112)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (z / t);
	t_2 = x * (1.0 - (z / t));
	tmp = 0.0;
	if (y <= -4e+204)
		tmp = t_1;
	elseif (y <= -5.2e+43)
		tmp = t_2;
	elseif (y <= -6.4e-27)
		tmp = z * (y / t);
	elseif (y <= 1.6e+112)
		tmp = t_2;
	else
		tmp = t_1;
	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[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+204], t$95$1, If[LessEqual[y, -5.2e+43], t$95$2, If[LessEqual[y, -6.4e-27], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+112], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -5.2 \cdot 10^{+43}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -6.4 \cdot 10^{-27}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+112}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.99999999999999996e204 or 1.59999999999999993e112 < y

    1. Initial program 90.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    9. Step-by-step derivation
      1. associate-/r/77.8%

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

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

    if -3.99999999999999996e204 < y < -5.20000000000000042e43 or -6.39999999999999982e-27 < y < 1.59999999999999993e112

    1. Initial program 95.2%

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

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

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

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

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

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

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

    if -5.20000000000000042e43 < y < -6.39999999999999982e-27

    1. Initial program 91.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+204}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{+43}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{-27}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+112}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 51.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{t}\\ \mathbf{if}\;y \leq -1.6 \cdot 10^{-31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-168}:\\ \;\;\;\;x \cdot \frac{z}{-t}\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+109}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ z t))))
   (if (<= y -1.6e-31)
     t_1
     (if (<= y -4.4e-168) (* x (/ z (- t))) (if (<= y 5.4e+109) x t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double tmp;
	if (y <= -1.6e-31) {
		tmp = t_1;
	} else if (y <= -4.4e-168) {
		tmp = x * (z / -t);
	} else if (y <= 5.4e+109) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (z / t)
    if (y <= (-1.6d-31)) then
        tmp = t_1
    else if (y <= (-4.4d-168)) then
        tmp = x * (z / -t)
    else if (y <= 5.4d+109) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double tmp;
	if (y <= -1.6e-31) {
		tmp = t_1;
	} else if (y <= -4.4e-168) {
		tmp = x * (z / -t);
	} else if (y <= 5.4e+109) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (z / t)
	tmp = 0
	if y <= -1.6e-31:
		tmp = t_1
	elif y <= -4.4e-168:
		tmp = x * (z / -t)
	elif y <= 5.4e+109:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(z / t))
	tmp = 0.0
	if (y <= -1.6e-31)
		tmp = t_1;
	elseif (y <= -4.4e-168)
		tmp = Float64(x * Float64(z / Float64(-t)));
	elseif (y <= 5.4e+109)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (z / t);
	tmp = 0.0;
	if (y <= -1.6e-31)
		tmp = t_1;
	elseif (y <= -4.4e-168)
		tmp = x * (z / -t);
	elseif (y <= 5.4e+109)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e-31], t$95$1, If[LessEqual[y, -4.4e-168], N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e+109], x, t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+109}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.60000000000000009e-31 or 5.40000000000000003e109 < y

    1. Initial program 92.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    9. Step-by-step derivation
      1. associate-/r/68.0%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
    10. Applied egg-rr68.0%

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

    if -1.60000000000000009e-31 < y < -4.3999999999999996e-168

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

    if -4.3999999999999996e-168 < y < 5.40000000000000003e109

    1. Initial program 96.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{-31}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-168}:\\ \;\;\;\;x \cdot \frac{z}{-t}\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+109}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-90} \lor \neg \left(x \leq 2.15 \cdot 10^{+62}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.05e-90 or 2.1499999999999998e62 < x

    1. Initial program 92.4%

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

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

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

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

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

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

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

    if -1.05e-90 < x < 2.1499999999999998e62

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+76} \lor \neg \left(x \leq 4.2 \cdot 10^{+137}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.2000000000000006e76 or 4.1999999999999998e137 < x

    1. Initial program 90.6%

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

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

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

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

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

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

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

    if -7.2000000000000006e76 < x < 4.1999999999999998e137

    1. Initial program 95.6%

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

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

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

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

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

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

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

Alternative 6: 54.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-22} \lor \neg \left(z \leq 1.28 \cdot 10^{+61}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.02000000000000002e-22 or 1.27999999999999996e61 < z

    1. Initial program 87.5%

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

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

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

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

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

    if -1.02000000000000002e-22 < z < 1.27999999999999996e61

    1. Initial program 98.6%

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

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

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

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

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

Alternative 7: 53.1% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.25e-27 or 4.4999999999999996e109 < y

    1. Initial program 92.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    9. Step-by-step derivation
      1. associate-/r/68.0%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
    10. Applied egg-rr68.0%

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

    if -1.25e-27 < y < 4.4999999999999996e109

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification43.2%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 97.6% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024039 
(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)))