
(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:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 94.3%
associate-/l*97.5%
Simplified97.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.9e-82) (not (<= y 2.05e-16))) (+ x (* y (/ z t))) (- x (/ x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.9e-82) || !(y <= 2.05e-16)) {
tmp = x + (y * (z / t));
} else {
tmp = x - (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 ((y <= (-4.9d-82)) .or. (.not. (y <= 2.05d-16))) then
tmp = x + (y * (z / t))
else
tmp = x - (x / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.9e-82) || !(y <= 2.05e-16)) {
tmp = x + (y * (z / t));
} else {
tmp = x - (x / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.9e-82) or not (y <= 2.05e-16): tmp = x + (y * (z / t)) else: tmp = x - (x / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.9e-82) || !(y <= 2.05e-16)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x - Float64(x / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.9e-82) || ~((y <= 2.05e-16))) tmp = x + (y * (z / t)); else tmp = x - (x / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.9e-82], N[Not[LessEqual[y, 2.05e-16]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{-82} \lor \neg \left(y \leq 2.05 \cdot 10^{-16}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{\frac{t}{z}}\\
\end{array}
\end{array}
if y < -4.9000000000000003e-82 or 2.05000000000000003e-16 < y Initial program 93.4%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around inf 85.0%
associate-*r/88.6%
Simplified88.6%
if -4.9000000000000003e-82 < y < 2.05000000000000003e-16Initial program 95.5%
associate-/l*96.3%
Simplified96.3%
clear-num96.3%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in y around 0 91.1%
neg-mul-191.1%
Simplified91.1%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.4e-88) (not (<= y 1.45e-15))) (+ x (* y (/ z t))) (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.4e-88) || !(y <= 1.45e-15)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (z / t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-5.4d-88)) .or. (.not. (y <= 1.45d-15))) then
tmp = x + (y * (z / t))
else
tmp = x * (1.0d0 - (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.4e-88) || !(y <= 1.45e-15)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.4e-88) or not (y <= 1.45e-15): tmp = x + (y * (z / t)) else: tmp = x * (1.0 - (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.4e-88) || !(y <= 1.45e-15)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x * Float64(1.0 - Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.4e-88) || ~((y <= 1.45e-15))) tmp = x + (y * (z / t)); else tmp = x * (1.0 - (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.4e-88], N[Not[LessEqual[y, 1.45e-15]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-88} \lor \neg \left(y \leq 1.45 \cdot 10^{-15}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if y < -5.39999999999999989e-88 or 1.45000000000000009e-15 < y Initial program 93.4%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in y around inf 85.0%
associate-*r/88.6%
Simplified88.6%
if -5.39999999999999989e-88 < y < 1.45000000000000009e-15Initial program 95.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in x around inf 91.0%
mul-1-neg91.0%
unsub-neg91.0%
Simplified91.0%
Final simplification89.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.6e+59) (not (<= y 6.4e+63))) (* z (/ (- y x) t)) (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.6e+59) || !(y <= 6.4e+63)) {
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 ((y <= (-9.6d+59)) .or. (.not. (y <= 6.4d+63))) 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 ((y <= -9.6e+59) || !(y <= 6.4e+63)) {
tmp = z * ((y - x) / t);
} else {
tmp = x * (1.0 - (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.6e+59) or not (y <= 6.4e+63): tmp = z * ((y - x) / t) else: tmp = x * (1.0 - (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.6e+59) || !(y <= 6.4e+63)) 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 ((y <= -9.6e+59) || ~((y <= 6.4e+63))) 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[y, -9.6e+59], N[Not[LessEqual[y, 6.4e+63]], $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}\;y \leq -9.6 \cdot 10^{+59} \lor \neg \left(y \leq 6.4 \cdot 10^{+63}\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if y < -9.6000000000000008e59 or 6.40000000000000022e63 < y Initial program 91.5%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 85.8%
associate--l+85.8%
div-sub86.8%
Simplified86.8%
Taylor expanded in z around inf 73.1%
div-sub74.1%
Simplified74.1%
if -9.6000000000000008e59 < y < 6.40000000000000022e63Initial program 96.1%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in x around inf 87.1%
mul-1-neg87.1%
unsub-neg87.1%
Simplified87.1%
Final simplification81.8%
(FPCore (x y z t) :precision binary64 (if (<= y -6.5e+55) (* z (/ y t)) (if (<= y 1.2e+64) (* x (- 1.0 (/ z t))) (/ (* y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e+55) {
tmp = z * (y / t);
} else if (y <= 1.2e+64) {
tmp = x * (1.0 - (z / t));
} else {
tmp = (y * z) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.5d+55)) then
tmp = z * (y / t)
else if (y <= 1.2d+64) then
tmp = x * (1.0d0 - (z / t))
else
tmp = (y * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e+55) {
tmp = z * (y / t);
} else if (y <= 1.2e+64) {
tmp = x * (1.0 - (z / t));
} else {
tmp = (y * z) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.5e+55: tmp = z * (y / t) elif y <= 1.2e+64: tmp = x * (1.0 - (z / t)) else: tmp = (y * z) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.5e+55) tmp = Float64(z * Float64(y / t)); elseif (y <= 1.2e+64) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = Float64(Float64(y * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.5e+55) tmp = z * (y / t); elseif (y <= 1.2e+64) tmp = x * (1.0 - (z / t)); else tmp = (y * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.5e+55], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+64], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+55}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+64}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\end{array}
\end{array}
if y < -6.50000000000000027e55Initial program 87.3%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around inf 89.0%
associate--l+89.0%
div-sub89.0%
Simplified89.0%
Taylor expanded in x around 0 66.7%
*-commutative66.7%
associate-*r/75.3%
Simplified75.3%
if -6.50000000000000027e55 < y < 1.2e64Initial program 96.1%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in x around inf 87.1%
mul-1-neg87.1%
unsub-neg87.1%
Simplified87.1%
if 1.2e64 < y Initial program 96.1%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 82.4%
associate--l+82.4%
div-sub84.4%
Simplified84.4%
Taylor expanded in x around 0 63.0%
*-commutative63.0%
Simplified63.0%
Final simplification79.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.2e+56) (not (<= y 1.05e+64))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.2e+56) || !(y <= 1.05e+64)) {
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 ((y <= (-2.2d+56)) .or. (.not. (y <= 1.05d+64))) 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 ((y <= -2.2e+56) || !(y <= 1.05e+64)) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.2e+56) or not (y <= 1.05e+64): tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.2e+56) || !(y <= 1.05e+64)) 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 ((y <= -2.2e+56) || ~((y <= 1.05e+64))) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.2e+56], N[Not[LessEqual[y, 1.05e+64]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+56} \lor \neg \left(y \leq 1.05 \cdot 10^{+64}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.20000000000000016e56 or 1.05e64 < y Initial program 91.5%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 85.8%
associate--l+85.8%
div-sub86.8%
Simplified86.8%
Taylor expanded in x around 0 64.9%
*-commutative64.9%
associate-*r/69.3%
Simplified69.3%
if -2.20000000000000016e56 < y < 1.05e64Initial program 96.1%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around 0 45.0%
Final simplification54.8%
(FPCore (x y z t) :precision binary64 (if (<= y -6e+53) (* z (/ y t)) (if (<= y 2.9e+63) x (/ (* y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+53) {
tmp = z * (y / t);
} else if (y <= 2.9e+63) {
tmp = x;
} else {
tmp = (y * z) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6d+53)) then
tmp = z * (y / t)
else if (y <= 2.9d+63) then
tmp = x
else
tmp = (y * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e+53) {
tmp = z * (y / t);
} else if (y <= 2.9e+63) {
tmp = x;
} else {
tmp = (y * z) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e+53: tmp = z * (y / t) elif y <= 2.9e+63: tmp = x else: tmp = (y * z) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e+53) tmp = Float64(z * Float64(y / t)); elseif (y <= 2.9e+63) tmp = x; else tmp = Float64(Float64(y * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e+53) tmp = z * (y / t); elseif (y <= 2.9e+63) tmp = x; else tmp = (y * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e+53], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+63], x, N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+53}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\end{array}
\end{array}
if y < -5.99999999999999996e53Initial program 87.3%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around inf 89.0%
associate--l+89.0%
div-sub89.0%
Simplified89.0%
Taylor expanded in x around 0 66.7%
*-commutative66.7%
associate-*r/75.3%
Simplified75.3%
if -5.99999999999999996e53 < y < 2.8999999999999999e63Initial program 96.1%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around 0 45.0%
if 2.8999999999999999e63 < y Initial program 96.1%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in z around inf 82.4%
associate--l+82.4%
div-sub84.4%
Simplified84.4%
Taylor expanded in x around 0 63.0%
*-commutative63.0%
Simplified63.0%
Final simplification54.8%
(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}
Initial program 94.3%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around 0 36.6%
(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}
herbie shell --seed 2024111
(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)))