
(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 14 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
(let* ((t_1 (+ x (/ (* (- y x) z) t))))
(if (<= t_1 (- INFINITY))
(+ x (* z (/ (- y x) t)))
(if (<= t_1 5e+304) t_1 (+ x (/ z (/ t (- y x))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (z * ((y - x) / t));
} else if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = x + (z / (t / (y - x)));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((y - x) * z) / t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (z * ((y - x) / t));
} else if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = x + (z / (t / (y - x)));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((y - x) * z) / t) tmp = 0 if t_1 <= -math.inf: tmp = x + (z * ((y - x) / t)) elif t_1 <= 5e+304: tmp = t_1 else: tmp = x + (z / (t / (y - x))) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(y - x) * z) / t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t))); elseif (t_1 <= 5e+304) tmp = t_1; else tmp = Float64(x + Float64(z / Float64(t / Float64(y - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((y - x) * z) / t); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (z * ((y - x) / t)); elseif (t_1 <= 5e+304) tmp = t_1; else tmp = x + (z / (t / (y - x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+304], t$95$1, N[(x + N[(z / N[(t / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y - x}}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < -inf.0Initial program 85.5%
associate-*l/100.0%
Applied egg-rr100.0%
if -inf.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < 4.9999999999999997e304Initial program 98.6%
if 4.9999999999999997e304 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) Initial program 79.4%
associate-*l/100.0%
Applied egg-rr100.0%
*-commutative100.0%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- z)) t)) (t_2 (* y (/ z t))) (t_3 (* z (/ x (- t)))))
(if (<= t -290000000.0)
x
(if (<= t -1.5e-253)
t_2
(if (<= t 1.05e-302)
t_1
(if (<= t 7e-286)
t_2
(if (<= t 3.1e-265)
t_3
(if (<= t 1.52e-158)
t_1
(if (<= t 4e-98) t_2 (if (<= t 2.35e+19) t_3 x))))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * -z) / t;
double t_2 = y * (z / t);
double t_3 = z * (x / -t);
double tmp;
if (t <= -290000000.0) {
tmp = x;
} else if (t <= -1.5e-253) {
tmp = t_2;
} else if (t <= 1.05e-302) {
tmp = t_1;
} else if (t <= 7e-286) {
tmp = t_2;
} else if (t <= 3.1e-265) {
tmp = t_3;
} else if (t <= 1.52e-158) {
tmp = t_1;
} else if (t <= 4e-98) {
tmp = t_2;
} else if (t <= 2.35e+19) {
tmp = t_3;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (x * -z) / t
t_2 = y * (z / t)
t_3 = z * (x / -t)
if (t <= (-290000000.0d0)) then
tmp = x
else if (t <= (-1.5d-253)) then
tmp = t_2
else if (t <= 1.05d-302) then
tmp = t_1
else if (t <= 7d-286) then
tmp = t_2
else if (t <= 3.1d-265) then
tmp = t_3
else if (t <= 1.52d-158) then
tmp = t_1
else if (t <= 4d-98) then
tmp = t_2
else if (t <= 2.35d+19) then
tmp = t_3
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * -z) / t;
double t_2 = y * (z / t);
double t_3 = z * (x / -t);
double tmp;
if (t <= -290000000.0) {
tmp = x;
} else if (t <= -1.5e-253) {
tmp = t_2;
} else if (t <= 1.05e-302) {
tmp = t_1;
} else if (t <= 7e-286) {
tmp = t_2;
} else if (t <= 3.1e-265) {
tmp = t_3;
} else if (t <= 1.52e-158) {
tmp = t_1;
} else if (t <= 4e-98) {
tmp = t_2;
} else if (t <= 2.35e+19) {
tmp = t_3;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * -z) / t t_2 = y * (z / t) t_3 = z * (x / -t) tmp = 0 if t <= -290000000.0: tmp = x elif t <= -1.5e-253: tmp = t_2 elif t <= 1.05e-302: tmp = t_1 elif t <= 7e-286: tmp = t_2 elif t <= 3.1e-265: tmp = t_3 elif t <= 1.52e-158: tmp = t_1 elif t <= 4e-98: tmp = t_2 elif t <= 2.35e+19: tmp = t_3 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(-z)) / t) t_2 = Float64(y * Float64(z / t)) t_3 = Float64(z * Float64(x / Float64(-t))) tmp = 0.0 if (t <= -290000000.0) tmp = x; elseif (t <= -1.5e-253) tmp = t_2; elseif (t <= 1.05e-302) tmp = t_1; elseif (t <= 7e-286) tmp = t_2; elseif (t <= 3.1e-265) tmp = t_3; elseif (t <= 1.52e-158) tmp = t_1; elseif (t <= 4e-98) tmp = t_2; elseif (t <= 2.35e+19) tmp = t_3; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * -z) / t; t_2 = y * (z / t); t_3 = z * (x / -t); tmp = 0.0; if (t <= -290000000.0) tmp = x; elseif (t <= -1.5e-253) tmp = t_2; elseif (t <= 1.05e-302) tmp = t_1; elseif (t <= 7e-286) tmp = t_2; elseif (t <= 3.1e-265) tmp = t_3; elseif (t <= 1.52e-158) tmp = t_1; elseif (t <= 4e-98) tmp = t_2; elseif (t <= 2.35e+19) tmp = t_3; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * (-z)), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x / (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -290000000.0], x, If[LessEqual[t, -1.5e-253], t$95$2, If[LessEqual[t, 1.05e-302], t$95$1, If[LessEqual[t, 7e-286], t$95$2, If[LessEqual[t, 3.1e-265], t$95$3, If[LessEqual[t, 1.52e-158], t$95$1, If[LessEqual[t, 4e-98], t$95$2, If[LessEqual[t, 2.35e+19], t$95$3, x]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(-z\right)}{t}\\
t_2 := y \cdot \frac{z}{t}\\
t_3 := z \cdot \frac{x}{-t}\\
\mathbf{if}\;t \leq -290000000:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.5 \cdot 10^{-253}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-302}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-286}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-265}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 1.52 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-98}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{+19}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.9e8 or 2.35e19 < t Initial program 89.3%
Taylor expanded in z around 0 63.5%
if -2.9e8 < t < -1.5000000000000001e-253 or 1.05000000000000006e-302 < t < 6.99999999999999977e-286 or 1.52e-158 < t < 3.99999999999999976e-98Initial program 98.4%
Taylor expanded in t around 0 89.2%
Taylor expanded in y around inf 68.5%
associate-*r/72.9%
Simplified72.9%
if -1.5000000000000001e-253 < t < 1.05000000000000006e-302 or 3.09999999999999988e-265 < t < 1.52e-158Initial program 99.2%
Taylor expanded in x around inf 64.8%
*-commutative64.8%
distribute-lft-in64.8%
*-rgt-identity64.8%
mul-1-neg64.8%
distribute-rgt-neg-in64.8%
unsub-neg64.8%
Simplified64.8%
Taylor expanded in x around 0 71.2%
*-commutative71.2%
associate-*l/55.2%
*-commutative55.2%
Simplified55.2%
clear-num55.2%
un-div-inv57.8%
Applied egg-rr57.8%
Taylor expanded in z around inf 60.7%
associate-*r/60.7%
neg-mul-160.7%
distribute-rgt-neg-in60.7%
Simplified60.7%
if 6.99999999999999977e-286 < t < 3.09999999999999988e-265 or 3.99999999999999976e-98 < t < 2.35e19Initial program 96.8%
Taylor expanded in x around inf 69.2%
*-commutative69.2%
distribute-lft-in69.2%
*-rgt-identity69.2%
mul-1-neg69.2%
distribute-rgt-neg-in69.2%
unsub-neg69.2%
Simplified69.2%
Taylor expanded in x around 0 77.1%
*-commutative77.1%
associate-*l/72.1%
*-commutative72.1%
Simplified72.1%
clear-num72.0%
un-div-inv72.1%
Applied egg-rr72.1%
Taylor expanded in z around inf 56.5%
mul-1-neg56.5%
*-lft-identity56.5%
metadata-eval56.5%
times-frac56.5%
neg-mul-156.5%
distribute-lft-neg-in56.5%
neg-mul-156.5%
associate-/l*57.4%
distribute-frac-neg57.4%
remove-double-neg57.4%
*-lft-identity57.4%
*-commutative57.4%
associate-*r/57.4%
associate-/r/57.4%
associate-*l/57.4%
*-lft-identity57.4%
Simplified57.4%
Final simplification64.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (/ x (- t)))) (t_2 (* y (/ z t))))
(if (<= t -5.6e+15)
x
(if (<= t -7.5e-284)
t_2
(if (<= t 6.5e-305)
t_1
(if (<= t 4.8e-94) t_2 (if (<= t 2.15e+21) t_1 x)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x / -t);
double t_2 = y * (z / t);
double tmp;
if (t <= -5.6e+15) {
tmp = x;
} else if (t <= -7.5e-284) {
tmp = t_2;
} else if (t <= 6.5e-305) {
tmp = t_1;
} else if (t <= 4.8e-94) {
tmp = t_2;
} else if (t <= 2.15e+21) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (x / -t)
t_2 = y * (z / t)
if (t <= (-5.6d+15)) then
tmp = x
else if (t <= (-7.5d-284)) then
tmp = t_2
else if (t <= 6.5d-305) then
tmp = t_1
else if (t <= 4.8d-94) then
tmp = t_2
else if (t <= 2.15d+21) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x / -t);
double t_2 = y * (z / t);
double tmp;
if (t <= -5.6e+15) {
tmp = x;
} else if (t <= -7.5e-284) {
tmp = t_2;
} else if (t <= 6.5e-305) {
tmp = t_1;
} else if (t <= 4.8e-94) {
tmp = t_2;
} else if (t <= 2.15e+21) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x / -t) t_2 = y * (z / t) tmp = 0 if t <= -5.6e+15: tmp = x elif t <= -7.5e-284: tmp = t_2 elif t <= 6.5e-305: tmp = t_1 elif t <= 4.8e-94: tmp = t_2 elif t <= 2.15e+21: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x / Float64(-t))) t_2 = Float64(y * Float64(z / t)) tmp = 0.0 if (t <= -5.6e+15) tmp = x; elseif (t <= -7.5e-284) tmp = t_2; elseif (t <= 6.5e-305) tmp = t_1; elseif (t <= 4.8e-94) tmp = t_2; elseif (t <= 2.15e+21) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x / -t); t_2 = y * (z / t); tmp = 0.0; if (t <= -5.6e+15) tmp = x; elseif (t <= -7.5e-284) tmp = t_2; elseif (t <= 6.5e-305) tmp = t_1; elseif (t <= 4.8e-94) tmp = t_2; elseif (t <= 2.15e+21) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x / (-t)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+15], x, If[LessEqual[t, -7.5e-284], t$95$2, If[LessEqual[t, 6.5e-305], t$95$1, If[LessEqual[t, 4.8e-94], t$95$2, If[LessEqual[t, 2.15e+21], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x}{-t}\\
t_2 := y \cdot \frac{z}{t}\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-284}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-305}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-94}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.6e15 or 2.15e21 < t Initial program 89.3%
Taylor expanded in z around 0 63.5%
if -5.6e15 < t < -7.4999999999999999e-284 or 6.49999999999999991e-305 < t < 4.8e-94Initial program 98.0%
Taylor expanded in t around 0 87.2%
Taylor expanded in y around inf 55.8%
associate-*r/59.6%
Simplified59.6%
if -7.4999999999999999e-284 < t < 6.49999999999999991e-305 or 4.8e-94 < t < 2.15e21Initial program 98.9%
Taylor expanded in x around inf 77.7%
*-commutative77.7%
distribute-lft-in77.7%
*-rgt-identity77.7%
mul-1-neg77.7%
distribute-rgt-neg-in77.7%
unsub-neg77.7%
Simplified77.7%
Taylor expanded in x around 0 79.8%
*-commutative79.8%
associate-*l/71.9%
*-commutative71.9%
Simplified71.9%
clear-num71.9%
un-div-inv72.0%
Applied egg-rr72.0%
Taylor expanded in z around inf 63.0%
mul-1-neg63.0%
*-lft-identity63.0%
metadata-eval63.0%
times-frac63.0%
neg-mul-163.0%
distribute-lft-neg-in63.0%
neg-mul-163.0%
associate-/l*60.9%
distribute-frac-neg60.9%
remove-double-neg60.9%
*-lft-identity60.9%
*-commutative60.9%
associate-*r/60.8%
associate-/r/60.7%
associate-*l/60.8%
*-lft-identity60.8%
Simplified60.8%
Final simplification61.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.8e-94) (not (<= z 7.5e-5))) (* z (/ (- y x) t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.8e-94) || !(z <= 7.5e-5)) {
tmp = z * ((y - x) / 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.8d-94)) .or. (.not. (z <= 7.5d-5))) then
tmp = z * ((y - x) / 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.8e-94) || !(z <= 7.5e-5)) {
tmp = z * ((y - x) / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.8e-94) or not (z <= 7.5e-5): tmp = z * ((y - x) / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.8e-94) || !(z <= 7.5e-5)) tmp = Float64(z * Float64(Float64(y - x) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.8e-94) || ~((z <= 7.5e-5))) tmp = z * ((y - x) / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.8e-94], N[Not[LessEqual[z, 7.5e-5]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-94} \lor \neg \left(z \leq 7.5 \cdot 10^{-5}\right):\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8e-94 or 7.49999999999999934e-5 < z Initial program 91.8%
Taylor expanded in t around 0 71.0%
associate-*l/98.1%
Applied egg-rr76.0%
if -1.8e-94 < z < 7.49999999999999934e-5Initial program 97.8%
Taylor expanded in z around 0 61.9%
Final simplification70.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.5e-11) (not (<= t 6.3e+18))) (+ x (* y (/ z t))) (* z (/ (- y x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.5e-11) || !(t <= 6.3e+18)) {
tmp = x + (y * (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 ((t <= (-8.5d-11)) .or. (.not. (t <= 6.3d+18))) then
tmp = x + (y * (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 ((t <= -8.5e-11) || !(t <= 6.3e+18)) {
tmp = x + (y * (z / t));
} else {
tmp = z * ((y - x) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.5e-11) or not (t <= 6.3e+18): tmp = x + (y * (z / t)) else: tmp = z * ((y - x) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.5e-11) || !(t <= 6.3e+18)) tmp = Float64(x + Float64(y * 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 ((t <= -8.5e-11) || ~((t <= 6.3e+18))) tmp = x + (y * (z / t)); else tmp = z * ((y - x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.5e-11], N[Not[LessEqual[t, 6.3e+18]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-11} \lor \neg \left(t \leq 6.3 \cdot 10^{+18}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\end{array}
\end{array}
if t < -8.50000000000000037e-11 or 6.3e18 < t Initial program 89.6%
Taylor expanded in y around inf 84.3%
associate-*r/28.5%
Simplified88.0%
if -8.50000000000000037e-11 < t < 6.3e18Initial program 98.2%
Taylor expanded in t around 0 85.4%
associate-*l/85.4%
Applied egg-rr76.8%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3e-14) (not (<= x 2.05e+47))) (- x (* x (/ z t))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3e-14) || !(x <= 2.05e+47)) {
tmp = x - (x * (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 <= (-3d-14)) .or. (.not. (x <= 2.05d+47))) then
tmp = x - (x * (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 <= -3e-14) || !(x <= 2.05e+47)) {
tmp = x - (x * (z / t));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3e-14) or not (x <= 2.05e+47): tmp = x - (x * (z / t)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3e-14) || !(x <= 2.05e+47)) tmp = Float64(x - Float64(x * 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 <= -3e-14) || ~((x <= 2.05e+47))) tmp = x - (x * (z / t)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3e-14], N[Not[LessEqual[x, 2.05e+47]], $MachinePrecision]], N[(x - N[(x * 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 -3 \cdot 10^{-14} \lor \neg \left(x \leq 2.05 \cdot 10^{+47}\right):\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -2.9999999999999998e-14 or 2.05000000000000005e47 < x Initial program 93.0%
Taylor expanded in x around inf 92.5%
*-commutative92.5%
distribute-lft-in92.5%
*-rgt-identity92.5%
mul-1-neg92.5%
distribute-rgt-neg-in92.5%
unsub-neg92.5%
Simplified92.5%
if -2.9999999999999998e-14 < x < 2.05000000000000005e47Initial program 94.6%
Taylor expanded in y around inf 77.4%
associate-*r/53.9%
Simplified81.9%
Final simplification86.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.7e-21) (not (<= x 1.7e+47))) (- x (/ x (/ t z))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.7e-21) || !(x <= 1.7e+47)) {
tmp = x - (x / (t / z));
} 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.7d-21)) .or. (.not. (x <= 1.7d+47))) then
tmp = x - (x / (t / z))
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.7e-21) || !(x <= 1.7e+47)) {
tmp = x - (x / (t / z));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.7e-21) or not (x <= 1.7e+47): tmp = x - (x / (t / z)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.7e-21) || !(x <= 1.7e+47)) tmp = Float64(x - Float64(x / Float64(t / z))); 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.7e-21) || ~((x <= 1.7e+47))) tmp = x - (x / (t / z)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.7e-21], N[Not[LessEqual[x, 1.7e+47]], $MachinePrecision]], N[(x - N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-21} \lor \neg \left(x \leq 1.7 \cdot 10^{+47}\right):\\
\;\;\;\;x - \frac{x}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -1.7e-21 or 1.6999999999999999e47 < x Initial program 93.1%
Taylor expanded in x around inf 91.8%
*-commutative91.8%
distribute-lft-in91.8%
*-rgt-identity91.8%
mul-1-neg91.8%
distribute-rgt-neg-in91.8%
unsub-neg91.8%
Simplified91.8%
clear-num91.8%
un-div-inv92.4%
Applied egg-rr92.4%
if -1.7e-21 < x < 1.6999999999999999e47Initial program 94.6%
Taylor expanded in y around inf 77.7%
associate-*r/54.6%
Simplified82.3%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (<= t -3.8e-15) (+ x (* y (/ z t))) (if (<= t 4.1e+16) (* z (/ (- y x) t)) (+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.8e-15) {
tmp = x + (y * (z / t));
} else if (t <= 4.1e+16) {
tmp = z * ((y - x) / t);
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.8d-15)) then
tmp = x + (y * (z / t))
else if (t <= 4.1d+16) then
tmp = z * ((y - x) / t)
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.8e-15) {
tmp = x + (y * (z / t));
} else if (t <= 4.1e+16) {
tmp = z * ((y - x) / t);
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.8e-15: tmp = x + (y * (z / t)) elif t <= 4.1e+16: tmp = z * ((y - x) / t) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.8e-15) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 4.1e+16) tmp = Float64(z * Float64(Float64(y - x) / t)); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.8e-15) tmp = x + (y * (z / t)); elseif (t <= 4.1e+16) tmp = z * ((y - x) / t); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.8e-15], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+16], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-15}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+16}:\\
\;\;\;\;z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -3.8000000000000002e-15Initial program 88.3%
Taylor expanded in y around inf 83.7%
associate-*r/27.0%
Simplified88.0%
if -3.8000000000000002e-15 < t < 4.1e16Initial program 98.2%
Taylor expanded in t around 0 85.4%
associate-*l/85.4%
Applied egg-rr76.8%
if 4.1e16 < t Initial program 90.9%
Taylor expanded in y around inf 85.0%
associate-*r/30.1%
Simplified88.0%
clear-num87.9%
un-div-inv88.0%
Applied egg-rr88.0%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (<= t -660000.0) (+ x (* y (/ z t))) (if (<= t 5.6e+17) (/ (* (- y x) z) t) (+ x (/ y (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -660000.0) {
tmp = x + (y * (z / t));
} else if (t <= 5.6e+17) {
tmp = ((y - x) * z) / t;
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-660000.0d0)) then
tmp = x + (y * (z / t))
else if (t <= 5.6d+17) then
tmp = ((y - x) * z) / t
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -660000.0) {
tmp = x + (y * (z / t));
} else if (t <= 5.6e+17) {
tmp = ((y - x) * z) / t;
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -660000.0: tmp = x + (y * (z / t)) elif t <= 5.6e+17: tmp = ((y - x) * z) / t else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -660000.0) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 5.6e+17) tmp = Float64(Float64(Float64(y - x) * z) / t); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -660000.0) tmp = x + (y * (z / t)); elseif (t <= 5.6e+17) tmp = ((y - x) * z) / t; else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -660000.0], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+17], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -660000:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+17}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if t < -6.6e5Initial program 87.9%
Taylor expanded in y around inf 83.1%
associate-*r/24.6%
Simplified87.6%
if -6.6e5 < t < 5.6e17Initial program 98.2%
Taylor expanded in t around 0 85.7%
if 5.6e17 < t Initial program 90.9%
Taylor expanded in y around inf 85.0%
associate-*r/30.1%
Simplified88.0%
clear-num87.9%
un-div-inv88.0%
Applied egg-rr88.0%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (<= x 6.8e+47) (+ x (* z (/ (- y x) t))) (- x (/ x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 6.8e+47) {
tmp = x + (z * ((y - x) / 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 (x <= 6.8d+47) then
tmp = x + (z * ((y - x) / 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 (x <= 6.8e+47) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = x - (x / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= 6.8e+47: tmp = x + (z * ((y - x) / t)) else: tmp = x - (x / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= 6.8e+47) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / 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 (x <= 6.8e+47) tmp = x + (z * ((y - x) / t)); else tmp = x - (x / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, 6.8e+47], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.8 \cdot 10^{+47}:\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{\frac{t}{z}}\\
\end{array}
\end{array}
if x < 6.7999999999999996e47Initial program 94.2%
associate-*l/92.4%
Applied egg-rr92.4%
if 6.7999999999999996e47 < x Initial program 93.1%
Taylor expanded in x around inf 96.1%
*-commutative96.1%
distribute-lft-in96.1%
*-rgt-identity96.1%
mul-1-neg96.1%
distribute-rgt-neg-in96.1%
unsub-neg96.1%
Simplified96.1%
clear-num96.1%
un-div-inv96.1%
Applied egg-rr96.1%
Final simplification93.2%
(FPCore (x y z t) :precision binary64 (if (<= t -14000000000000.0) x (if (<= t 1.4e-102) (* y (/ z t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -14000000000000.0) {
tmp = x;
} else if (t <= 1.4e-102) {
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 (t <= (-14000000000000.0d0)) then
tmp = x
else if (t <= 1.4d-102) 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 (t <= -14000000000000.0) {
tmp = x;
} else if (t <= 1.4e-102) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -14000000000000.0: tmp = x elif t <= 1.4e-102: tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -14000000000000.0) tmp = x; elseif (t <= 1.4e-102) 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 (t <= -14000000000000.0) tmp = x; elseif (t <= 1.4e-102) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -14000000000000.0], x, If[LessEqual[t, 1.4e-102], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -14000000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-102}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.4e13 or 1.40000000000000006e-102 < t Initial program 91.1%
Taylor expanded in z around 0 57.2%
if -1.4e13 < t < 1.40000000000000006e-102Initial program 97.8%
Taylor expanded in t around 0 88.5%
Taylor expanded in y around inf 52.8%
associate-*r/57.3%
Simplified57.3%
Final simplification57.3%
(FPCore (x y z t) :precision binary64 (+ x (/ z (/ t (- y x)))))
double code(double x, double y, double z, double t) {
return x + (z / (t / (y - 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 + (z / (t / (y - x)))
end function
public static double code(double x, double y, double z, double t) {
return x + (z / (t / (y - x)));
}
def code(x, y, z, t): return x + (z / (t / (y - x)))
function code(x, y, z, t) return Float64(x + Float64(z / Float64(t / Float64(y - x)))) end
function tmp = code(x, y, z, t) tmp = x + (z / (t / (y - x))); end
code[x_, y_, z_, t_] := N[(x + N[(z / N[(t / N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z}{\frac{t}{y - x}}
\end{array}
Initial program 93.9%
associate-*l/91.4%
Applied egg-rr91.4%
*-commutative91.4%
clear-num91.4%
un-div-inv91.8%
Applied egg-rr91.8%
Final simplification91.8%
(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}
Initial program 93.9%
associate-/l*97.2%
Simplified97.2%
Final simplification97.2%
(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 93.9%
Taylor expanded in z around 0 37.4%
Final simplification37.4%
(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 2023176
(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)))