Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.7% → 97.6%
Time: 7.9s
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: 92.7% 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.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y - x, \frac{z}{t}, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (- y x) (/ z t) x))
double code(double x, double y, double z, double t) {
	return fma((y - x), (z / t), x);
}
function code(x, y, z, t)
	return fma(Float64(y - x), Float64(z / t), x)
end
code[x_, y_, z_, t_] := N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)
\end{array}
Derivation
  1. Initial program 92.7%

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, \frac{z}{t}, x\right)} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 2: 53.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{t}\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+196}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{-t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ z t))))
   (if (<= z -1.85e+50)
     t_1
     (if (<= z 1.05e+52) x (if (<= z 2.75e+196) t_1 (* x (/ z (- t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double tmp;
	if (z <= -1.85e+50) {
		tmp = t_1;
	} else if (z <= 1.05e+52) {
		tmp = x;
	} else if (z <= 2.75e+196) {
		tmp = t_1;
	} else {
		tmp = x * (z / -t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (z / t)
    if (z <= (-1.85d+50)) then
        tmp = t_1
    else if (z <= 1.05d+52) then
        tmp = x
    else if (z <= 2.75d+196) then
        tmp = t_1
    else
        tmp = x * (z / -t)
    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 (z <= -1.85e+50) {
		tmp = t_1;
	} else if (z <= 1.05e+52) {
		tmp = x;
	} else if (z <= 2.75e+196) {
		tmp = t_1;
	} else {
		tmp = x * (z / -t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (z / t)
	tmp = 0
	if z <= -1.85e+50:
		tmp = t_1
	elif z <= 1.05e+52:
		tmp = x
	elif z <= 2.75e+196:
		tmp = t_1
	else:
		tmp = x * (z / -t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(z / t))
	tmp = 0.0
	if (z <= -1.85e+50)
		tmp = t_1;
	elseif (z <= 1.05e+52)
		tmp = x;
	elseif (z <= 2.75e+196)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(z / Float64(-t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (z / t);
	tmp = 0.0;
	if (z <= -1.85e+50)
		tmp = t_1;
	elseif (z <= 1.05e+52)
		tmp = x;
	elseif (z <= 2.75e+196)
		tmp = t_1;
	else
		tmp = x * (z / -t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+50], t$95$1, If[LessEqual[z, 1.05e+52], x, If[LessEqual[z, 2.75e+196], t$95$1, N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+52}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{+196}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.85e50 or 1.05e52 < z < 2.74999999999999987e196

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.85e50 < z < 1.05e52

    1. Initial program 97.8%

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

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

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

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

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

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

    if 2.74999999999999987e196 < z

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto z \cdot \color{blue}{\frac{x}{-t}} \]
    9. Step-by-step derivation
      1. *-commutative72.0%

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

        \[\leadsto \color{blue}{\frac{x}{\frac{-t}{z}}} \]
      3. frac-2neg76.3%

        \[\leadsto \color{blue}{\frac{-x}{-\frac{-t}{z}}} \]
      4. div-inv80.6%

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

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

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

        \[\leadsto \left(-x\right) \cdot \frac{1}{\frac{-\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{z}} \]
      8. sqr-neg33.5%

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

        \[\leadsto \left(-x\right) \cdot \frac{1}{\frac{-\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{z}} \]
      10. add-sqr-sqrt0.8%

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{z}{-t}} \]
      12. add-sqr-sqrt0.1%

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

        \[\leadsto \left(-x\right) \cdot \frac{z}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}} \]
      14. sqr-neg43.4%

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

        \[\leadsto \left(-x\right) \cdot \frac{z}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}} \]
      16. add-sqr-sqrt80.6%

        \[\leadsto \left(-x\right) \cdot \frac{z}{\color{blue}{t}} \]
    10. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+50}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+196}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{z}{-t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{t}\\ \mathbf{if}\;z \leq -1.9 \cdot 10^{+46}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+53}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+199}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x}{-t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ z t))))
   (if (<= z -1.9e+46)
     t_1
     (if (<= z 3.2e+53) x (if (<= z 2.25e+199) t_1 (* z (/ x (- t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (z / t);
	double tmp;
	if (z <= -1.9e+46) {
		tmp = t_1;
	} else if (z <= 3.2e+53) {
		tmp = x;
	} else if (z <= 2.25e+199) {
		tmp = t_1;
	} else {
		tmp = z * (x / -t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (z / t)
    if (z <= (-1.9d+46)) then
        tmp = t_1
    else if (z <= 3.2d+53) then
        tmp = x
    else if (z <= 2.25d+199) then
        tmp = t_1
    else
        tmp = z * (x / -t)
    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 (z <= -1.9e+46) {
		tmp = t_1;
	} else if (z <= 3.2e+53) {
		tmp = x;
	} else if (z <= 2.25e+199) {
		tmp = t_1;
	} else {
		tmp = z * (x / -t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (z / t)
	tmp = 0
	if z <= -1.9e+46:
		tmp = t_1
	elif z <= 3.2e+53:
		tmp = x
	elif z <= 2.25e+199:
		tmp = t_1
	else:
		tmp = z * (x / -t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(z / t))
	tmp = 0.0
	if (z <= -1.9e+46)
		tmp = t_1;
	elseif (z <= 3.2e+53)
		tmp = x;
	elseif (z <= 2.25e+199)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(x / Float64(-t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (z / t);
	tmp = 0.0;
	if (z <= -1.9e+46)
		tmp = t_1;
	elseif (z <= 3.2e+53)
		tmp = x;
	elseif (z <= 2.25e+199)
		tmp = t_1;
	else
		tmp = z * (x / -t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+46], t$95$1, If[LessEqual[z, 3.2e+53], x, If[LessEqual[z, 2.25e+199], t$95$1, N[(z * N[(x / (-t)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+53}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.25 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.9e46 or 3.2e53 < z < 2.2499999999999998e199

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9e46 < z < 3.2e53

    1. Initial program 97.8%

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

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

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

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

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

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

    if 2.2499999999999998e199 < z

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{+27} \lor \neg \left(x \leq 4 \cdot 10^{+67}\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 -1.65e+27) (not (<= x 4e+67)))
   (* x (- 1.0 (/ z t)))
   (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.65e+27) || !(x <= 4e+67)) {
		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 <= (-1.65d+27)) .or. (.not. (x <= 4d+67))) 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 <= -1.65e+27) || !(x <= 4e+67)) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -1.65e+27) or not (x <= 4e+67):
		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 <= -1.65e+27) || !(x <= 4e+67))
		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 <= -1.65e+27) || ~((x <= 4e+67)))
		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, -1.65e+27], N[Not[LessEqual[x, 4e+67]], $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 -1.65 \cdot 10^{+27} \lor \neg \left(x \leq 4 \cdot 10^{+67}\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 < -1.6499999999999999e27 or 3.99999999999999993e67 < x

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6499999999999999e27 < x < 3.99999999999999993e67

    1. Initial program 93.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(z \cdot y\right) \cdot \frac{1}{t}} + x \]
      4. *-commutative83.8%

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

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

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

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

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

Alternative 5: 84.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+27} \lor \neg \left(x \leq 9.5 \cdot 10^{+62}\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 -4.8e+27) (not (<= x 9.5e+62)))
   (* x (- 1.0 (/ z t)))
   (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -4.8e+27) || !(x <= 9.5e+62)) {
		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 <= (-4.8d+27)) .or. (.not. (x <= 9.5d+62))) 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 <= -4.8e+27) || !(x <= 9.5e+62)) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = x + (z * (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -4.8e+27) or not (x <= 9.5e+62):
		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 <= -4.8e+27) || !(x <= 9.5e+62))
		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 <= -4.8e+27) || ~((x <= 9.5e+62)))
		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, -4.8e+27], N[Not[LessEqual[x, 9.5e+62]], $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 -4.8 \cdot 10^{+27} \lor \neg \left(x \leq 9.5 \cdot 10^{+62}\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 < -4.79999999999999995e27 or 9.5000000000000003e62 < x

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.79999999999999995e27 < x < 9.5000000000000003e62

    1. Initial program 93.1%

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

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

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

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

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

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

Alternative 6: 76.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+23} \lor \neg \left(z \leq 1.55 \cdot 10^{+71}\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 -8e+23) (not (<= z 1.55e+71)))
   (* z (/ (- y x) t))
   (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -8e+23) || !(z <= 1.55e+71)) {
		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 <= (-8d+23)) .or. (.not. (z <= 1.55d+71))) 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 <= -8e+23) || !(z <= 1.55e+71)) {
		tmp = z * ((y - x) / t);
	} else {
		tmp = x * (1.0 - (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -8e+23) or not (z <= 1.55e+71):
		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 <= -8e+23) || !(z <= 1.55e+71))
		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 <= -8e+23) || ~((z <= 1.55e+71)))
		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, -8e+23], N[Not[LessEqual[z, 1.55e+71]], $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 -8 \cdot 10^{+23} \lor \neg \left(z \leq 1.55 \cdot 10^{+71}\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 < -7.9999999999999993e23 or 1.55000000000000009e71 < z

    1. Initial program 85.4%

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

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

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

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

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

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

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

    if -7.9999999999999993e23 < z < 1.55000000000000009e71

    1. Initial program 97.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot z}{t} \]
      2. mul-1-neg75.1%

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

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

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

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

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

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

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

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

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

Alternative 7: 73.6% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

    if -9.5000000000000004e134 < y < 1.4799999999999999e68

    1. Initial program 95.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot z}{t} \]
      2. mul-1-neg79.0%

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

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

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

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

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

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

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

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

    if 1.4799999999999999e68 < y

    1. Initial program 90.8%

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

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

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

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

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

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

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

Alternative 8: 54.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+48} \lor \neg \left(z \leq 9.6 \cdot 10^{+53}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2000000000000001e48 or 9.5999999999999999e53 < z

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e48 < z < 9.5999999999999999e53

    1. Initial program 97.8%

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

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

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

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

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

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

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

Alternative 9: 93.7% accurate, 0.6× speedup?

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

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.5000000000000004e116 < t

    1. Initial program 96.1%

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

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

Alternative 10: 97.6% 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 92.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(y - x\right) \cdot \frac{z}{t} + x} \]
  6. Applied egg-rr99.2%

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

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

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

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

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

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

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

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

Alternative 12: 38.3% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 92.7%

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

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

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

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

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

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

Developer target: 97.5% 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 2024096 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

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

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