
(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 (* z (- t))))
(if (<= z -4.8e+268)
t_1
(if (<= z -1.38e+131)
(* z x)
(if (<= z -1.1e-26)
t_1
(if (<= z -3.8e-39)
(* y (- x))
(if (<= z -8e-42)
t_1
(if (<= z 3.9e-115)
(* y t)
(if (<= z 5.2e-43) x (if (<= z 1.36e+247) t_1 (* z x)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -4.8e+268) {
tmp = t_1;
} else if (z <= -1.38e+131) {
tmp = z * x;
} else if (z <= -1.1e-26) {
tmp = t_1;
} else if (z <= -3.8e-39) {
tmp = y * -x;
} else if (z <= -8e-42) {
tmp = t_1;
} else if (z <= 3.9e-115) {
tmp = y * t;
} else if (z <= 5.2e-43) {
tmp = x;
} else if (z <= 1.36e+247) {
tmp = t_1;
} 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 <= (-4.8d+268)) then
tmp = t_1
else if (z <= (-1.38d+131)) then
tmp = z * x
else if (z <= (-1.1d-26)) then
tmp = t_1
else if (z <= (-3.8d-39)) then
tmp = y * -x
else if (z <= (-8d-42)) then
tmp = t_1
else if (z <= 3.9d-115) then
tmp = y * t
else if (z <= 5.2d-43) then
tmp = x
else if (z <= 1.36d+247) then
tmp = t_1
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 <= -4.8e+268) {
tmp = t_1;
} else if (z <= -1.38e+131) {
tmp = z * x;
} else if (z <= -1.1e-26) {
tmp = t_1;
} else if (z <= -3.8e-39) {
tmp = y * -x;
} else if (z <= -8e-42) {
tmp = t_1;
} else if (z <= 3.9e-115) {
tmp = y * t;
} else if (z <= 5.2e-43) {
tmp = x;
} else if (z <= 1.36e+247) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -4.8e+268: tmp = t_1 elif z <= -1.38e+131: tmp = z * x elif z <= -1.1e-26: tmp = t_1 elif z <= -3.8e-39: tmp = y * -x elif z <= -8e-42: tmp = t_1 elif z <= 3.9e-115: tmp = y * t elif z <= 5.2e-43: tmp = x elif z <= 1.36e+247: tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -4.8e+268) tmp = t_1; elseif (z <= -1.38e+131) tmp = Float64(z * x); elseif (z <= -1.1e-26) tmp = t_1; elseif (z <= -3.8e-39) tmp = Float64(y * Float64(-x)); elseif (z <= -8e-42) tmp = t_1; elseif (z <= 3.9e-115) tmp = Float64(y * t); elseif (z <= 5.2e-43) tmp = x; elseif (z <= 1.36e+247) tmp = t_1; 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 <= -4.8e+268) tmp = t_1; elseif (z <= -1.38e+131) tmp = z * x; elseif (z <= -1.1e-26) tmp = t_1; elseif (z <= -3.8e-39) tmp = y * -x; elseif (z <= -8e-42) tmp = t_1; elseif (z <= 3.9e-115) tmp = y * t; elseif (z <= 5.2e-43) tmp = x; elseif (z <= 1.36e+247) tmp = t_1; 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, -4.8e+268], t$95$1, If[LessEqual[z, -1.38e+131], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.1e-26], t$95$1, If[LessEqual[z, -3.8e-39], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -8e-42], t$95$1, If[LessEqual[z, 3.9e-115], N[(y * t), $MachinePrecision], If[LessEqual[z, 5.2e-43], x, If[LessEqual[z, 1.36e+247], t$95$1, N[(z * x), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.38 \cdot 10^{+131}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-39}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-115}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{+247}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -4.7999999999999999e268 or -1.38e131 < z < -1.1e-26 or -3.8000000000000002e-39 < z < -8.0000000000000003e-42 or 5.2e-43 < z < 1.35999999999999995e247Initial program 99.9%
Taylor expanded in t around inf 64.2%
Taylor expanded in z around inf 45.8%
mul-1-neg45.8%
distribute-rgt-neg-out45.8%
Simplified45.8%
if -4.7999999999999999e268 < z < -1.38e131 or 1.35999999999999995e247 < z Initial program 100.0%
Taylor expanded in x around inf 70.5%
*-commutative70.5%
mul-1-neg70.5%
unsub-neg70.5%
distribute-lft-out--70.5%
*-rgt-identity70.5%
Simplified70.5%
Taylor expanded in z around inf 64.8%
if -1.1e-26 < z < -3.8000000000000002e-39Initial program 100.0%
Taylor expanded in x around inf 94.3%
*-commutative94.3%
mul-1-neg94.3%
unsub-neg94.3%
distribute-lft-out--94.3%
*-rgt-identity94.3%
Simplified94.3%
Taylor expanded in z around 0 94.3%
Taylor expanded in y around inf 87.9%
mul-1-neg87.9%
distribute-rgt-neg-in87.9%
Simplified87.9%
if -8.0000000000000003e-42 < z < 3.8999999999999998e-115Initial program 100.0%
Taylor expanded in t around inf 74.3%
Taylor expanded in y around inf 50.7%
if 3.8999999999999998e-115 < z < 5.2e-43Initial program 100.0%
Taylor expanded in t around inf 80.4%
Taylor expanded in x around inf 46.6%
Final simplification51.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* y x))) (t_2 (* z (- t))))
(if (<= z -3e+267)
t_2
(if (<= z -1.04e+130)
(* z x)
(if (<= z -5.2e-23)
t_2
(if (<= z -1.02e-36)
t_1
(if (<= z 2.15e-198)
(+ x (* y t))
(if (<= z 3.1e+56) t_1 (if (<= z 6.2e+243) t_2 (* z x))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y * x);
double t_2 = z * -t;
double tmp;
if (z <= -3e+267) {
tmp = t_2;
} else if (z <= -1.04e+130) {
tmp = z * x;
} else if (z <= -5.2e-23) {
tmp = t_2;
} else if (z <= -1.02e-36) {
tmp = t_1;
} else if (z <= 2.15e-198) {
tmp = x + (y * t);
} else if (z <= 3.1e+56) {
tmp = t_1;
} else if (z <= 6.2e+243) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x - (y * x)
t_2 = z * -t
if (z <= (-3d+267)) then
tmp = t_2
else if (z <= (-1.04d+130)) then
tmp = z * x
else if (z <= (-5.2d-23)) then
tmp = t_2
else if (z <= (-1.02d-36)) then
tmp = t_1
else if (z <= 2.15d-198) then
tmp = x + (y * t)
else if (z <= 3.1d+56) then
tmp = t_1
else if (z <= 6.2d+243) then
tmp = t_2
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 = x - (y * x);
double t_2 = z * -t;
double tmp;
if (z <= -3e+267) {
tmp = t_2;
} else if (z <= -1.04e+130) {
tmp = z * x;
} else if (z <= -5.2e-23) {
tmp = t_2;
} else if (z <= -1.02e-36) {
tmp = t_1;
} else if (z <= 2.15e-198) {
tmp = x + (y * t);
} else if (z <= 3.1e+56) {
tmp = t_1;
} else if (z <= 6.2e+243) {
tmp = t_2;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y * x) t_2 = z * -t tmp = 0 if z <= -3e+267: tmp = t_2 elif z <= -1.04e+130: tmp = z * x elif z <= -5.2e-23: tmp = t_2 elif z <= -1.02e-36: tmp = t_1 elif z <= 2.15e-198: tmp = x + (y * t) elif z <= 3.1e+56: tmp = t_1 elif z <= 6.2e+243: tmp = t_2 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y * x)) t_2 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -3e+267) tmp = t_2; elseif (z <= -1.04e+130) tmp = Float64(z * x); elseif (z <= -5.2e-23) tmp = t_2; elseif (z <= -1.02e-36) tmp = t_1; elseif (z <= 2.15e-198) tmp = Float64(x + Float64(y * t)); elseif (z <= 3.1e+56) tmp = t_1; elseif (z <= 6.2e+243) tmp = t_2; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y * x); t_2 = z * -t; tmp = 0.0; if (z <= -3e+267) tmp = t_2; elseif (z <= -1.04e+130) tmp = z * x; elseif (z <= -5.2e-23) tmp = t_2; elseif (z <= -1.02e-36) tmp = t_1; elseif (z <= 2.15e-198) tmp = x + (y * t); elseif (z <= 3.1e+56) tmp = t_1; elseif (z <= 6.2e+243) tmp = t_2; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -3e+267], t$95$2, If[LessEqual[z, -1.04e+130], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.2e-23], t$95$2, If[LessEqual[z, -1.02e-36], t$95$1, If[LessEqual[z, 2.15e-198], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+56], t$95$1, If[LessEqual[z, 6.2e+243], t$95$2, N[(z * x), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot x\\
t_2 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+267}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.04 \cdot 10^{+130}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-23}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-198}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+243}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -2.9999999999999999e267 or -1.04000000000000005e130 < z < -5.2e-23 or 3.10000000000000005e56 < z < 6.2e243Initial program 99.9%
Taylor expanded in t around inf 66.2%
Taylor expanded in z around inf 50.7%
mul-1-neg50.7%
distribute-rgt-neg-out50.7%
Simplified50.7%
if -2.9999999999999999e267 < z < -1.04000000000000005e130 or 6.2e243 < z Initial program 100.0%
Taylor expanded in x around inf 70.5%
*-commutative70.5%
mul-1-neg70.5%
unsub-neg70.5%
distribute-lft-out--70.5%
*-rgt-identity70.5%
Simplified70.5%
Taylor expanded in z around inf 64.8%
if -5.2e-23 < z < -1.02e-36 or 2.1500000000000002e-198 < z < 3.10000000000000005e56Initial program 99.9%
Taylor expanded in z around 0 81.5%
Taylor expanded in t around 0 66.1%
mul-1-neg66.1%
sub-neg66.1%
Simplified66.1%
if -1.02e-36 < z < 2.1500000000000002e-198Initial program 100.0%
Taylor expanded in t around inf 75.5%
Taylor expanded in z around 0 70.5%
Final simplification62.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z 1.0))))
(if (<= x -3.3e-24)
t_1
(if (<= x -3.3e-205)
(* y t)
(if (<= x -1.95e-285)
(* z (- t))
(if (<= x 1.05e-131)
(* y t)
(if (or (<= x 2e+112) (not (<= x 8e+238))) t_1 (* y (- x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double tmp;
if (x <= -3.3e-24) {
tmp = t_1;
} else if (x <= -3.3e-205) {
tmp = y * t;
} else if (x <= -1.95e-285) {
tmp = z * -t;
} else if (x <= 1.05e-131) {
tmp = y * t;
} else if ((x <= 2e+112) || !(x <= 8e+238)) {
tmp = t_1;
} else {
tmp = y * -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 = x * (z + 1.0d0)
if (x <= (-3.3d-24)) then
tmp = t_1
else if (x <= (-3.3d-205)) then
tmp = y * t
else if (x <= (-1.95d-285)) then
tmp = z * -t
else if (x <= 1.05d-131) then
tmp = y * t
else if ((x <= 2d+112) .or. (.not. (x <= 8d+238))) then
tmp = t_1
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double tmp;
if (x <= -3.3e-24) {
tmp = t_1;
} else if (x <= -3.3e-205) {
tmp = y * t;
} else if (x <= -1.95e-285) {
tmp = z * -t;
} else if (x <= 1.05e-131) {
tmp = y * t;
} else if ((x <= 2e+112) || !(x <= 8e+238)) {
tmp = t_1;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + 1.0) tmp = 0 if x <= -3.3e-24: tmp = t_1 elif x <= -3.3e-205: tmp = y * t elif x <= -1.95e-285: tmp = z * -t elif x <= 1.05e-131: tmp = y * t elif (x <= 2e+112) or not (x <= 8e+238): tmp = t_1 else: tmp = y * -x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (x <= -3.3e-24) tmp = t_1; elseif (x <= -3.3e-205) tmp = Float64(y * t); elseif (x <= -1.95e-285) tmp = Float64(z * Float64(-t)); elseif (x <= 1.05e-131) tmp = Float64(y * t); elseif ((x <= 2e+112) || !(x <= 8e+238)) tmp = t_1; else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + 1.0); tmp = 0.0; if (x <= -3.3e-24) tmp = t_1; elseif (x <= -3.3e-205) tmp = y * t; elseif (x <= -1.95e-285) tmp = z * -t; elseif (x <= 1.05e-131) tmp = y * t; elseif ((x <= 2e+112) || ~((x <= 8e+238))) tmp = t_1; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.3e-24], t$95$1, If[LessEqual[x, -3.3e-205], N[(y * t), $MachinePrecision], If[LessEqual[x, -1.95e-285], N[(z * (-t)), $MachinePrecision], If[LessEqual[x, 1.05e-131], N[(y * t), $MachinePrecision], If[Or[LessEqual[x, 2e+112], N[Not[LessEqual[x, 8e+238]], $MachinePrecision]], t$95$1, N[(y * (-x)), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;x \leq -3.3 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-205}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-285}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-131}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+112} \lor \neg \left(x \leq 8 \cdot 10^{+238}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -3.29999999999999984e-24 or 1.04999999999999999e-131 < x < 1.9999999999999999e112 or 8.0000000000000004e238 < x Initial program 100.0%
Taylor expanded in y around 0 67.0%
+-commutative67.0%
mul-1-neg67.0%
unsub-neg67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in x around -inf 48.8%
if -3.29999999999999984e-24 < x < -3.2999999999999999e-205 or -1.94999999999999993e-285 < x < 1.04999999999999999e-131Initial program 100.0%
Taylor expanded in t around inf 86.8%
Taylor expanded in y around inf 57.6%
if -3.2999999999999999e-205 < x < -1.94999999999999993e-285Initial program 100.0%
Taylor expanded in t around inf 91.0%
Taylor expanded in z around inf 63.2%
mul-1-neg63.2%
distribute-rgt-neg-out63.2%
Simplified63.2%
if 1.9999999999999999e112 < x < 8.0000000000000004e238Initial program 99.9%
Taylor expanded in x around inf 88.7%
*-commutative88.7%
mul-1-neg88.7%
unsub-neg88.7%
distribute-lft-out--88.6%
*-rgt-identity88.6%
Simplified88.6%
Taylor expanded in z around 0 88.6%
Taylor expanded in y around inf 66.2%
mul-1-neg66.2%
distribute-rgt-neg-in66.2%
Simplified66.2%
Final simplification54.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -8e+271)
t_1
(if (<= z -1.22e+129)
(* z x)
(if (<= z -5.8e-41)
t_1
(if (<= z 2.2e-113)
(* y t)
(if (<= z 9e-43) x (if (<= z 4e+247) t_1 (* z x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -8e+271) {
tmp = t_1;
} else if (z <= -1.22e+129) {
tmp = z * x;
} else if (z <= -5.8e-41) {
tmp = t_1;
} else if (z <= 2.2e-113) {
tmp = y * t;
} else if (z <= 9e-43) {
tmp = x;
} else if (z <= 4e+247) {
tmp = t_1;
} 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 <= (-8d+271)) then
tmp = t_1
else if (z <= (-1.22d+129)) then
tmp = z * x
else if (z <= (-5.8d-41)) then
tmp = t_1
else if (z <= 2.2d-113) then
tmp = y * t
else if (z <= 9d-43) then
tmp = x
else if (z <= 4d+247) then
tmp = t_1
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 <= -8e+271) {
tmp = t_1;
} else if (z <= -1.22e+129) {
tmp = z * x;
} else if (z <= -5.8e-41) {
tmp = t_1;
} else if (z <= 2.2e-113) {
tmp = y * t;
} else if (z <= 9e-43) {
tmp = x;
} else if (z <= 4e+247) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -8e+271: tmp = t_1 elif z <= -1.22e+129: tmp = z * x elif z <= -5.8e-41: tmp = t_1 elif z <= 2.2e-113: tmp = y * t elif z <= 9e-43: tmp = x elif z <= 4e+247: tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -8e+271) tmp = t_1; elseif (z <= -1.22e+129) tmp = Float64(z * x); elseif (z <= -5.8e-41) tmp = t_1; elseif (z <= 2.2e-113) tmp = Float64(y * t); elseif (z <= 9e-43) tmp = x; elseif (z <= 4e+247) tmp = t_1; 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 <= -8e+271) tmp = t_1; elseif (z <= -1.22e+129) tmp = z * x; elseif (z <= -5.8e-41) tmp = t_1; elseif (z <= 2.2e-113) tmp = y * t; elseif (z <= 9e-43) tmp = x; elseif (z <= 4e+247) tmp = t_1; 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, -8e+271], t$95$1, If[LessEqual[z, -1.22e+129], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.8e-41], t$95$1, If[LessEqual[z, 2.2e-113], N[(y * t), $MachinePrecision], If[LessEqual[z, 9e-43], x, If[LessEqual[z, 4e+247], t$95$1, N[(z * x), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{+271}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{+129}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-113}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+247}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -7.99999999999999962e271 or -1.2200000000000001e129 < z < -5.79999999999999955e-41 or 9.0000000000000005e-43 < z < 3.99999999999999981e247Initial program 99.9%
Taylor expanded in t around inf 61.4%
Taylor expanded in z around inf 43.7%
mul-1-neg43.7%
distribute-rgt-neg-out43.7%
Simplified43.7%
if -7.99999999999999962e271 < z < -1.2200000000000001e129 or 3.99999999999999981e247 < z Initial program 100.0%
Taylor expanded in x around inf 70.5%
*-commutative70.5%
mul-1-neg70.5%
unsub-neg70.5%
distribute-lft-out--70.5%
*-rgt-identity70.5%
Simplified70.5%
Taylor expanded in z around inf 64.8%
if -5.79999999999999955e-41 < z < 2.20000000000000004e-113Initial program 100.0%
Taylor expanded in t around inf 74.3%
Taylor expanded in y around inf 50.7%
if 2.20000000000000004e-113 < z < 9.0000000000000005e-43Initial program 100.0%
Taylor expanded in t around inf 80.4%
Taylor expanded in x around inf 46.6%
Final simplification49.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -8.5e+266)
t_1
(if (<= z -3.5e+131)
(* z x)
(if (<= z -7.2e-24)
t_1
(if (<= z 145000.0) (+ x (* y t)) (* x (+ z 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -8.5e+266) {
tmp = t_1;
} else if (z <= -3.5e+131) {
tmp = z * x;
} else if (z <= -7.2e-24) {
tmp = t_1;
} else if (z <= 145000.0) {
tmp = x + (y * t);
} 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 = z * -t
if (z <= (-8.5d+266)) then
tmp = t_1
else if (z <= (-3.5d+131)) then
tmp = z * x
else if (z <= (-7.2d-24)) then
tmp = t_1
else if (z <= 145000.0d0) then
tmp = x + (y * t)
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 = z * -t;
double tmp;
if (z <= -8.5e+266) {
tmp = t_1;
} else if (z <= -3.5e+131) {
tmp = z * x;
} else if (z <= -7.2e-24) {
tmp = t_1;
} else if (z <= 145000.0) {
tmp = x + (y * t);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -8.5e+266: tmp = t_1 elif z <= -3.5e+131: tmp = z * x elif z <= -7.2e-24: tmp = t_1 elif z <= 145000.0: tmp = x + (y * t) else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -8.5e+266) tmp = t_1; elseif (z <= -3.5e+131) tmp = Float64(z * x); elseif (z <= -7.2e-24) tmp = t_1; elseif (z <= 145000.0) tmp = Float64(x + Float64(y * t)); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -8.5e+266) tmp = t_1; elseif (z <= -3.5e+131) tmp = z * x; elseif (z <= -7.2e-24) tmp = t_1; elseif (z <= 145000.0) tmp = x + (y * t); else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -8.5e+266], t$95$1, If[LessEqual[z, -3.5e+131], N[(z * x), $MachinePrecision], If[LessEqual[z, -7.2e-24], t$95$1, If[LessEqual[z, 145000.0], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+266}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+131}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 145000:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if z < -8.49999999999999955e266 or -3.4999999999999999e131 < z < -7.2000000000000002e-24Initial program 99.9%
Taylor expanded in t around inf 70.1%
Taylor expanded in z around inf 50.1%
mul-1-neg50.1%
distribute-rgt-neg-out50.1%
Simplified50.1%
if -8.49999999999999955e266 < z < -3.4999999999999999e131Initial program 100.0%
Taylor expanded in x around inf 65.4%
*-commutative65.4%
mul-1-neg65.4%
unsub-neg65.4%
distribute-lft-out--65.4%
*-rgt-identity65.4%
Simplified65.4%
Taylor expanded in z around inf 58.2%
if -7.2000000000000002e-24 < z < 145000Initial program 100.0%
Taylor expanded in t around inf 72.4%
Taylor expanded in z around 0 64.5%
if 145000 < z Initial program 99.9%
Taylor expanded in y around 0 82.5%
+-commutative82.5%
mul-1-neg82.5%
unsub-neg82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in x around -inf 47.1%
Final simplification57.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (* t (- z y)))))
(if (<= t -3.5e-107)
t_1
(if (<= t 3.3e-149)
(- x (* y x))
(if (<= t 1.16e-64) (* x (+ z 1.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x - (t * (z - y));
double tmp;
if (t <= -3.5e-107) {
tmp = t_1;
} else if (t <= 3.3e-149) {
tmp = x - (y * x);
} else if (t <= 1.16e-64) {
tmp = x * (z + 1.0);
} 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 - (t * (z - y))
if (t <= (-3.5d-107)) then
tmp = t_1
else if (t <= 3.3d-149) then
tmp = x - (y * x)
else if (t <= 1.16d-64) then
tmp = x * (z + 1.0d0)
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 - (t * (z - y));
double tmp;
if (t <= -3.5e-107) {
tmp = t_1;
} else if (t <= 3.3e-149) {
tmp = x - (y * x);
} else if (t <= 1.16e-64) {
tmp = x * (z + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (t * (z - y)) tmp = 0 if t <= -3.5e-107: tmp = t_1 elif t <= 3.3e-149: tmp = x - (y * x) elif t <= 1.16e-64: tmp = x * (z + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(t * Float64(z - y))) tmp = 0.0 if (t <= -3.5e-107) tmp = t_1; elseif (t <= 3.3e-149) tmp = Float64(x - Float64(y * x)); elseif (t <= 1.16e-64) tmp = Float64(x * Float64(z + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (t * (z - y)); tmp = 0.0; if (t <= -3.5e-107) tmp = t_1; elseif (t <= 3.3e-149) tmp = x - (y * x); elseif (t <= 1.16e-64) tmp = x * (z + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e-107], t$95$1, If[LessEqual[t, 3.3e-149], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e-64], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \left(z - y\right)\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-149}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{-64}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.49999999999999985e-107 or 1.15999999999999992e-64 < t Initial program 100.0%
Taylor expanded in t around inf 81.1%
if -3.49999999999999985e-107 < t < 3.30000000000000017e-149Initial program 100.0%
Taylor expanded in z around 0 71.6%
Taylor expanded in t around 0 59.5%
mul-1-neg59.5%
sub-neg59.5%
Simplified59.5%
if 3.30000000000000017e-149 < t < 1.15999999999999992e-64Initial program 99.9%
Taylor expanded in y around 0 82.6%
+-commutative82.6%
mul-1-neg82.6%
unsub-neg82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in x around -inf 72.9%
Final simplification74.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y t))))
(if (<= y -1.35e+48)
t_1
(if (<= y 3.2e-70)
(- x (* z t))
(if (<= y 2.9e+36) t_1 (if (<= y 3.6e+121) (* y (- x)) (* y t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double tmp;
if (y <= -1.35e+48) {
tmp = t_1;
} else if (y <= 3.2e-70) {
tmp = x - (z * t);
} else if (y <= 2.9e+36) {
tmp = t_1;
} else if (y <= 3.6e+121) {
tmp = y * -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) :: t_1
real(8) :: tmp
t_1 = x + (y * t)
if (y <= (-1.35d+48)) then
tmp = t_1
else if (y <= 3.2d-70) then
tmp = x - (z * t)
else if (y <= 2.9d+36) then
tmp = t_1
else if (y <= 3.6d+121) then
tmp = y * -x
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 = x + (y * t);
double tmp;
if (y <= -1.35e+48) {
tmp = t_1;
} else if (y <= 3.2e-70) {
tmp = x - (z * t);
} else if (y <= 2.9e+36) {
tmp = t_1;
} else if (y <= 3.6e+121) {
tmp = y * -x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * t) tmp = 0 if y <= -1.35e+48: tmp = t_1 elif y <= 3.2e-70: tmp = x - (z * t) elif y <= 2.9e+36: tmp = t_1 elif y <= 3.6e+121: tmp = y * -x else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * t)) tmp = 0.0 if (y <= -1.35e+48) tmp = t_1; elseif (y <= 3.2e-70) tmp = Float64(x - Float64(z * t)); elseif (y <= 2.9e+36) tmp = t_1; elseif (y <= 3.6e+121) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * t); tmp = 0.0; if (y <= -1.35e+48) tmp = t_1; elseif (y <= 3.2e-70) tmp = x - (z * t); elseif (y <= 2.9e+36) tmp = t_1; elseif (y <= 3.6e+121) tmp = y * -x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+48], t$95$1, If[LessEqual[y, 3.2e-70], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+36], t$95$1, If[LessEqual[y, 3.6e+121], N[(y * (-x)), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot t\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-70}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+121}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.35000000000000002e48 or 3.1999999999999997e-70 < y < 2.9e36Initial program 100.0%
Taylor expanded in t around inf 60.8%
Taylor expanded in z around 0 49.4%
if -1.35000000000000002e48 < y < 3.1999999999999997e-70Initial program 100.0%
Taylor expanded in y around 0 88.8%
+-commutative88.8%
mul-1-neg88.8%
unsub-neg88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in t around inf 66.2%
*-commutative66.2%
Simplified66.2%
if 2.9e36 < y < 3.59999999999999981e121Initial program 99.9%
Taylor expanded in x around inf 71.8%
*-commutative71.8%
mul-1-neg71.8%
unsub-neg71.8%
distribute-lft-out--71.8%
*-rgt-identity71.8%
Simplified71.8%
Taylor expanded in z around 0 67.6%
Taylor expanded in y around inf 51.7%
mul-1-neg51.7%
distribute-rgt-neg-in51.7%
Simplified51.7%
if 3.59999999999999981e121 < y Initial program 100.0%
Taylor expanded in t around inf 67.4%
Taylor expanded in y around inf 67.6%
Final simplification60.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.7e+23) (not (<= y 0.002))) (- x (* y (- x t))) (- x (* t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.7e+23) || !(y <= 0.002)) {
tmp = x - (y * (x - t));
} else {
tmp = x - (t * (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 ((y <= (-1.7d+23)) .or. (.not. (y <= 0.002d0))) then
tmp = x - (y * (x - t))
else
tmp = x - (t * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.7e+23) || !(y <= 0.002)) {
tmp = x - (y * (x - t));
} else {
tmp = x - (t * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.7e+23) or not (y <= 0.002): tmp = x - (y * (x - t)) else: tmp = x - (t * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.7e+23) || !(y <= 0.002)) tmp = Float64(x - Float64(y * Float64(x - t))); else tmp = Float64(x - Float64(t * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.7e+23) || ~((y <= 0.002))) tmp = x - (y * (x - t)); else tmp = x - (t * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.7e+23], N[Not[LessEqual[y, 0.002]], $MachinePrecision]], N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+23} \lor \neg \left(y \leq 0.002\right):\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \left(z - y\right)\\
\end{array}
\end{array}
if y < -1.69999999999999996e23 or 2e-3 < y Initial program 100.0%
Taylor expanded in z around 0 83.1%
if -1.69999999999999996e23 < y < 2e-3Initial program 100.0%
Taylor expanded in t around inf 76.6%
Final simplification80.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.5e-35) (not (<= t 2.15e-13))) (- x (* t (- z y))) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.5e-35) || !(t <= 2.15e-13)) {
tmp = x - (t * (z - y));
} 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 ((t <= (-3.5d-35)) .or. (.not. (t <= 2.15d-13))) then
tmp = x - (t * (z - y))
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 ((t <= -3.5e-35) || !(t <= 2.15e-13)) {
tmp = x - (t * (z - y));
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.5e-35) or not (t <= 2.15e-13): tmp = x - (t * (z - y)) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.5e-35) || !(t <= 2.15e-13)) tmp = Float64(x - Float64(t * Float64(z - y))); 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 ((t <= -3.5e-35) || ~((t <= 2.15e-13))) tmp = x - (t * (z - y)); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.5e-35], N[Not[LessEqual[t, 2.15e-13]], $MachinePrecision]], N[(x - N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{-35} \lor \neg \left(t \leq 2.15 \cdot 10^{-13}\right):\\
\;\;\;\;x - t \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -3.49999999999999996e-35 or 2.1499999999999999e-13 < t Initial program 100.0%
Taylor expanded in t around inf 86.9%
if -3.49999999999999996e-35 < t < 2.1499999999999999e-13Initial program 99.9%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
mul-1-neg78.3%
unsub-neg78.3%
distribute-lft-out--78.3%
*-rgt-identity78.3%
Simplified78.3%
Final simplification83.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.9e+19) (not (<= y 4.4e-26))) (- x (* y (- x t))) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.9e+19) || !(y <= 4.4e-26)) {
tmp = x - (y * (x - t));
} 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) :: tmp
if ((y <= (-1.9d+19)) .or. (.not. (y <= 4.4d-26))) then
tmp = x - (y * (x - t))
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 tmp;
if ((y <= -1.9e+19) || !(y <= 4.4e-26)) {
tmp = x - (y * (x - t));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.9e+19) or not (y <= 4.4e-26): tmp = x - (y * (x - t)) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.9e+19) || !(y <= 4.4e-26)) tmp = Float64(x - Float64(y * Float64(x - t))); else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.9e+19) || ~((y <= 4.4e-26))) tmp = x - (y * (x - t)); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.9e+19], N[Not[LessEqual[y, 4.4e-26]], $MachinePrecision]], N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+19} \lor \neg \left(y \leq 4.4 \cdot 10^{-26}\right):\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -1.9e19 or 4.4000000000000002e-26 < y Initial program 100.0%
Taylor expanded in z around 0 82.6%
if -1.9e19 < y < 4.4000000000000002e-26Initial program 100.0%
Taylor expanded in y around 0 91.6%
+-commutative91.6%
mul-1-neg91.6%
unsub-neg91.6%
*-commutative91.6%
Simplified91.6%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (<= z -8.5e+61) (* z x) (if (<= z 2.85e-114) (* y t) (if (<= z 24.0) x (* z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.5e+61) {
tmp = z * x;
} else if (z <= 2.85e-114) {
tmp = y * t;
} else if (z <= 24.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.5d+61)) then
tmp = z * x
else if (z <= 2.85d-114) then
tmp = y * t
else if (z <= 24.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.5e+61) {
tmp = z * x;
} else if (z <= 2.85e-114) {
tmp = y * t;
} else if (z <= 24.0) {
tmp = x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.5e+61: tmp = z * x elif z <= 2.85e-114: tmp = y * t elif z <= 24.0: tmp = x else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.5e+61) tmp = Float64(z * x); elseif (z <= 2.85e-114) tmp = Float64(y * t); elseif (z <= 24.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.5e+61) tmp = z * x; elseif (z <= 2.85e-114) tmp = y * t; elseif (z <= 24.0) tmp = x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.5e+61], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.85e-114], N[(y * t), $MachinePrecision], If[LessEqual[z, 24.0], x, N[(z * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+61}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{-114}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 24:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -8.50000000000000035e61 or 24 < z Initial program 99.9%
Taylor expanded in x around inf 53.8%
*-commutative53.8%
mul-1-neg53.8%
unsub-neg53.8%
distribute-lft-out--53.7%
*-rgt-identity53.7%
Simplified53.7%
Taylor expanded in z around inf 45.1%
if -8.50000000000000035e61 < z < 2.8499999999999999e-114Initial program 100.0%
Taylor expanded in t around inf 70.5%
Taylor expanded in y around inf 45.1%
if 2.8499999999999999e-114 < z < 24Initial program 100.0%
Taylor expanded in t around inf 76.5%
Taylor expanded in x around inf 35.5%
Final simplification44.1%
(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 -3.5e-109) (* y t) (if (<= y 1.85e-38) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e-109) {
tmp = y * t;
} else if (y <= 1.85e-38) {
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 <= (-3.5d-109)) then
tmp = y * t
else if (y <= 1.85d-38) 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 <= -3.5e-109) {
tmp = y * t;
} else if (y <= 1.85e-38) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e-109: tmp = y * t elif y <= 1.85e-38: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e-109) tmp = Float64(y * t); elseif (y <= 1.85e-38) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e-109) tmp = y * t; elseif (y <= 1.85e-38) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e-109], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.85e-38], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-109}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-38}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -3.5e-109 or 1.85e-38 < y Initial program 100.0%
Taylor expanded in t around inf 58.7%
Taylor expanded in y around inf 43.7%
if -3.5e-109 < y < 1.85e-38Initial program 99.9%
Taylor expanded in t around inf 77.6%
Taylor expanded in x around inf 30.8%
Final simplification39.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 100.0%
Taylor expanded in t around inf 65.3%
Taylor expanded in x around inf 14.2%
Final simplification14.2%
(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 2023274
(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))))