
(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 15 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 (* x (- 1.0 y))) (t_2 (+ x (* y t))))
(if (<= z -4.2e+113)
(* z (- t))
(if (<= z -3.9e+29)
(* z x)
(if (<= z -5.7e-167)
t_1
(if (<= z -1.95e-262)
t_2
(if (<= z 7.5e-254)
t_1
(if (<= z 9.2e-8) t_2 (* x (+ z 1.0))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (y * t);
double tmp;
if (z <= -4.2e+113) {
tmp = z * -t;
} else if (z <= -3.9e+29) {
tmp = z * x;
} else if (z <= -5.7e-167) {
tmp = t_1;
} else if (z <= -1.95e-262) {
tmp = t_2;
} else if (z <= 7.5e-254) {
tmp = t_1;
} else if (z <= 9.2e-8) {
tmp = t_2;
} else {
tmp = x * (z + 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = x + (y * t)
if (z <= (-4.2d+113)) then
tmp = z * -t
else if (z <= (-3.9d+29)) then
tmp = z * x
else if (z <= (-5.7d-167)) then
tmp = t_1
else if (z <= (-1.95d-262)) then
tmp = t_2
else if (z <= 7.5d-254) then
tmp = t_1
else if (z <= 9.2d-8) then
tmp = t_2
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (y * t);
double tmp;
if (z <= -4.2e+113) {
tmp = z * -t;
} else if (z <= -3.9e+29) {
tmp = z * x;
} else if (z <= -5.7e-167) {
tmp = t_1;
} else if (z <= -1.95e-262) {
tmp = t_2;
} else if (z <= 7.5e-254) {
tmp = t_1;
} else if (z <= 9.2e-8) {
tmp = t_2;
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = x + (y * t) tmp = 0 if z <= -4.2e+113: tmp = z * -t elif z <= -3.9e+29: tmp = z * x elif z <= -5.7e-167: tmp = t_1 elif z <= -1.95e-262: tmp = t_2 elif z <= 7.5e-254: tmp = t_1 elif z <= 9.2e-8: tmp = t_2 else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -4.2e+113) tmp = Float64(z * Float64(-t)); elseif (z <= -3.9e+29) tmp = Float64(z * x); elseif (z <= -5.7e-167) tmp = t_1; elseif (z <= -1.95e-262) tmp = t_2; elseif (z <= 7.5e-254) tmp = t_1; elseif (z <= 9.2e-8) tmp = t_2; else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = x + (y * t); tmp = 0.0; if (z <= -4.2e+113) tmp = z * -t; elseif (z <= -3.9e+29) tmp = z * x; elseif (z <= -5.7e-167) tmp = t_1; elseif (z <= -1.95e-262) tmp = t_2; elseif (z <= 7.5e-254) tmp = t_1; elseif (z <= 9.2e-8) tmp = t_2; else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+113], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, -3.9e+29], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.7e-167], t$95$1, If[LessEqual[z, -1.95e-262], t$95$2, If[LessEqual[z, 7.5e-254], t$95$1, If[LessEqual[z, 9.2e-8], t$95$2, N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := x + y \cdot t\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+113}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+29}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -5.7 \cdot 10^{-167}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-262}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-254}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-8}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if z < -4.1999999999999998e113Initial program 100.0%
Taylor expanded in t around inf 67.4%
Taylor expanded in z around inf 64.7%
mul-1-neg64.7%
distribute-rgt-neg-out64.7%
Simplified64.7%
if -4.1999999999999998e113 < z < -3.89999999999999968e29Initial program 99.9%
Taylor expanded in x around inf 61.1%
*-commutative61.1%
mul-1-neg61.1%
unsub-neg61.1%
distribute-lft-out--61.1%
*-rgt-identity61.1%
Simplified61.1%
Taylor expanded in z around inf 55.7%
if -3.89999999999999968e29 < z < -5.69999999999999988e-167 or -1.94999999999999992e-262 < z < 7.5000000000000005e-254Initial program 99.9%
Taylor expanded in z around 0 86.0%
Taylor expanded in t around 0 72.4%
mul-1-neg72.4%
sub-neg72.4%
Simplified72.4%
Taylor expanded in x around 0 72.4%
if -5.69999999999999988e-167 < z < -1.94999999999999992e-262 or 7.5000000000000005e-254 < z < 9.2000000000000003e-8Initial program 100.0%
Taylor expanded in t around inf 80.4%
Taylor expanded in z around 0 74.4%
if 9.2000000000000003e-8 < z Initial program 100.0%
Taylor expanded in y around 0 87.2%
+-commutative87.2%
mul-1-neg87.2%
unsub-neg87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in x around -inf 53.7%
Final simplification65.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* y t))))
(if (<= z -1.5e+116)
(- x (* z t))
(if (<= z -7.3e+28)
(* z x)
(if (<= z -2.2e-167)
t_1
(if (<= z -3.3e-263)
t_2
(if (<= z 7.8e-255)
t_1
(if (<= z 1.12e-7) t_2 (* x (+ z 1.0))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (y * t);
double tmp;
if (z <= -1.5e+116) {
tmp = x - (z * t);
} else if (z <= -7.3e+28) {
tmp = z * x;
} else if (z <= -2.2e-167) {
tmp = t_1;
} else if (z <= -3.3e-263) {
tmp = t_2;
} else if (z <= 7.8e-255) {
tmp = t_1;
} else if (z <= 1.12e-7) {
tmp = t_2;
} else {
tmp = x * (z + 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = x + (y * t)
if (z <= (-1.5d+116)) then
tmp = x - (z * t)
else if (z <= (-7.3d+28)) then
tmp = z * x
else if (z <= (-2.2d-167)) then
tmp = t_1
else if (z <= (-3.3d-263)) then
tmp = t_2
else if (z <= 7.8d-255) then
tmp = t_1
else if (z <= 1.12d-7) then
tmp = t_2
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (y * t);
double tmp;
if (z <= -1.5e+116) {
tmp = x - (z * t);
} else if (z <= -7.3e+28) {
tmp = z * x;
} else if (z <= -2.2e-167) {
tmp = t_1;
} else if (z <= -3.3e-263) {
tmp = t_2;
} else if (z <= 7.8e-255) {
tmp = t_1;
} else if (z <= 1.12e-7) {
tmp = t_2;
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = x + (y * t) tmp = 0 if z <= -1.5e+116: tmp = x - (z * t) elif z <= -7.3e+28: tmp = z * x elif z <= -2.2e-167: tmp = t_1 elif z <= -3.3e-263: tmp = t_2 elif z <= 7.8e-255: tmp = t_1 elif z <= 1.12e-7: tmp = t_2 else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -1.5e+116) tmp = Float64(x - Float64(z * t)); elseif (z <= -7.3e+28) tmp = Float64(z * x); elseif (z <= -2.2e-167) tmp = t_1; elseif (z <= -3.3e-263) tmp = t_2; elseif (z <= 7.8e-255) tmp = t_1; elseif (z <= 1.12e-7) tmp = t_2; else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = x + (y * t); tmp = 0.0; if (z <= -1.5e+116) tmp = x - (z * t); elseif (z <= -7.3e+28) tmp = z * x; elseif (z <= -2.2e-167) tmp = t_1; elseif (z <= -3.3e-263) tmp = t_2; elseif (z <= 7.8e-255) tmp = t_1; elseif (z <= 1.12e-7) tmp = t_2; else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+116], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.3e+28], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.2e-167], t$95$1, If[LessEqual[z, -3.3e-263], t$95$2, If[LessEqual[z, 7.8e-255], t$95$1, If[LessEqual[z, 1.12e-7], t$95$2, N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := x + y \cdot t\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+116}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;z \leq -7.3 \cdot 10^{+28}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-167}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-263}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-255}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if z < -1.4999999999999999e116Initial program 100.0%
Taylor expanded in y around 0 85.1%
+-commutative85.1%
mul-1-neg85.1%
unsub-neg85.1%
*-commutative85.1%
Simplified85.1%
Taylor expanded in t around inf 64.7%
*-commutative64.7%
Simplified64.7%
if -1.4999999999999999e116 < z < -7.2999999999999998e28Initial program 99.9%
Taylor expanded in x around inf 61.1%
*-commutative61.1%
mul-1-neg61.1%
unsub-neg61.1%
distribute-lft-out--61.1%
*-rgt-identity61.1%
Simplified61.1%
Taylor expanded in z around inf 55.7%
if -7.2999999999999998e28 < z < -2.2e-167 or -3.2999999999999997e-263 < z < 7.8000000000000001e-255Initial program 99.9%
Taylor expanded in z around 0 86.0%
Taylor expanded in t around 0 72.4%
mul-1-neg72.4%
sub-neg72.4%
Simplified72.4%
Taylor expanded in x around 0 72.4%
if -2.2e-167 < z < -3.2999999999999997e-263 or 7.8000000000000001e-255 < z < 1.12e-7Initial program 100.0%
Taylor expanded in t around inf 80.4%
Taylor expanded in z around 0 74.4%
if 1.12e-7 < z Initial program 100.0%
Taylor expanded in y around 0 87.2%
+-commutative87.2%
mul-1-neg87.2%
unsub-neg87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in x around -inf 53.7%
Final simplification65.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))))
(if (<= z -9.2e+113)
(* z (- t))
(if (<= z -2.45e+28)
(* z x)
(if (<= z -8.6e-218)
t_1
(if (<= z -5.4e-258)
(* y t)
(if (<= z 9.2e-8) t_1 (* x (+ z 1.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (z <= -9.2e+113) {
tmp = z * -t;
} else if (z <= -2.45e+28) {
tmp = z * x;
} else if (z <= -8.6e-218) {
tmp = t_1;
} else if (z <= -5.4e-258) {
tmp = y * t;
} else if (z <= 9.2e-8) {
tmp = t_1;
} else {
tmp = x * (z + 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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - y)
if (z <= (-9.2d+113)) then
tmp = z * -t
else if (z <= (-2.45d+28)) then
tmp = z * x
else if (z <= (-8.6d-218)) then
tmp = t_1
else if (z <= (-5.4d-258)) then
tmp = y * t
else if (z <= 9.2d-8) then
tmp = t_1
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (z <= -9.2e+113) {
tmp = z * -t;
} else if (z <= -2.45e+28) {
tmp = z * x;
} else if (z <= -8.6e-218) {
tmp = t_1;
} else if (z <= -5.4e-258) {
tmp = y * t;
} else if (z <= 9.2e-8) {
tmp = t_1;
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) tmp = 0 if z <= -9.2e+113: tmp = z * -t elif z <= -2.45e+28: tmp = z * x elif z <= -8.6e-218: tmp = t_1 elif z <= -5.4e-258: tmp = y * t elif z <= 9.2e-8: tmp = t_1 else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -9.2e+113) tmp = Float64(z * Float64(-t)); elseif (z <= -2.45e+28) tmp = Float64(z * x); elseif (z <= -8.6e-218) tmp = t_1; elseif (z <= -5.4e-258) tmp = Float64(y * t); elseif (z <= 9.2e-8) tmp = t_1; else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); tmp = 0.0; if (z <= -9.2e+113) tmp = z * -t; elseif (z <= -2.45e+28) tmp = z * x; elseif (z <= -8.6e-218) tmp = t_1; elseif (z <= -5.4e-258) tmp = y * t; elseif (z <= 9.2e-8) tmp = t_1; else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+113], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, -2.45e+28], N[(z * x), $MachinePrecision], If[LessEqual[z, -8.6e-218], t$95$1, If[LessEqual[z, -5.4e-258], N[(y * t), $MachinePrecision], If[LessEqual[z, 9.2e-8], t$95$1, N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+113}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{+28}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-258}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if z < -9.19999999999999987e113Initial program 100.0%
Taylor expanded in t around inf 67.4%
Taylor expanded in z around inf 64.7%
mul-1-neg64.7%
distribute-rgt-neg-out64.7%
Simplified64.7%
if -9.19999999999999987e113 < z < -2.4499999999999998e28Initial program 99.9%
Taylor expanded in x around inf 61.1%
*-commutative61.1%
mul-1-neg61.1%
unsub-neg61.1%
distribute-lft-out--61.1%
*-rgt-identity61.1%
Simplified61.1%
Taylor expanded in z around inf 55.7%
if -2.4499999999999998e28 < z < -8.6e-218 or -5.39999999999999991e-258 < z < 9.2000000000000003e-8Initial program 99.9%
Taylor expanded in z around 0 89.2%
Taylor expanded in t around 0 67.5%
mul-1-neg67.5%
sub-neg67.5%
Simplified67.5%
Taylor expanded in x around 0 67.5%
if -8.6e-218 < z < -5.39999999999999991e-258Initial program 100.0%
Taylor expanded in t around inf 90.1%
Taylor expanded in y around inf 80.5%
if 9.2000000000000003e-8 < z Initial program 100.0%
Taylor expanded in y around 0 87.2%
+-commutative87.2%
mul-1-neg87.2%
unsub-neg87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in x around -inf 53.7%
Final simplification63.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))))
(if (<= y -4000000000000.0)
t_1
(if (<= y 27.0)
(* x (+ z 1.0))
(if (<= y 1.7e+124)
(* z (- t))
(if (or (<= y 6e+156) (not (<= y 3.3e+243))) t_1 (* y t)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (y <= -4000000000000.0) {
tmp = t_1;
} else if (y <= 27.0) {
tmp = x * (z + 1.0);
} else if (y <= 1.7e+124) {
tmp = z * -t;
} else if ((y <= 6e+156) || !(y <= 3.3e+243)) {
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 = y * -x
if (y <= (-4000000000000.0d0)) then
tmp = t_1
else if (y <= 27.0d0) then
tmp = x * (z + 1.0d0)
else if (y <= 1.7d+124) then
tmp = z * -t
else if ((y <= 6d+156) .or. (.not. (y <= 3.3d+243))) 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 = y * -x;
double tmp;
if (y <= -4000000000000.0) {
tmp = t_1;
} else if (y <= 27.0) {
tmp = x * (z + 1.0);
} else if (y <= 1.7e+124) {
tmp = z * -t;
} else if ((y <= 6e+156) || !(y <= 3.3e+243)) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * -x tmp = 0 if y <= -4000000000000.0: tmp = t_1 elif y <= 27.0: tmp = x * (z + 1.0) elif y <= 1.7e+124: tmp = z * -t elif (y <= 6e+156) or not (y <= 3.3e+243): tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -4000000000000.0) tmp = t_1; elseif (y <= 27.0) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 1.7e+124) tmp = Float64(z * Float64(-t)); elseif ((y <= 6e+156) || !(y <= 3.3e+243)) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * -x; tmp = 0.0; if (y <= -4000000000000.0) tmp = t_1; elseif (y <= 27.0) tmp = x * (z + 1.0); elseif (y <= 1.7e+124) tmp = z * -t; elseif ((y <= 6e+156) || ~((y <= 3.3e+243))) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -4000000000000.0], t$95$1, If[LessEqual[y, 27.0], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+124], N[(z * (-t)), $MachinePrecision], If[Or[LessEqual[y, 6e+156], N[Not[LessEqual[y, 3.3e+243]], $MachinePrecision]], t$95$1, N[(y * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -4000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 27:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+124}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+156} \lor \neg \left(y \leq 3.3 \cdot 10^{+243}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -4e12 or 1.7e124 < y < 5.9999999999999999e156 or 3.29999999999999994e243 < y Initial program 100.0%
Taylor expanded in z around 0 82.8%
Taylor expanded in t around 0 58.9%
mul-1-neg58.9%
sub-neg58.9%
Simplified58.9%
Taylor expanded in y around inf 58.6%
associate-*r*58.6%
neg-mul-158.6%
*-commutative58.6%
Simplified58.6%
if -4e12 < y < 27Initial program 100.0%
Taylor expanded in y around 0 87.9%
+-commutative87.9%
mul-1-neg87.9%
unsub-neg87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in x around -inf 61.3%
if 27 < y < 1.7e124Initial program 100.0%
Taylor expanded in t around inf 58.2%
Taylor expanded in z around inf 40.9%
mul-1-neg40.9%
distribute-rgt-neg-out40.9%
Simplified40.9%
if 5.9999999999999999e156 < y < 3.29999999999999994e243Initial program 100.0%
Taylor expanded in t around inf 77.4%
Taylor expanded in y around inf 71.3%
Final simplification59.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -3e+113)
t_1
(if (<= z -1.1e+92)
(* z x)
(if (<= z -2.55e+57)
t_1
(if (<= z -5.8e-266) (* y t) (if (<= z 800.0) x (* z x))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -3e+113) {
tmp = t_1;
} else if (z <= -1.1e+92) {
tmp = z * x;
} else if (z <= -2.55e+57) {
tmp = t_1;
} else if (z <= -5.8e-266) {
tmp = y * t;
} else if (z <= 800.0) {
tmp = x;
} 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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (z <= (-3d+113)) then
tmp = t_1
else if (z <= (-1.1d+92)) then
tmp = z * x
else if (z <= (-2.55d+57)) then
tmp = t_1
else if (z <= (-5.8d-266)) then
tmp = y * t
else if (z <= 800.0d0) then
tmp = x
else
tmp = z * x
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 (z <= -3e+113) {
tmp = t_1;
} else if (z <= -1.1e+92) {
tmp = z * x;
} else if (z <= -2.55e+57) {
tmp = t_1;
} else if (z <= -5.8e-266) {
tmp = y * t;
} else if (z <= 800.0) {
tmp = x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -3e+113: tmp = t_1 elif z <= -1.1e+92: tmp = z * x elif z <= -2.55e+57: tmp = t_1 elif z <= -5.8e-266: tmp = y * t elif z <= 800.0: tmp = x else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -3e+113) tmp = t_1; elseif (z <= -1.1e+92) tmp = Float64(z * x); elseif (z <= -2.55e+57) tmp = t_1; elseif (z <= -5.8e-266) tmp = Float64(y * t); elseif (z <= 800.0) tmp = x; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -3e+113) tmp = t_1; elseif (z <= -1.1e+92) tmp = z * x; elseif (z <= -2.55e+57) tmp = t_1; elseif (z <= -5.8e-266) tmp = y * t; elseif (z <= 800.0) tmp = x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -3e+113], t$95$1, If[LessEqual[z, -1.1e+92], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.55e+57], t$95$1, If[LessEqual[z, -5.8e-266], N[(y * t), $MachinePrecision], If[LessEqual[z, 800.0], x, N[(z * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+113}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{+92}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.55 \cdot 10^{+57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-266}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 800:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -3e113 or -1.09999999999999996e92 < z < -2.55000000000000011e57Initial program 100.0%
Taylor expanded in t around inf 69.8%
Taylor expanded in z around inf 67.2%
mul-1-neg67.2%
distribute-rgt-neg-out67.2%
Simplified67.2%
if -3e113 < z < -1.09999999999999996e92 or 800 < z Initial program 100.0%
Taylor expanded in x around inf 58.5%
*-commutative58.5%
mul-1-neg58.5%
unsub-neg58.5%
distribute-lft-out--58.5%
*-rgt-identity58.5%
Simplified58.5%
Taylor expanded in z around inf 55.6%
if -2.55000000000000011e57 < z < -5.79999999999999991e-266Initial program 99.9%
Taylor expanded in t around inf 68.1%
Taylor expanded in y around inf 37.6%
if -5.79999999999999991e-266 < z < 800Initial program 99.9%
Taylor expanded in t around inf 77.1%
Taylor expanded in x around inf 46.3%
Final simplification49.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -7.5e+115)
(* z (- t))
(if (<= z -3.2e+29)
(* z x)
(if (<= z -1.45e-167)
(* y (- x))
(if (<= z -9e-267) (* y t) (if (<= z 800.0) x (* z x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.5e+115) {
tmp = z * -t;
} else if (z <= -3.2e+29) {
tmp = z * x;
} else if (z <= -1.45e-167) {
tmp = y * -x;
} else if (z <= -9e-267) {
tmp = y * t;
} else if (z <= 800.0) {
tmp = x;
} 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 <= (-7.5d+115)) then
tmp = z * -t
else if (z <= (-3.2d+29)) then
tmp = z * x
else if (z <= (-1.45d-167)) then
tmp = y * -x
else if (z <= (-9d-267)) then
tmp = y * t
else if (z <= 800.0d0) then
tmp = x
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 <= -7.5e+115) {
tmp = z * -t;
} else if (z <= -3.2e+29) {
tmp = z * x;
} else if (z <= -1.45e-167) {
tmp = y * -x;
} else if (z <= -9e-267) {
tmp = y * t;
} else if (z <= 800.0) {
tmp = x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.5e+115: tmp = z * -t elif z <= -3.2e+29: tmp = z * x elif z <= -1.45e-167: tmp = y * -x elif z <= -9e-267: tmp = y * t elif z <= 800.0: tmp = x else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.5e+115) tmp = Float64(z * Float64(-t)); elseif (z <= -3.2e+29) tmp = Float64(z * x); elseif (z <= -1.45e-167) tmp = Float64(y * Float64(-x)); elseif (z <= -9e-267) tmp = Float64(y * t); elseif (z <= 800.0) tmp = x; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.5e+115) tmp = z * -t; elseif (z <= -3.2e+29) tmp = z * x; elseif (z <= -1.45e-167) tmp = y * -x; elseif (z <= -9e-267) tmp = y * t; elseif (z <= 800.0) tmp = x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.5e+115], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, -3.2e+29], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.45e-167], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -9e-267], N[(y * t), $MachinePrecision], If[LessEqual[z, 800.0], x, N[(z * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+115}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+29}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-167}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-267}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 800:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -7.4999999999999997e115Initial program 100.0%
Taylor expanded in t around inf 67.4%
Taylor expanded in z around inf 64.7%
mul-1-neg64.7%
distribute-rgt-neg-out64.7%
Simplified64.7%
if -7.4999999999999997e115 < z < -3.19999999999999987e29 or 800 < z Initial program 100.0%
Taylor expanded in x around inf 56.4%
*-commutative56.4%
mul-1-neg56.4%
unsub-neg56.4%
distribute-lft-out--56.4%
*-rgt-identity56.4%
Simplified56.4%
Taylor expanded in z around inf 53.8%
if -3.19999999999999987e29 < z < -1.45000000000000001e-167Initial program 99.9%
Taylor expanded in z around 0 79.7%
Taylor expanded in t around 0 65.7%
mul-1-neg65.7%
sub-neg65.7%
Simplified65.7%
Taylor expanded in y around inf 39.8%
associate-*r*39.8%
neg-mul-139.8%
*-commutative39.8%
Simplified39.8%
if -1.45000000000000001e-167 < z < -8.9999999999999999e-267Initial program 100.0%
Taylor expanded in t around inf 71.8%
Taylor expanded in y around inf 56.9%
if -8.9999999999999999e-267 < z < 800Initial program 99.9%
Taylor expanded in t around inf 77.1%
Taylor expanded in x around inf 46.3%
Final simplification51.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* z t))))
(if (<= t -7.2e+254)
(* y t)
(if (<= t -9e+112)
t_1
(if (<= t 1.2e+31)
(* x (- (+ z 1.0) y))
(if (<= t 1.55e+226) (+ x (* y t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (z * t);
double tmp;
if (t <= -7.2e+254) {
tmp = y * t;
} else if (t <= -9e+112) {
tmp = t_1;
} else if (t <= 1.2e+31) {
tmp = x * ((z + 1.0) - y);
} else if (t <= 1.55e+226) {
tmp = x + (y * 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 = x - (z * t)
if (t <= (-7.2d+254)) then
tmp = y * t
else if (t <= (-9d+112)) then
tmp = t_1
else if (t <= 1.2d+31) then
tmp = x * ((z + 1.0d0) - y)
else if (t <= 1.55d+226) then
tmp = x + (y * 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 = x - (z * t);
double tmp;
if (t <= -7.2e+254) {
tmp = y * t;
} else if (t <= -9e+112) {
tmp = t_1;
} else if (t <= 1.2e+31) {
tmp = x * ((z + 1.0) - y);
} else if (t <= 1.55e+226) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (z * t) tmp = 0 if t <= -7.2e+254: tmp = y * t elif t <= -9e+112: tmp = t_1 elif t <= 1.2e+31: tmp = x * ((z + 1.0) - y) elif t <= 1.55e+226: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(z * t)) tmp = 0.0 if (t <= -7.2e+254) tmp = Float64(y * t); elseif (t <= -9e+112) tmp = t_1; elseif (t <= 1.2e+31) tmp = Float64(x * Float64(Float64(z + 1.0) - y)); elseif (t <= 1.55e+226) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (z * t); tmp = 0.0; if (t <= -7.2e+254) tmp = y * t; elseif (t <= -9e+112) tmp = t_1; elseif (t <= 1.2e+31) tmp = x * ((z + 1.0) - y); elseif (t <= 1.55e+226) tmp = x + (y * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.2e+254], N[(y * t), $MachinePrecision], If[LessEqual[t, -9e+112], t$95$1, If[LessEqual[t, 1.2e+31], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+226], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{+254}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;t \leq -9 \cdot 10^{+112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+226}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7.19999999999999954e254Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in y around inf 82.4%
if -7.19999999999999954e254 < t < -8.9999999999999998e112 or 1.54999999999999988e226 < t Initial program 100.0%
Taylor expanded in y around 0 79.3%
+-commutative79.3%
mul-1-neg79.3%
unsub-neg79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in t around inf 76.2%
*-commutative76.2%
Simplified76.2%
if -8.9999999999999998e112 < t < 1.19999999999999991e31Initial program 100.0%
Taylor expanded in x around inf 72.9%
*-commutative72.9%
mul-1-neg72.9%
unsub-neg72.9%
distribute-lft-out--72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in x around 0 72.9%
if 1.19999999999999991e31 < t < 1.54999999999999988e226Initial program 100.0%
Taylor expanded in t around inf 83.1%
Taylor expanded in z around 0 61.0%
Final simplification72.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.5e+19) (not (<= x 1.28e+188))) (* x (- (+ z 1.0) y)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.5e+19) || !(x <= 1.28e+188)) {
tmp = x * ((z + 1.0) - y);
} 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 <= (-5.5d+19)) .or. (.not. (x <= 1.28d+188))) then
tmp = x * ((z + 1.0d0) - y)
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 <= -5.5e+19) || !(x <= 1.28e+188)) {
tmp = x * ((z + 1.0) - y);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.5e+19) or not (x <= 1.28e+188): tmp = x * ((z + 1.0) - y) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.5e+19) || !(x <= 1.28e+188)) tmp = Float64(x * Float64(Float64(z + 1.0) - y)); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.5e+19) || ~((x <= 1.28e+188))) tmp = x * ((z + 1.0) - y); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.5e+19], N[Not[LessEqual[x, 1.28e+188]], $MachinePrecision]], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+19} \lor \neg \left(x \leq 1.28 \cdot 10^{+188}\right):\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -5.5e19 or 1.27999999999999997e188 < x Initial program 100.0%
Taylor expanded in x around inf 95.8%
*-commutative95.8%
mul-1-neg95.8%
unsub-neg95.8%
distribute-lft-out--95.8%
*-rgt-identity95.8%
Simplified95.8%
Taylor expanded in x around 0 95.8%
if -5.5e19 < x < 1.27999999999999997e188Initial program 100.0%
Taylor expanded in t around inf 79.7%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.95e+29) (not (<= z 1.15e-7))) (+ x (* z (- x t))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e+29) || !(z <= 1.15e-7)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - 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.95d+29)) .or. (.not. (z <= 1.15d-7))) then
tmp = x + (z * (x - t))
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.95e+29) || !(z <= 1.15e-7)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.95e+29) or not (z <= 1.15e-7): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.95e+29) || !(z <= 1.15e-7)) tmp = Float64(x + Float64(z * Float64(x - t))); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.95e+29) || ~((z <= 1.15e-7))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.95e+29], N[Not[LessEqual[z, 1.15e-7]], $MachinePrecision]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+29} \lor \neg \left(z \leq 1.15 \cdot 10^{-7}\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -1.94999999999999984e29 or 1.14999999999999997e-7 < z Initial program 100.0%
Taylor expanded in y around 0 85.3%
+-commutative85.3%
mul-1-neg85.3%
unsub-neg85.3%
*-commutative85.3%
Simplified85.3%
if -1.94999999999999984e29 < z < 1.14999999999999997e-7Initial program 99.9%
Taylor expanded in z around 0 90.1%
Final simplification87.7%
(FPCore (x y z t) :precision binary64 (if (<= x -4.8e+19) (* x (- (+ z 1.0) y)) (if (<= x 1.28e+188) (+ x (* (- y z) t)) (+ x (* x (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.8e+19) {
tmp = x * ((z + 1.0) - y);
} else if (x <= 1.28e+188) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-4.8d+19)) then
tmp = x * ((z + 1.0d0) - y)
else if (x <= 1.28d+188) then
tmp = x + ((y - z) * t)
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.8e+19) {
tmp = x * ((z + 1.0) - y);
} else if (x <= 1.28e+188) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.8e+19: tmp = x * ((z + 1.0) - y) elif x <= 1.28e+188: tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.8e+19) tmp = Float64(x * Float64(Float64(z + 1.0) - y)); elseif (x <= 1.28e+188) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.8e+19) tmp = x * ((z + 1.0) - y); elseif (x <= 1.28e+188) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.8e+19], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.28e+188], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{elif}\;x \leq 1.28 \cdot 10^{+188}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if x < -4.8e19Initial program 100.0%
Taylor expanded in x around inf 94.4%
*-commutative94.4%
mul-1-neg94.4%
unsub-neg94.4%
distribute-lft-out--94.4%
*-rgt-identity94.4%
Simplified94.4%
Taylor expanded in x around 0 94.4%
if -4.8e19 < x < 1.27999999999999997e188Initial program 100.0%
Taylor expanded in t around inf 79.7%
if 1.27999999999999997e188 < x Initial program 100.0%
Taylor expanded in x around inf 99.9%
*-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
distribute-lft-out--100.0%
*-rgt-identity100.0%
Simplified100.0%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (if (<= z -8.2e+93) (* z x) (if (<= z -9.5e-268) (* y t) (if (<= z 800.0) x (* z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.2e+93) {
tmp = z * x;
} else if (z <= -9.5e-268) {
tmp = y * t;
} else if (z <= 800.0) {
tmp = x;
} 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 <= (-8.2d+93)) then
tmp = z * x
else if (z <= (-9.5d-268)) then
tmp = y * t
else if (z <= 800.0d0) then
tmp = x
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 <= -8.2e+93) {
tmp = z * x;
} else if (z <= -9.5e-268) {
tmp = y * t;
} else if (z <= 800.0) {
tmp = x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.2e+93: tmp = z * x elif z <= -9.5e-268: tmp = y * t elif z <= 800.0: tmp = x else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.2e+93) tmp = Float64(z * x); elseif (z <= -9.5e-268) tmp = Float64(y * t); elseif (z <= 800.0) tmp = x; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.2e+93) tmp = z * x; elseif (z <= -9.5e-268) tmp = y * t; elseif (z <= 800.0) tmp = x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.2e+93], N[(z * x), $MachinePrecision], If[LessEqual[z, -9.5e-268], N[(y * t), $MachinePrecision], If[LessEqual[z, 800.0], x, N[(z * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+93}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-268}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 800:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -8.2000000000000002e93 or 800 < z Initial program 100.0%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
mul-1-neg52.7%
unsub-neg52.7%
distribute-lft-out--52.7%
*-rgt-identity52.7%
Simplified52.7%
Taylor expanded in z around inf 46.4%
if -8.2000000000000002e93 < z < -9.50000000000000007e-268Initial program 99.9%
Taylor expanded in t around inf 68.9%
Taylor expanded in y around inf 39.0%
if -9.50000000000000007e-268 < z < 800Initial program 99.9%
Taylor expanded in t around inf 77.1%
Taylor expanded in x around inf 46.3%
Final simplification44.0%
(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 -8e-15) (* y t) (if (<= y 3.2e-60) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8e-15) {
tmp = y * t;
} else if (y <= 3.2e-60) {
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 <= (-8d-15)) then
tmp = y * t
else if (y <= 3.2d-60) 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 <= -8e-15) {
tmp = y * t;
} else if (y <= 3.2e-60) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8e-15: tmp = y * t elif y <= 3.2e-60: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8e-15) tmp = Float64(y * t); elseif (y <= 3.2e-60) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8e-15) tmp = y * t; elseif (y <= 3.2e-60) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8e-15], N[(y * t), $MachinePrecision], If[LessEqual[y, 3.2e-60], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-15}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-60}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -8.0000000000000006e-15 or 3.2000000000000001e-60 < y Initial program 100.0%
Taylor expanded in t around inf 58.2%
Taylor expanded in y around inf 40.8%
if -8.0000000000000006e-15 < y < 3.2000000000000001e-60Initial program 100.0%
Taylor expanded in t around inf 74.1%
Taylor expanded in x around inf 36.1%
Final simplification38.7%
(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 t around inf 65.3%
Taylor expanded in x around inf 19.4%
Final simplification19.4%
(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 2023223
(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))))