
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* x (+ z 1.0))))
(if (<= y -22000000000000.0)
(* y (- x))
(if (<= y -9e-221)
t_2
(if (<= y -4.5e-248)
t_1
(if (<= y 8.5e-288)
t_2
(if (<= y 4e-146) t_1 (if (<= y 6e-5) t_2 (* y t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -22000000000000.0) {
tmp = y * -x;
} else if (y <= -9e-221) {
tmp = t_2;
} else if (y <= -4.5e-248) {
tmp = t_1;
} else if (y <= 8.5e-288) {
tmp = t_2;
} else if (y <= 4e-146) {
tmp = t_1;
} else if (y <= 6e-5) {
tmp = t_2;
} else {
tmp = 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * -t
t_2 = x * (z + 1.0d0)
if (y <= (-22000000000000.0d0)) then
tmp = y * -x
else if (y <= (-9d-221)) then
tmp = t_2
else if (y <= (-4.5d-248)) then
tmp = t_1
else if (y <= 8.5d-288) then
tmp = t_2
else if (y <= 4d-146) then
tmp = t_1
else if (y <= 6d-5) then
tmp = t_2
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -22000000000000.0) {
tmp = y * -x;
} else if (y <= -9e-221) {
tmp = t_2;
} else if (y <= -4.5e-248) {
tmp = t_1;
} else if (y <= 8.5e-288) {
tmp = t_2;
} else if (y <= 4e-146) {
tmp = t_1;
} else if (y <= 6e-5) {
tmp = t_2;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = x * (z + 1.0) tmp = 0 if y <= -22000000000000.0: tmp = y * -x elif y <= -9e-221: tmp = t_2 elif y <= -4.5e-248: tmp = t_1 elif y <= 8.5e-288: tmp = t_2 elif y <= 4e-146: tmp = t_1 elif y <= 6e-5: tmp = t_2 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -22000000000000.0) tmp = Float64(y * Float64(-x)); elseif (y <= -9e-221) tmp = t_2; elseif (y <= -4.5e-248) tmp = t_1; elseif (y <= 8.5e-288) tmp = t_2; elseif (y <= 4e-146) tmp = t_1; elseif (y <= 6e-5) tmp = t_2; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = x * (z + 1.0); tmp = 0.0; if (y <= -22000000000000.0) tmp = y * -x; elseif (y <= -9e-221) tmp = t_2; elseif (y <= -4.5e-248) tmp = t_1; elseif (y <= 8.5e-288) tmp = t_2; elseif (y <= 4e-146) tmp = t_1; elseif (y <= 6e-5) tmp = t_2; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -22000000000000.0], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -9e-221], t$95$2, If[LessEqual[y, -4.5e-248], t$95$1, If[LessEqual[y, 8.5e-288], t$95$2, If[LessEqual[y, 4e-146], t$95$1, If[LessEqual[y, 6e-5], t$95$2, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -22000000000000:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-221}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-248}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-288}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.2e13Initial program 100.0%
Taylor expanded in x around inf 61.5%
mul-1-neg61.5%
neg-sub061.5%
associate-+r-61.5%
metadata-eval61.5%
Simplified61.5%
Taylor expanded in y around inf 50.1%
mul-1-neg50.1%
*-commutative50.1%
distribute-rgt-neg-out50.1%
Simplified50.1%
if -2.2e13 < y < -9.00000000000000052e-221 or -4.4999999999999996e-248 < y < 8.4999999999999997e-288 or 4.0000000000000001e-146 < y < 6.00000000000000015e-5Initial program 100.0%
Taylor expanded in x around inf 65.1%
mul-1-neg65.1%
neg-sub065.1%
associate-+r-65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in y around 0 63.6%
+-commutative63.6%
Simplified63.6%
if -9.00000000000000052e-221 < y < -4.4999999999999996e-248 or 8.4999999999999997e-288 < y < 4.0000000000000001e-146Initial program 100.0%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 66.8%
mul-1-neg66.8%
*-commutative66.8%
distribute-rgt-neg-out66.8%
Simplified66.8%
if 6.00000000000000015e-5 < y Initial program 100.0%
Taylor expanded in y around inf 79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in t around inf 52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in x around 0 52.4%
Final simplification58.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* x (+ z 1.0))))
(if (<= y -255.0)
(* x (- 1.0 y))
(if (<= y -3.1e-221)
t_2
(if (<= y -4.4e-248)
t_1
(if (<= y 2.05e-286)
t_2
(if (<= y 3.2e-148) t_1 (if (<= y 2.6e-5) t_2 (* y t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -255.0) {
tmp = x * (1.0 - y);
} else if (y <= -3.1e-221) {
tmp = t_2;
} else if (y <= -4.4e-248) {
tmp = t_1;
} else if (y <= 2.05e-286) {
tmp = t_2;
} else if (y <= 3.2e-148) {
tmp = t_1;
} else if (y <= 2.6e-5) {
tmp = t_2;
} else {
tmp = 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * -t
t_2 = x * (z + 1.0d0)
if (y <= (-255.0d0)) then
tmp = x * (1.0d0 - y)
else if (y <= (-3.1d-221)) then
tmp = t_2
else if (y <= (-4.4d-248)) then
tmp = t_1
else if (y <= 2.05d-286) then
tmp = t_2
else if (y <= 3.2d-148) then
tmp = t_1
else if (y <= 2.6d-5) then
tmp = t_2
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -255.0) {
tmp = x * (1.0 - y);
} else if (y <= -3.1e-221) {
tmp = t_2;
} else if (y <= -4.4e-248) {
tmp = t_1;
} else if (y <= 2.05e-286) {
tmp = t_2;
} else if (y <= 3.2e-148) {
tmp = t_1;
} else if (y <= 2.6e-5) {
tmp = t_2;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = x * (z + 1.0) tmp = 0 if y <= -255.0: tmp = x * (1.0 - y) elif y <= -3.1e-221: tmp = t_2 elif y <= -4.4e-248: tmp = t_1 elif y <= 2.05e-286: tmp = t_2 elif y <= 3.2e-148: tmp = t_1 elif y <= 2.6e-5: tmp = t_2 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -255.0) tmp = Float64(x * Float64(1.0 - y)); elseif (y <= -3.1e-221) tmp = t_2; elseif (y <= -4.4e-248) tmp = t_1; elseif (y <= 2.05e-286) tmp = t_2; elseif (y <= 3.2e-148) tmp = t_1; elseif (y <= 2.6e-5) tmp = t_2; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = x * (z + 1.0); tmp = 0.0; if (y <= -255.0) tmp = x * (1.0 - y); elseif (y <= -3.1e-221) tmp = t_2; elseif (y <= -4.4e-248) tmp = t_1; elseif (y <= 2.05e-286) tmp = t_2; elseif (y <= 3.2e-148) tmp = t_1; elseif (y <= 2.6e-5) tmp = t_2; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -255.0], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.1e-221], t$95$2, If[LessEqual[y, -4.4e-248], t$95$1, If[LessEqual[y, 2.05e-286], t$95$2, If[LessEqual[y, 3.2e-148], t$95$1, If[LessEqual[y, 2.6e-5], t$95$2, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -255:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{-221}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-248}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-286}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -255Initial program 100.0%
Taylor expanded in x around inf 60.0%
mul-1-neg60.0%
neg-sub060.0%
associate-+r-60.0%
metadata-eval60.0%
Simplified60.0%
Taylor expanded in z around 0 48.1%
if -255 < y < -3.0999999999999999e-221 or -4.39999999999999999e-248 < y < 2.05e-286 or 3.19999999999999993e-148 < y < 2.59999999999999984e-5Initial program 100.0%
Taylor expanded in x around inf 66.4%
mul-1-neg66.4%
neg-sub066.4%
associate-+r-66.4%
metadata-eval66.4%
Simplified66.4%
Taylor expanded in y around 0 66.4%
+-commutative66.4%
Simplified66.4%
if -3.0999999999999999e-221 < y < -4.39999999999999999e-248 or 2.05e-286 < y < 3.19999999999999993e-148Initial program 100.0%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 66.8%
mul-1-neg66.8%
*-commutative66.8%
distribute-rgt-neg-out66.8%
Simplified66.8%
if 2.59999999999999984e-5 < y Initial program 100.0%
Taylor expanded in y around inf 79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in t around inf 52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in x around 0 52.4%
Final simplification58.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* x (- 1.0 y))))
(if (<= z -9.5e+36)
t_1
(if (<= z -3.3e-18)
t_2
(if (<= z -1.02e-106)
(* y t)
(if (<= z -8e-205)
t_2
(if (<= z 3.3e-301) (* y t) (if (<= z 10.5) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -9.5e+36) {
tmp = t_1;
} else if (z <= -3.3e-18) {
tmp = t_2;
} else if (z <= -1.02e-106) {
tmp = y * t;
} else if (z <= -8e-205) {
tmp = t_2;
} else if (z <= 3.3e-301) {
tmp = y * t;
} else if (z <= 10.5) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (x - t)
t_2 = x * (1.0d0 - y)
if (z <= (-9.5d+36)) then
tmp = t_1
else if (z <= (-3.3d-18)) then
tmp = t_2
else if (z <= (-1.02d-106)) then
tmp = y * t
else if (z <= (-8d-205)) then
tmp = t_2
else if (z <= 3.3d-301) then
tmp = y * t
else if (z <= 10.5d0) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -9.5e+36) {
tmp = t_1;
} else if (z <= -3.3e-18) {
tmp = t_2;
} else if (z <= -1.02e-106) {
tmp = y * t;
} else if (z <= -8e-205) {
tmp = t_2;
} else if (z <= 3.3e-301) {
tmp = y * t;
} else if (z <= 10.5) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x * (1.0 - y) tmp = 0 if z <= -9.5e+36: tmp = t_1 elif z <= -3.3e-18: tmp = t_2 elif z <= -1.02e-106: tmp = y * t elif z <= -8e-205: tmp = t_2 elif z <= 3.3e-301: tmp = y * t elif z <= 10.5: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -9.5e+36) tmp = t_1; elseif (z <= -3.3e-18) tmp = t_2; elseif (z <= -1.02e-106) tmp = Float64(y * t); elseif (z <= -8e-205) tmp = t_2; elseif (z <= 3.3e-301) tmp = Float64(y * t); elseif (z <= 10.5) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = x * (1.0 - y); tmp = 0.0; if (z <= -9.5e+36) tmp = t_1; elseif (z <= -3.3e-18) tmp = t_2; elseif (z <= -1.02e-106) tmp = y * t; elseif (z <= -8e-205) tmp = t_2; elseif (z <= 3.3e-301) tmp = y * t; elseif (z <= 10.5) tmp = t_2; else tmp = t_1; 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[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.5e+36], t$95$1, If[LessEqual[z, -3.3e-18], t$95$2, If[LessEqual[z, -1.02e-106], N[(y * t), $MachinePrecision], If[LessEqual[z, -8e-205], t$95$2, If[LessEqual[z, 3.3e-301], N[(y * t), $MachinePrecision], If[LessEqual[z, 10.5], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -9.5 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-106}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-205}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-301}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 10.5:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -9.49999999999999974e36 or 10.5 < z Initial program 100.0%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
*-commutative83.2%
distribute-rgt-neg-out83.2%
Simplified83.2%
distribute-rgt-neg-out83.2%
unsub-neg83.2%
Applied egg-rr83.2%
Taylor expanded in z around inf 83.1%
if -9.49999999999999974e36 < z < -3.3000000000000002e-18 or -1.02e-106 < z < -8e-205 or 3.3e-301 < z < 10.5Initial program 100.0%
Taylor expanded in x around inf 59.5%
mul-1-neg59.5%
neg-sub059.5%
associate-+r-59.5%
metadata-eval59.5%
Simplified59.5%
Taylor expanded in z around 0 59.0%
if -3.3000000000000002e-18 < z < -1.02e-106 or -8e-205 < z < 3.3e-301Initial program 100.0%
Taylor expanded in y around inf 86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 69.5%
*-commutative69.5%
Simplified69.5%
Taylor expanded in x around 0 59.0%
Final simplification71.1%
(FPCore (x y z t)
:precision binary64
(if (or (<= t -4.2e+36)
(and (not (<= t -75000000000.0))
(or (<= t -4.2e-80) (not (<= t 1.2e-32)))))
(+ x (* (- y z) t))
(* x (+ (- z y) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.2e+36) || (!(t <= -75000000000.0) && ((t <= -4.2e-80) || !(t <= 1.2e-32)))) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z - y) + 1.0);
}
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 <= (-4.2d+36)) .or. (.not. (t <= (-75000000000.0d0))) .and. (t <= (-4.2d-80)) .or. (.not. (t <= 1.2d-32))) then
tmp = x + ((y - z) * t)
else
tmp = x * ((z - y) + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.2e+36) || (!(t <= -75000000000.0) && ((t <= -4.2e-80) || !(t <= 1.2e-32)))) {
tmp = x + ((y - z) * t);
} else {
tmp = x * ((z - y) + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.2e+36) or (not (t <= -75000000000.0) and ((t <= -4.2e-80) or not (t <= 1.2e-32))): tmp = x + ((y - z) * t) else: tmp = x * ((z - y) + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.2e+36) || (!(t <= -75000000000.0) && ((t <= -4.2e-80) || !(t <= 1.2e-32)))) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x * Float64(Float64(z - y) + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.2e+36) || (~((t <= -75000000000.0)) && ((t <= -4.2e-80) || ~((t <= 1.2e-32))))) tmp = x + ((y - z) * t); else tmp = x * ((z - y) + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.2e+36], And[N[Not[LessEqual[t, -75000000000.0]], $MachinePrecision], Or[LessEqual[t, -4.2e-80], N[Not[LessEqual[t, 1.2e-32]], $MachinePrecision]]]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+36} \lor \neg \left(t \leq -75000000000\right) \land \left(t \leq -4.2 \cdot 10^{-80} \lor \neg \left(t \leq 1.2 \cdot 10^{-32}\right)\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\end{array}
\end{array}
if t < -4.20000000000000009e36 or -7.5e10 < t < -4.20000000000000003e-80 or 1.2000000000000001e-32 < t Initial program 100.0%
Taylor expanded in t around inf 86.4%
if -4.20000000000000009e36 < t < -7.5e10 or -4.20000000000000003e-80 < t < 1.2000000000000001e-32Initial program 100.0%
Taylor expanded in x around inf 87.2%
mul-1-neg87.2%
neg-sub087.2%
associate-+r-87.2%
metadata-eval87.2%
Simplified87.2%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y (- t x)))))
(if (<= y -2e+136)
t_1
(if (<= y -1.9e+109)
(* x (+ (- z y) 1.0))
(if (or (<= y -1.85e-16) (not (<= y 3.8e-7)))
t_1
(+ x (* z (- x t))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * (t - x));
double tmp;
if (y <= -2e+136) {
tmp = t_1;
} else if (y <= -1.9e+109) {
tmp = x * ((z - y) + 1.0);
} else if ((y <= -1.85e-16) || !(y <= 3.8e-7)) {
tmp = t_1;
} else {
tmp = x + (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 = x + (y * (t - x))
if (y <= (-2d+136)) then
tmp = t_1
else if (y <= (-1.9d+109)) then
tmp = x * ((z - y) + 1.0d0)
else if ((y <= (-1.85d-16)) .or. (.not. (y <= 3.8d-7))) then
tmp = t_1
else
tmp = x + (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (y * (t - x));
double tmp;
if (y <= -2e+136) {
tmp = t_1;
} else if (y <= -1.9e+109) {
tmp = x * ((z - y) + 1.0);
} else if ((y <= -1.85e-16) || !(y <= 3.8e-7)) {
tmp = t_1;
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * (t - x)) tmp = 0 if y <= -2e+136: tmp = t_1 elif y <= -1.9e+109: tmp = x * ((z - y) + 1.0) elif (y <= -1.85e-16) or not (y <= 3.8e-7): tmp = t_1 else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * Float64(t - x))) tmp = 0.0 if (y <= -2e+136) tmp = t_1; elseif (y <= -1.9e+109) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); elseif ((y <= -1.85e-16) || !(y <= 3.8e-7)) tmp = t_1; else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * (t - x)); tmp = 0.0; if (y <= -2e+136) tmp = t_1; elseif (y <= -1.9e+109) tmp = x * ((z - y) + 1.0); elseif ((y <= -1.85e-16) || ~((y <= 3.8e-7))) tmp = t_1; else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+136], t$95$1, If[LessEqual[y, -1.9e+109], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.85e-16], N[Not[LessEqual[y, 3.8e-7]], $MachinePrecision]], t$95$1, N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{+109}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-16} \lor \neg \left(y \leq 3.8 \cdot 10^{-7}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -2.00000000000000012e136 or -1.90000000000000019e109 < y < -1.85e-16 or 3.80000000000000015e-7 < y Initial program 100.0%
Taylor expanded in y around inf 79.0%
*-commutative79.0%
Simplified79.0%
if -2.00000000000000012e136 < y < -1.90000000000000019e109Initial program 100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
metadata-eval100.0%
Simplified100.0%
if -1.85e-16 < y < 3.80000000000000015e-7Initial program 100.0%
Taylor expanded in y around 0 93.9%
mul-1-neg93.9%
*-commutative93.9%
distribute-rgt-neg-out93.9%
Simplified93.9%
distribute-rgt-neg-out93.9%
unsub-neg93.9%
Applied egg-rr93.9%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -21000000000000.0)
(* y (- x))
(if (<= y -1.85e-185)
(* z x)
(if (<= y -1.45e-252)
t_1
(if (<= y 2.7e-286) (* z x) (if (<= y 4.2e-7) t_1 (* y t))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -21000000000000.0) {
tmp = y * -x;
} else if (y <= -1.85e-185) {
tmp = z * x;
} else if (y <= -1.45e-252) {
tmp = t_1;
} else if (y <= 2.7e-286) {
tmp = z * x;
} else if (y <= 4.2e-7) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-21000000000000.0d0)) then
tmp = y * -x
else if (y <= (-1.85d-185)) then
tmp = z * x
else if (y <= (-1.45d-252)) then
tmp = t_1
else if (y <= 2.7d-286) then
tmp = z * x
else if (y <= 4.2d-7) then
tmp = t_1
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -21000000000000.0) {
tmp = y * -x;
} else if (y <= -1.85e-185) {
tmp = z * x;
} else if (y <= -1.45e-252) {
tmp = t_1;
} else if (y <= 2.7e-286) {
tmp = z * x;
} else if (y <= 4.2e-7) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -21000000000000.0: tmp = y * -x elif y <= -1.85e-185: tmp = z * x elif y <= -1.45e-252: tmp = t_1 elif y <= 2.7e-286: tmp = z * x elif y <= 4.2e-7: tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -21000000000000.0) tmp = Float64(y * Float64(-x)); elseif (y <= -1.85e-185) tmp = Float64(z * x); elseif (y <= -1.45e-252) tmp = t_1; elseif (y <= 2.7e-286) tmp = Float64(z * x); elseif (y <= 4.2e-7) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -21000000000000.0) tmp = y * -x; elseif (y <= -1.85e-185) tmp = z * x; elseif (y <= -1.45e-252) tmp = t_1; elseif (y <= 2.7e-286) tmp = z * x; elseif (y <= 4.2e-7) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -21000000000000.0], N[(y * (-x)), $MachinePrecision], If[LessEqual[y, -1.85e-185], N[(z * x), $MachinePrecision], If[LessEqual[y, -1.45e-252], t$95$1, If[LessEqual[y, 2.7e-286], N[(z * x), $MachinePrecision], If[LessEqual[y, 4.2e-7], t$95$1, N[(y * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -21000000000000:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-185}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-252}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-286}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.1e13Initial program 100.0%
Taylor expanded in x around inf 61.5%
mul-1-neg61.5%
neg-sub061.5%
associate-+r-61.5%
metadata-eval61.5%
Simplified61.5%
Taylor expanded in y around inf 50.1%
mul-1-neg50.1%
*-commutative50.1%
distribute-rgt-neg-out50.1%
Simplified50.1%
if -2.1e13 < y < -1.85e-185 or -1.45e-252 < y < 2.7000000000000002e-286Initial program 100.0%
Taylor expanded in x around inf 67.8%
mul-1-neg67.8%
neg-sub067.8%
associate-+r-67.8%
metadata-eval67.8%
Simplified67.8%
Taylor expanded in z around inf 40.4%
if -1.85e-185 < y < -1.45e-252 or 2.7000000000000002e-286 < y < 4.2e-7Initial program 100.0%
Taylor expanded in y around 0 94.9%
mul-1-neg94.9%
*-commutative94.9%
distribute-rgt-neg-out94.9%
Simplified94.9%
distribute-rgt-neg-out94.9%
unsub-neg94.9%
Applied egg-rr94.9%
Taylor expanded in x around 0 52.3%
mul-1-neg52.3%
*-commutative52.3%
distribute-rgt-neg-out52.3%
Simplified52.3%
if 4.2e-7 < y Initial program 100.0%
Taylor expanded in y around inf 79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in t around inf 52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in x around 0 52.4%
Final simplification48.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -2.9e+49)
t_1
(if (<= z 5.6e-75)
(+ x (* y t))
(if (<= z 4.2e+32)
(* x (+ (- z y) 1.0))
(if (<= z 1.45e+56) (* z (- t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -2.9e+49) {
tmp = t_1;
} else if (z <= 5.6e-75) {
tmp = x + (y * t);
} else if (z <= 4.2e+32) {
tmp = x * ((z - y) + 1.0);
} else if (z <= 1.45e+56) {
tmp = z * -t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x - t)
if (z <= (-2.9d+49)) then
tmp = t_1
else if (z <= 5.6d-75) then
tmp = x + (y * t)
else if (z <= 4.2d+32) then
tmp = x * ((z - y) + 1.0d0)
else if (z <= 1.45d+56) then
tmp = z * -t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -2.9e+49) {
tmp = t_1;
} else if (z <= 5.6e-75) {
tmp = x + (y * t);
} else if (z <= 4.2e+32) {
tmp = x * ((z - y) + 1.0);
} else if (z <= 1.45e+56) {
tmp = z * -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -2.9e+49: tmp = t_1 elif z <= 5.6e-75: tmp = x + (y * t) elif z <= 4.2e+32: tmp = x * ((z - y) + 1.0) elif z <= 1.45e+56: tmp = z * -t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -2.9e+49) tmp = t_1; elseif (z <= 5.6e-75) tmp = Float64(x + Float64(y * t)); elseif (z <= 4.2e+32) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); elseif (z <= 1.45e+56) tmp = Float64(z * Float64(-t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -2.9e+49) tmp = t_1; elseif (z <= 5.6e-75) tmp = x + (y * t); elseif (z <= 4.2e+32) tmp = x * ((z - y) + 1.0); elseif (z <= 1.45e+56) tmp = z * -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+49], t$95$1, If[LessEqual[z, 5.6e-75], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+32], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+56], N[(z * (-t)), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-75}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+32}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+56}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.9e49 or 1.45000000000000004e56 < z Initial program 100.0%
Taylor expanded in y around 0 87.0%
mul-1-neg87.0%
*-commutative87.0%
distribute-rgt-neg-out87.0%
Simplified87.0%
distribute-rgt-neg-out87.0%
unsub-neg87.0%
Applied egg-rr87.0%
Taylor expanded in z around inf 87.0%
if -2.9e49 < z < 5.59999999999999996e-75Initial program 100.0%
Taylor expanded in y around inf 89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in t around inf 66.5%
*-commutative66.5%
Simplified66.5%
if 5.59999999999999996e-75 < z < 4.2000000000000001e32Initial program 99.9%
Taylor expanded in x around inf 57.8%
mul-1-neg57.8%
neg-sub057.8%
associate-+r-57.8%
metadata-eval57.8%
Simplified57.8%
if 4.2000000000000001e32 < z < 1.45000000000000004e56Initial program 99.8%
Taylor expanded in y around 0 57.3%
mul-1-neg57.3%
*-commutative57.3%
distribute-rgt-neg-out57.3%
Simplified57.3%
distribute-rgt-neg-out57.3%
unsub-neg57.3%
Applied egg-rr57.3%
Taylor expanded in x around 0 71.5%
mul-1-neg71.5%
*-commutative71.5%
distribute-rgt-neg-out71.5%
Simplified71.5%
Final simplification74.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.45e+86)
(* z x)
(if (<= z 2.55e-188)
(* y t)
(if (<= z 2.9e-170) x (if (<= z 4.7e+76) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.45e+86) {
tmp = z * x;
} else if (z <= 2.55e-188) {
tmp = y * t;
} else if (z <= 2.9e-170) {
tmp = x;
} else if (z <= 4.7e+76) {
tmp = y * t;
} else {
tmp = z * 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.45d+86)) then
tmp = z * x
else if (z <= 2.55d-188) then
tmp = y * t
else if (z <= 2.9d-170) then
tmp = x
else if (z <= 4.7d+76) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.45e+86) {
tmp = z * x;
} else if (z <= 2.55e-188) {
tmp = y * t;
} else if (z <= 2.9e-170) {
tmp = x;
} else if (z <= 4.7e+76) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.45e+86: tmp = z * x elif z <= 2.55e-188: tmp = y * t elif z <= 2.9e-170: tmp = x elif z <= 4.7e+76: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.45e+86) tmp = Float64(z * x); elseif (z <= 2.55e-188) tmp = Float64(y * t); elseif (z <= 2.9e-170) tmp = x; elseif (z <= 4.7e+76) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.45e+86) tmp = z * x; elseif (z <= 2.55e-188) tmp = y * t; elseif (z <= 2.9e-170) tmp = x; elseif (z <= 4.7e+76) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.45e+86], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.55e-188], N[(y * t), $MachinePrecision], If[LessEqual[z, 2.9e-170], x, If[LessEqual[z, 4.7e+76], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+86}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-188}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-170}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+76}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -1.44999999999999995e86 or 4.7000000000000003e76 < z Initial program 100.0%
Taylor expanded in x around inf 63.4%
mul-1-neg63.4%
neg-sub063.4%
associate-+r-63.4%
metadata-eval63.4%
Simplified63.4%
Taylor expanded in z around inf 58.3%
if -1.44999999999999995e86 < z < 2.55000000000000005e-188 or 2.9e-170 < z < 4.7000000000000003e76Initial program 100.0%
Taylor expanded in y around inf 81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in t around inf 56.9%
*-commutative56.9%
Simplified56.9%
Taylor expanded in x around 0 37.0%
if 2.55000000000000005e-188 < z < 2.9e-170Initial program 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 84.3%
Final simplification46.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+49) (not (<= z 1.22e+19))) (* z (- x t)) (+ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+49) || !(z <= 1.22e+19)) {
tmp = z * (x - t);
} else {
tmp = x + (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 ((z <= (-2.9d+49)) .or. (.not. (z <= 1.22d+19))) then
tmp = z * (x - t)
else
tmp = x + (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+49) || !(z <= 1.22e+19)) {
tmp = z * (x - t);
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.9e+49) or not (z <= 1.22e+19): tmp = z * (x - t) else: tmp = x + (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e+49) || !(z <= 1.22e+19)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.9e+49) || ~((z <= 1.22e+19))) tmp = z * (x - t); else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e+49], N[Not[LessEqual[z, 1.22e+19]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+49} \lor \neg \left(z \leq 1.22 \cdot 10^{+19}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
if z < -2.9e49 or 1.22e19 < z Initial program 100.0%
Taylor expanded in y around 0 84.8%
mul-1-neg84.8%
*-commutative84.8%
distribute-rgt-neg-out84.8%
Simplified84.8%
distribute-rgt-neg-out84.8%
unsub-neg84.8%
Applied egg-rr84.8%
Taylor expanded in z around inf 84.8%
if -2.9e49 < z < 1.22e19Initial program 100.0%
Taylor expanded in y around inf 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in t around inf 62.6%
*-commutative62.6%
Simplified62.6%
Final simplification73.3%
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -2.1e-29) (* y t) (if (<= y 1.4e-82) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-29) {
tmp = y * t;
} else if (y <= 1.4e-82) {
tmp = x;
} else {
tmp = 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 <= (-2.1d-29)) then
tmp = y * t
else if (y <= 1.4d-82) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-29) {
tmp = y * t;
} else if (y <= 1.4e-82) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e-29: tmp = y * t elif y <= 1.4e-82: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e-29) tmp = Float64(y * t); elseif (y <= 1.4e-82) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e-29) tmp = y * t; elseif (y <= 1.4e-82) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-29], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.4e-82], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.09999999999999989e-29 or 1.40000000000000012e-82 < y Initial program 100.0%
Taylor expanded in y around inf 70.3%
*-commutative70.3%
Simplified70.3%
Taylor expanded in t around inf 40.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in x around 0 38.6%
if -2.09999999999999989e-29 < y < 1.40000000000000012e-82Initial program 100.0%
Taylor expanded in y around inf 36.0%
*-commutative36.0%
Simplified36.0%
Taylor expanded in y around 0 33.3%
Final simplification36.5%
(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 100.0%
Taylor expanded in y around inf 56.7%
*-commutative56.7%
Simplified56.7%
Taylor expanded in y around 0 16.0%
Final simplification16.0%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - 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 + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2023297
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))