
(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 14 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
(if (<= z -2.5e+121)
(* z x)
(if (<= z -2.7e+78)
(* y t)
(if (<= z -1.0)
(* z x)
(if (<= z -2.5e-67)
x
(if (<= z -1.05e-272)
(* y t)
(if (<= z 6.4e-84) x (if (<= z 1.85e-7) (* y t) (* z x)))))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e+121) {
tmp = z * x;
} else if (z <= -2.7e+78) {
tmp = y * t;
} else if (z <= -1.0) {
tmp = z * x;
} else if (z <= -2.5e-67) {
tmp = x;
} else if (z <= -1.05e-272) {
tmp = y * t;
} else if (z <= 6.4e-84) {
tmp = x;
} else if (z <= 1.85e-7) {
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 <= (-2.5d+121)) then
tmp = z * x
else if (z <= (-2.7d+78)) then
tmp = y * t
else if (z <= (-1.0d0)) then
tmp = z * x
else if (z <= (-2.5d-67)) then
tmp = x
else if (z <= (-1.05d-272)) then
tmp = y * t
else if (z <= 6.4d-84) then
tmp = x
else if (z <= 1.85d-7) 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 <= -2.5e+121) {
tmp = z * x;
} else if (z <= -2.7e+78) {
tmp = y * t;
} else if (z <= -1.0) {
tmp = z * x;
} else if (z <= -2.5e-67) {
tmp = x;
} else if (z <= -1.05e-272) {
tmp = y * t;
} else if (z <= 6.4e-84) {
tmp = x;
} else if (z <= 1.85e-7) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.5e+121: tmp = z * x elif z <= -2.7e+78: tmp = y * t elif z <= -1.0: tmp = z * x elif z <= -2.5e-67: tmp = x elif z <= -1.05e-272: tmp = y * t elif z <= 6.4e-84: tmp = x elif z <= 1.85e-7: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.5e+121) tmp = Float64(z * x); elseif (z <= -2.7e+78) tmp = Float64(y * t); elseif (z <= -1.0) tmp = Float64(z * x); elseif (z <= -2.5e-67) tmp = x; elseif (z <= -1.05e-272) tmp = Float64(y * t); elseif (z <= 6.4e-84) tmp = x; elseif (z <= 1.85e-7) 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 <= -2.5e+121) tmp = z * x; elseif (z <= -2.7e+78) tmp = y * t; elseif (z <= -1.0) tmp = z * x; elseif (z <= -2.5e-67) tmp = x; elseif (z <= -1.05e-272) tmp = y * t; elseif (z <= 6.4e-84) tmp = x; elseif (z <= 1.85e-7) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.5e+121], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.7e+78], N[(y * t), $MachinePrecision], If[LessEqual[z, -1.0], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.5e-67], x, If[LessEqual[z, -1.05e-272], N[(y * t), $MachinePrecision], If[LessEqual[z, 6.4e-84], x, If[LessEqual[z, 1.85e-7], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+121}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{+78}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -1:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-272}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-84}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-7}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -2.50000000000000004e121 or -2.70000000000000004e78 < z < -1 or 1.85000000000000002e-7 < z Initial program 100.0%
Taylor expanded in y around 0 78.5%
mul-1-neg78.5%
unsub-neg78.5%
Simplified78.5%
sub-neg78.5%
distribute-lft-in72.9%
Applied egg-rr72.9%
Taylor expanded in x around -inf 51.7%
Taylor expanded in z around inf 51.0%
*-commutative51.0%
Simplified51.0%
if -2.50000000000000004e121 < z < -2.70000000000000004e78 or -2.4999999999999999e-67 < z < -1.04999999999999993e-272 or 6.3999999999999999e-84 < z < 1.85000000000000002e-7Initial program 100.0%
Taylor expanded in x around 0 98.4%
fma-def98.4%
+-commutative98.4%
mul-1-neg98.4%
neg-sub098.4%
associate-+l-98.4%
associate--r+98.4%
+-commutative98.4%
neg-sub098.4%
distribute-rgt-neg-in98.4%
mul-1-neg98.4%
mul-1-neg98.4%
distribute-rgt-neg-in98.4%
neg-sub098.4%
+-commutative98.4%
associate--r+98.4%
associate-+l-98.4%
neg-sub098.4%
mul-1-neg98.4%
+-commutative98.4%
mul-1-neg98.4%
Simplified98.4%
Taylor expanded in t around inf 63.7%
Taylor expanded in y around inf 44.4%
*-commutative44.4%
Simplified44.4%
if -1 < z < -2.4999999999999999e-67 or -1.04999999999999993e-272 < z < 6.3999999999999999e-84Initial program 100.0%
Taylor expanded in t around inf 67.3%
Taylor expanded in x around inf 41.3%
Final simplification46.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* x (+ z 1.0))))
(if (<= y -7300.0)
t_1
(if (<= y 2.05e-278)
t_2
(if (<= y 1e-244)
(* z (- t))
(if (<= y 1.4e-29) t_2 (if (<= y 1e+18) (* (- y z) t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -7300.0) {
tmp = t_1;
} else if (y <= 2.05e-278) {
tmp = t_2;
} else if (y <= 1e-244) {
tmp = z * -t;
} else if (y <= 1.4e-29) {
tmp = t_2;
} else if (y <= 1e+18) {
tmp = (y - 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) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x * (z + 1.0d0)
if (y <= (-7300.0d0)) then
tmp = t_1
else if (y <= 2.05d-278) then
tmp = t_2
else if (y <= 1d-244) then
tmp = z * -t
else if (y <= 1.4d-29) then
tmp = t_2
else if (y <= 1d+18) then
tmp = (y - 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 = y * (t - x);
double t_2 = x * (z + 1.0);
double tmp;
if (y <= -7300.0) {
tmp = t_1;
} else if (y <= 2.05e-278) {
tmp = t_2;
} else if (y <= 1e-244) {
tmp = z * -t;
} else if (y <= 1.4e-29) {
tmp = t_2;
} else if (y <= 1e+18) {
tmp = (y - z) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x * (z + 1.0) tmp = 0 if y <= -7300.0: tmp = t_1 elif y <= 2.05e-278: tmp = t_2 elif y <= 1e-244: tmp = z * -t elif y <= 1.4e-29: tmp = t_2 elif y <= 1e+18: tmp = (y - z) * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -7300.0) tmp = t_1; elseif (y <= 2.05e-278) tmp = t_2; elseif (y <= 1e-244) tmp = Float64(z * Float64(-t)); elseif (y <= 1.4e-29) tmp = t_2; elseif (y <= 1e+18) tmp = Float64(Float64(y - z) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x * (z + 1.0); tmp = 0.0; if (y <= -7300.0) tmp = t_1; elseif (y <= 2.05e-278) tmp = t_2; elseif (y <= 1e-244) tmp = z * -t; elseif (y <= 1.4e-29) tmp = t_2; elseif (y <= 1e+18) tmp = (y - z) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7300.0], t$95$1, If[LessEqual[y, 2.05e-278], t$95$2, If[LessEqual[y, 1e-244], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 1.4e-29], t$95$2, If[LessEqual[y, 1e+18], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -7300:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-278}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 10^{-244}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 10^{+18}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7300 or 1e18 < y Initial program 100.0%
Taylor expanded in x around 0 94.3%
fma-def97.6%
+-commutative97.6%
mul-1-neg97.6%
neg-sub097.6%
associate-+l-97.6%
associate--r+97.6%
+-commutative97.6%
neg-sub097.6%
distribute-rgt-neg-in97.6%
mul-1-neg97.6%
mul-1-neg97.6%
distribute-rgt-neg-in97.6%
neg-sub097.6%
+-commutative97.6%
associate--r+97.6%
associate-+l-97.6%
neg-sub097.6%
mul-1-neg97.6%
+-commutative97.6%
mul-1-neg97.6%
Simplified97.6%
Taylor expanded in y around inf 83.7%
neg-mul-183.7%
sub-neg83.7%
Simplified83.7%
if -7300 < y < 2.05000000000000001e-278 or 9.9999999999999993e-245 < y < 1.4000000000000001e-29Initial program 99.9%
Taylor expanded in y around 0 92.4%
mul-1-neg92.4%
unsub-neg92.4%
Simplified92.4%
sub-neg92.4%
distribute-lft-in88.8%
Applied egg-rr88.8%
Taylor expanded in x around -inf 68.6%
if 2.05000000000000001e-278 < y < 9.9999999999999993e-245Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 86.1%
Taylor expanded in y around 0 86.1%
associate-*r*86.1%
*-commutative86.1%
mul-1-neg86.1%
Simplified86.1%
if 1.4000000000000001e-29 < y < 1e18Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 73.1%
Final simplification76.6%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -2.25e-102)
(not (or (<= x 1.5e-94) (and (not (<= x 7.5e-30)) (<= x 8.5e+65)))))
(* x (+ (- z y) 1.0))
(* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.25e-102) || !((x <= 1.5e-94) || (!(x <= 7.5e-30) && (x <= 8.5e+65)))) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.25d-102)) .or. (.not. (x <= 1.5d-94) .or. (.not. (x <= 7.5d-30)) .and. (x <= 8.5d+65))) then
tmp = x * ((z - y) + 1.0d0)
else
tmp = (y - z) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.25e-102) || !((x <= 1.5e-94) || (!(x <= 7.5e-30) && (x <= 8.5e+65)))) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.25e-102) or not ((x <= 1.5e-94) or (not (x <= 7.5e-30) and (x <= 8.5e+65))): tmp = x * ((z - y) + 1.0) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.25e-102) || !((x <= 1.5e-94) || (!(x <= 7.5e-30) && (x <= 8.5e+65)))) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.25e-102) || ~(((x <= 1.5e-94) || (~((x <= 7.5e-30)) && (x <= 8.5e+65))))) tmp = x * ((z - y) + 1.0); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.25e-102], N[Not[Or[LessEqual[x, 1.5e-94], And[N[Not[LessEqual[x, 7.5e-30]], $MachinePrecision], LessEqual[x, 8.5e+65]]]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-102} \lor \neg \left(x \leq 1.5 \cdot 10^{-94} \lor \neg \left(x \leq 7.5 \cdot 10^{-30}\right) \land x \leq 8.5 \cdot 10^{+65}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -2.25e-102 or 1.5000000000000001e-94 < x < 7.5000000000000006e-30 or 8.50000000000000075e65 < x Initial program 100.0%
Taylor expanded in x around inf 81.2%
mul-1-neg81.2%
unsub-neg81.2%
Simplified81.2%
if -2.25e-102 < x < 1.5000000000000001e-94 or 7.5000000000000006e-30 < x < 8.50000000000000075e65Initial program 99.9%
Taylor expanded in x around 0 99.9%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 80.4%
Final simplification80.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -51000000.0)
t_1
(if (<= y 3.6e+18)
(- x (* z (- t x)))
(if (<= y 2.1e+57)
(* x (+ (- z y) 1.0))
(if (<= y 6.6e+67) (* z (- x t)) (+ x t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -51000000.0) {
tmp = t_1;
} else if (y <= 3.6e+18) {
tmp = x - (z * (t - x));
} else if (y <= 2.1e+57) {
tmp = x * ((z - y) + 1.0);
} else if (y <= 6.6e+67) {
tmp = z * (x - t);
} else {
tmp = x + 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 = y * (t - x)
if (y <= (-51000000.0d0)) then
tmp = t_1
else if (y <= 3.6d+18) then
tmp = x - (z * (t - x))
else if (y <= 2.1d+57) then
tmp = x * ((z - y) + 1.0d0)
else if (y <= 6.6d+67) then
tmp = z * (x - t)
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -51000000.0) {
tmp = t_1;
} else if (y <= 3.6e+18) {
tmp = x - (z * (t - x));
} else if (y <= 2.1e+57) {
tmp = x * ((z - y) + 1.0);
} else if (y <= 6.6e+67) {
tmp = z * (x - t);
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -51000000.0: tmp = t_1 elif y <= 3.6e+18: tmp = x - (z * (t - x)) elif y <= 2.1e+57: tmp = x * ((z - y) + 1.0) elif y <= 6.6e+67: tmp = z * (x - t) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -51000000.0) tmp = t_1; elseif (y <= 3.6e+18) tmp = Float64(x - Float64(z * Float64(t - x))); elseif (y <= 2.1e+57) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); elseif (y <= 6.6e+67) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -51000000.0) tmp = t_1; elseif (y <= 3.6e+18) tmp = x - (z * (t - x)); elseif (y <= 2.1e+57) tmp = x * ((z - y) + 1.0); elseif (y <= 6.6e+67) tmp = z * (x - t); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -51000000.0], t$95$1, If[LessEqual[y, 3.6e+18], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+57], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+67], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -51000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+18}:\\
\;\;\;\;x - z \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+57}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+67}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if y < -5.1e7Initial program 100.0%
Taylor expanded in x around 0 94.6%
fma-def98.2%
+-commutative98.2%
mul-1-neg98.2%
neg-sub098.2%
associate-+l-98.2%
associate--r+98.2%
+-commutative98.2%
neg-sub098.2%
distribute-rgt-neg-in98.2%
mul-1-neg98.2%
mul-1-neg98.2%
distribute-rgt-neg-in98.2%
neg-sub098.2%
+-commutative98.2%
associate--r+98.2%
associate-+l-98.2%
neg-sub098.2%
mul-1-neg98.2%
+-commutative98.2%
mul-1-neg98.2%
Simplified98.2%
Taylor expanded in y around inf 89.7%
neg-mul-189.7%
sub-neg89.7%
Simplified89.7%
if -5.1e7 < y < 3.6e18Initial program 100.0%
Taylor expanded in y around 0 90.8%
mul-1-neg90.8%
unsub-neg90.8%
Simplified90.8%
if 3.6e18 < y < 2.09999999999999991e57Initial program 100.0%
Taylor expanded in x around inf 72.0%
mul-1-neg72.0%
unsub-neg72.0%
Simplified72.0%
if 2.09999999999999991e57 < y < 6.6000000000000006e67Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
mul-1-neg100.0%
sub-neg100.0%
Simplified100.0%
if 6.6000000000000006e67 < y Initial program 100.0%
Taylor expanded in y around inf 90.1%
*-commutative90.1%
Simplified90.1%
Final simplification89.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z 1.0))))
(if (<= x -3.5e+247)
t_1
(if (<= x -4.5e+186)
(* y (- x))
(if (or (<= x -1.8e+95) (not (<= x 1.45e+110))) t_1 (* (- y z) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double tmp;
if (x <= -3.5e+247) {
tmp = t_1;
} else if (x <= -4.5e+186) {
tmp = y * -x;
} else if ((x <= -1.8e+95) || !(x <= 1.45e+110)) {
tmp = t_1;
} else {
tmp = (y - z) * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z + 1.0d0)
if (x <= (-3.5d+247)) then
tmp = t_1
else if (x <= (-4.5d+186)) then
tmp = y * -x
else if ((x <= (-1.8d+95)) .or. (.not. (x <= 1.45d+110))) then
tmp = t_1
else
tmp = (y - z) * t
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.5e+247) {
tmp = t_1;
} else if (x <= -4.5e+186) {
tmp = y * -x;
} else if ((x <= -1.8e+95) || !(x <= 1.45e+110)) {
tmp = t_1;
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + 1.0) tmp = 0 if x <= -3.5e+247: tmp = t_1 elif x <= -4.5e+186: tmp = y * -x elif (x <= -1.8e+95) or not (x <= 1.45e+110): tmp = t_1 else: tmp = (y - z) * t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (x <= -3.5e+247) tmp = t_1; elseif (x <= -4.5e+186) tmp = Float64(y * Float64(-x)); elseif ((x <= -1.8e+95) || !(x <= 1.45e+110)) tmp = t_1; else tmp = Float64(Float64(y - z) * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + 1.0); tmp = 0.0; if (x <= -3.5e+247) tmp = t_1; elseif (x <= -4.5e+186) tmp = y * -x; elseif ((x <= -1.8e+95) || ~((x <= 1.45e+110))) tmp = t_1; else tmp = (y - z) * t; 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.5e+247], t$95$1, If[LessEqual[x, -4.5e+186], N[(y * (-x)), $MachinePrecision], If[Or[LessEqual[x, -1.8e+95], N[Not[LessEqual[x, 1.45e+110]], $MachinePrecision]], t$95$1, N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+186}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{+95} \lor \neg \left(x \leq 1.45 \cdot 10^{+110}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -3.5000000000000002e247 or -4.50000000000000045e186 < x < -1.79999999999999989e95 or 1.45e110 < x Initial program 100.0%
Taylor expanded in y around 0 72.2%
mul-1-neg72.2%
unsub-neg72.2%
Simplified72.2%
sub-neg72.2%
distribute-lft-in65.6%
Applied egg-rr65.6%
Taylor expanded in x around -inf 69.3%
if -3.5000000000000002e247 < x < -4.50000000000000045e186Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 73.7%
neg-mul-173.7%
sub-neg73.7%
Simplified73.7%
Taylor expanded in t around 0 73.7%
associate-*r*73.7%
mul-1-neg73.7%
Simplified73.7%
if -1.79999999999999989e95 < x < 1.45e110Initial program 100.0%
Taylor expanded in x around 0 98.7%
fma-def98.7%
+-commutative98.7%
mul-1-neg98.7%
neg-sub098.7%
associate-+l-98.7%
associate--r+98.7%
+-commutative98.7%
neg-sub098.7%
distribute-rgt-neg-in98.7%
mul-1-neg98.7%
mul-1-neg98.7%
distribute-rgt-neg-in98.7%
neg-sub098.7%
+-commutative98.7%
associate--r+98.7%
associate-+l-98.7%
neg-sub098.7%
mul-1-neg98.7%
+-commutative98.7%
mul-1-neg98.7%
Simplified98.7%
Taylor expanded in t around inf 64.5%
Final simplification66.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)) (t_2 (* y (- x))))
(if (<= t -5.4e-138)
t_1
(if (<= t 7.5e-230)
t_2
(if (<= t 5.2e-212) (* z x) (if (<= t 4e-31) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = y * -x;
double tmp;
if (t <= -5.4e-138) {
tmp = t_1;
} else if (t <= 7.5e-230) {
tmp = t_2;
} else if (t <= 5.2e-212) {
tmp = z * x;
} else if (t <= 4e-31) {
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 = (y - z) * t
t_2 = y * -x
if (t <= (-5.4d-138)) then
tmp = t_1
else if (t <= 7.5d-230) then
tmp = t_2
else if (t <= 5.2d-212) then
tmp = z * x
else if (t <= 4d-31) 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 = (y - z) * t;
double t_2 = y * -x;
double tmp;
if (t <= -5.4e-138) {
tmp = t_1;
} else if (t <= 7.5e-230) {
tmp = t_2;
} else if (t <= 5.2e-212) {
tmp = z * x;
} else if (t <= 4e-31) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t t_2 = y * -x tmp = 0 if t <= -5.4e-138: tmp = t_1 elif t <= 7.5e-230: tmp = t_2 elif t <= 5.2e-212: tmp = z * x elif t <= 4e-31: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(y * Float64(-x)) tmp = 0.0 if (t <= -5.4e-138) tmp = t_1; elseif (t <= 7.5e-230) tmp = t_2; elseif (t <= 5.2e-212) tmp = Float64(z * x); elseif (t <= 4e-31) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; t_2 = y * -x; tmp = 0.0; if (t <= -5.4e-138) tmp = t_1; elseif (t <= 7.5e-230) tmp = t_2; elseif (t <= 5.2e-212) tmp = z * x; elseif (t <= 4e-31) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[t, -5.4e-138], t$95$1, If[LessEqual[t, 7.5e-230], t$95$2, If[LessEqual[t, 5.2e-212], N[(z * x), $MachinePrecision], If[LessEqual[t, 4e-31], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := y \cdot \left(-x\right)\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-230}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-212}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-31}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.40000000000000057e-138 or 4e-31 < t Initial program 100.0%
Taylor expanded in x around 0 92.9%
fma-def96.8%
+-commutative96.8%
mul-1-neg96.8%
neg-sub096.8%
associate-+l-96.8%
associate--r+96.8%
+-commutative96.8%
neg-sub096.8%
distribute-rgt-neg-in96.8%
mul-1-neg96.8%
mul-1-neg96.8%
distribute-rgt-neg-in96.8%
neg-sub096.8%
+-commutative96.8%
associate--r+96.8%
associate-+l-96.8%
neg-sub096.8%
mul-1-neg96.8%
+-commutative96.8%
mul-1-neg96.8%
Simplified96.8%
Taylor expanded in t around inf 68.0%
if -5.40000000000000057e-138 < t < 7.50000000000000006e-230 or 5.2e-212 < t < 4e-31Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 50.0%
neg-mul-150.0%
sub-neg50.0%
Simplified50.0%
Taylor expanded in t around 0 43.1%
associate-*r*43.1%
mul-1-neg43.1%
Simplified43.1%
if 7.50000000000000006e-230 < t < 5.2e-212Initial program 100.0%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
sub-neg100.0%
distribute-lft-in100.0%
Applied egg-rr100.0%
Taylor expanded in x around -inf 100.0%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
Simplified86.2%
Final simplification59.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))))
(if (<= y -1.8e+86)
t_1
(if (<= y -5200.0)
(* y t)
(if (<= y -1.5e-192) (* z x) (if (<= y 6e+19) (* z (- t)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (y <= -1.8e+86) {
tmp = t_1;
} else if (y <= -5200.0) {
tmp = y * t;
} else if (y <= -1.5e-192) {
tmp = z * x;
} else if (y <= 6e+19) {
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 = y * -x
if (y <= (-1.8d+86)) then
tmp = t_1
else if (y <= (-5200.0d0)) then
tmp = y * t
else if (y <= (-1.5d-192)) then
tmp = z * x
else if (y <= 6d+19) 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 = y * -x;
double tmp;
if (y <= -1.8e+86) {
tmp = t_1;
} else if (y <= -5200.0) {
tmp = y * t;
} else if (y <= -1.5e-192) {
tmp = z * x;
} else if (y <= 6e+19) {
tmp = z * -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * -x tmp = 0 if y <= -1.8e+86: tmp = t_1 elif y <= -5200.0: tmp = y * t elif y <= -1.5e-192: tmp = z * x elif y <= 6e+19: tmp = z * -t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -1.8e+86) tmp = t_1; elseif (y <= -5200.0) tmp = Float64(y * t); elseif (y <= -1.5e-192) tmp = Float64(z * x); elseif (y <= 6e+19) tmp = Float64(z * Float64(-t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * -x; tmp = 0.0; if (y <= -1.8e+86) tmp = t_1; elseif (y <= -5200.0) tmp = y * t; elseif (y <= -1.5e-192) tmp = z * x; elseif (y <= 6e+19) tmp = z * -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -1.8e+86], t$95$1, If[LessEqual[y, -5200.0], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.5e-192], N[(z * x), $MachinePrecision], If[LessEqual[y, 6e+19], N[(z * (-t)), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5200:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-192}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+19}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.80000000000000003e86 or 6e19 < y Initial program 100.0%
Taylor expanded in x around 0 93.6%
fma-def97.2%
+-commutative97.2%
mul-1-neg97.2%
neg-sub097.2%
associate-+l-97.2%
associate--r+97.2%
+-commutative97.2%
neg-sub097.2%
distribute-rgt-neg-in97.2%
mul-1-neg97.2%
mul-1-neg97.2%
distribute-rgt-neg-in97.2%
neg-sub097.2%
+-commutative97.2%
associate--r+97.2%
associate-+l-97.2%
neg-sub097.2%
mul-1-neg97.2%
+-commutative97.2%
mul-1-neg97.2%
Simplified97.2%
Taylor expanded in y around inf 83.3%
neg-mul-183.3%
sub-neg83.3%
Simplified83.3%
Taylor expanded in t around 0 52.8%
associate-*r*52.8%
mul-1-neg52.8%
Simplified52.8%
if -1.80000000000000003e86 < y < -5200Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
+-commutative100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
associate--r+100.0%
+-commutative100.0%
neg-sub0100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
+-commutative100.0%
associate--r+100.0%
associate-+l-100.0%
neg-sub0100.0%
mul-1-neg100.0%
+-commutative100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 78.9%
Taylor expanded in y around inf 71.7%
*-commutative71.7%
Simplified71.7%
if -5200 < y < -1.5e-192Initial program 99.9%
Taylor expanded in y around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
sub-neg86.2%
distribute-lft-in80.5%
Applied egg-rr80.5%
Taylor expanded in x around -inf 72.9%
Taylor expanded in z around inf 55.6%
*-commutative55.6%
Simplified55.6%
if -1.5e-192 < y < 6e19Initial program 100.0%
Taylor expanded in x around 0 97.9%
fma-def99.0%
+-commutative99.0%
mul-1-neg99.0%
neg-sub099.0%
associate-+l-99.0%
associate--r+99.0%
+-commutative99.0%
neg-sub099.0%
distribute-rgt-neg-in99.0%
mul-1-neg99.0%
mul-1-neg99.0%
distribute-rgt-neg-in99.0%
neg-sub099.0%
+-commutative99.0%
associate--r+99.0%
associate-+l-99.0%
neg-sub099.0%
mul-1-neg99.0%
+-commutative99.0%
mul-1-neg99.0%
Simplified99.0%
Taylor expanded in t around inf 49.0%
Taylor expanded in y around 0 41.9%
associate-*r*41.9%
*-commutative41.9%
mul-1-neg41.9%
Simplified41.9%
Final simplification50.1%
(FPCore (x y z t) :precision binary64 (if (<= y -5200.0) (* y t) (if (<= y -3.3e-194) (* z x) (if (<= y 5.5e+97) (* z (- t)) (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5200.0) {
tmp = y * t;
} else if (y <= -3.3e-194) {
tmp = z * x;
} else if (y <= 5.5e+97) {
tmp = z * -t;
} 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 <= (-5200.0d0)) then
tmp = y * t
else if (y <= (-3.3d-194)) then
tmp = z * x
else if (y <= 5.5d+97) then
tmp = z * -t
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 <= -5200.0) {
tmp = y * t;
} else if (y <= -3.3e-194) {
tmp = z * x;
} else if (y <= 5.5e+97) {
tmp = z * -t;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5200.0: tmp = y * t elif y <= -3.3e-194: tmp = z * x elif y <= 5.5e+97: tmp = z * -t else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5200.0) tmp = Float64(y * t); elseif (y <= -3.3e-194) tmp = Float64(z * x); elseif (y <= 5.5e+97) tmp = Float64(z * Float64(-t)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5200.0) tmp = y * t; elseif (y <= -3.3e-194) tmp = z * x; elseif (y <= 5.5e+97) tmp = z * -t; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5200.0], N[(y * t), $MachinePrecision], If[LessEqual[y, -3.3e-194], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.5e+97], N[(z * (-t)), $MachinePrecision], N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5200:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-194}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+97}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -5200 or 5.50000000000000021e97 < y Initial program 100.0%
Taylor expanded in x around 0 93.0%
fma-def97.0%
+-commutative97.0%
mul-1-neg97.0%
neg-sub097.0%
associate-+l-97.0%
associate--r+97.0%
+-commutative97.0%
neg-sub097.0%
distribute-rgt-neg-in97.0%
mul-1-neg97.0%
mul-1-neg97.0%
distribute-rgt-neg-in97.0%
neg-sub097.0%
+-commutative97.0%
associate--r+97.0%
associate-+l-97.0%
neg-sub097.0%
mul-1-neg97.0%
+-commutative97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t around inf 48.9%
Taylor expanded in y around inf 44.0%
*-commutative44.0%
Simplified44.0%
if -5200 < y < -3.2999999999999999e-194Initial program 99.9%
Taylor expanded in y around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
Simplified86.2%
sub-neg86.2%
distribute-lft-in80.5%
Applied egg-rr80.5%
Taylor expanded in x around -inf 72.9%
Taylor expanded in z around inf 55.6%
*-commutative55.6%
Simplified55.6%
if -3.2999999999999999e-194 < y < 5.50000000000000021e97Initial program 100.0%
Taylor expanded in x around 0 98.3%
fma-def99.2%
+-commutative99.2%
mul-1-neg99.2%
neg-sub099.2%
associate-+l-99.2%
associate--r+99.2%
+-commutative99.2%
neg-sub099.2%
distribute-rgt-neg-in99.2%
mul-1-neg99.2%
mul-1-neg99.2%
distribute-rgt-neg-in99.2%
neg-sub099.2%
+-commutative99.2%
associate--r+99.2%
associate-+l-99.2%
neg-sub099.2%
mul-1-neg99.2%
+-commutative99.2%
mul-1-neg99.2%
Simplified99.2%
Taylor expanded in t around inf 49.2%
Taylor expanded in y around 0 40.0%
associate-*r*40.0%
*-commutative40.0%
mul-1-neg40.0%
Simplified40.0%
Final simplification43.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -0.000205) (not (<= x 2.7e+66))) (* x (+ (- z y) 1.0)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -0.000205) || !(x <= 2.7e+66)) {
tmp = x * ((z - y) + 1.0);
} 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 <= (-0.000205d0)) .or. (.not. (x <= 2.7d+66))) then
tmp = x * ((z - y) + 1.0d0)
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 <= -0.000205) || !(x <= 2.7e+66)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -0.000205) or not (x <= 2.7e+66): tmp = x * ((z - y) + 1.0) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -0.000205) || !(x <= 2.7e+66)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); 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 <= -0.000205) || ~((x <= 2.7e+66))) tmp = x * ((z - y) + 1.0); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -0.000205], N[Not[LessEqual[x, 2.7e+66]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000205 \lor \neg \left(x \leq 2.7 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -2.05e-4 or 2.7e66 < x Initial program 100.0%
Taylor expanded in x around inf 86.6%
mul-1-neg86.6%
unsub-neg86.6%
Simplified86.6%
if -2.05e-4 < x < 2.7e66Initial program 100.0%
Taylor expanded in t around inf 79.3%
Final simplification83.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -122000000.0) (not (<= y 6.6e+67))) (* y (- t x)) (* z (- x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -122000000.0) || !(y <= 6.6e+67)) {
tmp = y * (t - x);
} else {
tmp = 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 <= (-122000000.0d0)) .or. (.not. (y <= 6.6d+67))) then
tmp = y * (t - x)
else
tmp = 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 <= -122000000.0) || !(y <= 6.6e+67)) {
tmp = y * (t - x);
} else {
tmp = z * (x - t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -122000000.0) or not (y <= 6.6e+67): tmp = y * (t - x) else: tmp = z * (x - t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -122000000.0) || !(y <= 6.6e+67)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(z * Float64(x - t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -122000000.0) || ~((y <= 6.6e+67))) tmp = y * (t - x); else tmp = z * (x - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -122000000.0], N[Not[LessEqual[y, 6.6e+67]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -122000000 \lor \neg \left(y \leq 6.6 \cdot 10^{+67}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -1.22e8 or 6.6000000000000006e67 < y Initial program 100.0%
Taylor expanded in x around 0 93.3%
fma-def97.1%
+-commutative97.1%
mul-1-neg97.1%
neg-sub097.1%
associate-+l-97.1%
associate--r+97.1%
+-commutative97.1%
neg-sub097.1%
distribute-rgt-neg-in97.1%
mul-1-neg97.1%
mul-1-neg97.1%
distribute-rgt-neg-in97.1%
neg-sub097.1%
+-commutative97.1%
associate--r+97.1%
associate-+l-97.1%
neg-sub097.1%
mul-1-neg97.1%
+-commutative97.1%
mul-1-neg97.1%
Simplified97.1%
Taylor expanded in y around inf 89.9%
neg-mul-189.9%
sub-neg89.9%
Simplified89.9%
if -1.22e8 < y < 6.6000000000000006e67Initial program 100.0%
Taylor expanded in x around 0 97.3%
fma-def98.7%
+-commutative98.7%
mul-1-neg98.7%
neg-sub098.7%
associate-+l-98.7%
associate--r+98.7%
+-commutative98.7%
neg-sub098.7%
distribute-rgt-neg-in98.7%
mul-1-neg98.7%
mul-1-neg98.7%
distribute-rgt-neg-in98.7%
neg-sub098.7%
+-commutative98.7%
associate--r+98.7%
associate-+l-98.7%
neg-sub098.7%
mul-1-neg98.7%
+-commutative98.7%
mul-1-neg98.7%
Simplified98.7%
Taylor expanded in z around inf 63.5%
mul-1-neg63.5%
sub-neg63.5%
Simplified63.5%
Final simplification74.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.1e-44) (not (<= y 1.65e-32))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e-44) || !(y <= 1.65e-32)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-2.1d-44)) .or. (.not. (y <= 1.65d-32))) then
tmp = y * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.1e-44) || !(y <= 1.65e-32)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.1e-44) or not (y <= 1.65e-32): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.1e-44) || !(y <= 1.65e-32)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.1e-44) || ~((y <= 1.65e-32))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.1e-44], N[Not[LessEqual[y, 1.65e-32]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-44} \lor \neg \left(y \leq 1.65 \cdot 10^{-32}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.10000000000000001e-44 or 1.65000000000000013e-32 < y Initial program 100.0%
Taylor expanded in x around 0 94.6%
fma-def97.3%
+-commutative97.3%
mul-1-neg97.3%
neg-sub097.3%
associate-+l-97.3%
associate--r+97.3%
+-commutative97.3%
neg-sub097.3%
distribute-rgt-neg-in97.3%
mul-1-neg97.3%
mul-1-neg97.3%
distribute-rgt-neg-in97.3%
neg-sub097.3%
+-commutative97.3%
associate--r+97.3%
associate-+l-97.3%
neg-sub097.3%
mul-1-neg97.3%
+-commutative97.3%
mul-1-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 51.1%
Taylor expanded in y around inf 37.0%
*-commutative37.0%
Simplified37.0%
if -2.10000000000000001e-44 < y < 1.65000000000000013e-32Initial program 100.0%
Taylor expanded in t around inf 71.8%
Taylor expanded in x around inf 33.8%
Final simplification35.7%
(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 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 60.3%
Taylor expanded in x around inf 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 2024031
(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))))