
(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 12 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 (+ x (* (- t x) (- y z))))
double code(double x, double y, double z, double t) {
return x + ((t - 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 - x) * (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t - x) * (y - z));
}
def code(x, y, z, t): return x + ((t - x) * (y - z))
function code(x, y, z, t) return Float64(x + Float64(Float64(t - x) * Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x + ((t - x) * (y - z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right) \cdot \left(y - z\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* x z))) (t_3 (+ x (* y t))))
(if (<= z -8000000.0)
t_2
(if (<= z -4.7e-228)
t_3
(if (<= z 4.4e-129)
t_1
(if (<= z 4e-61)
t_3
(if (<= z 1.1e+72) t_1 (if (<= z 2.65e+278) (* t (- z)) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (x * z);
double t_3 = x + (y * t);
double tmp;
if (z <= -8000000.0) {
tmp = t_2;
} else if (z <= -4.7e-228) {
tmp = t_3;
} else if (z <= 4.4e-129) {
tmp = t_1;
} else if (z <= 4e-61) {
tmp = t_3;
} else if (z <= 1.1e+72) {
tmp = t_1;
} else if (z <= 2.65e+278) {
tmp = t * -z;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = x + (x * z)
t_3 = x + (y * t)
if (z <= (-8000000.0d0)) then
tmp = t_2
else if (z <= (-4.7d-228)) then
tmp = t_3
else if (z <= 4.4d-129) then
tmp = t_1
else if (z <= 4d-61) then
tmp = t_3
else if (z <= 1.1d+72) then
tmp = t_1
else if (z <= 2.65d+278) then
tmp = t * -z
else
tmp = t_2
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 + (x * z);
double t_3 = x + (y * t);
double tmp;
if (z <= -8000000.0) {
tmp = t_2;
} else if (z <= -4.7e-228) {
tmp = t_3;
} else if (z <= 4.4e-129) {
tmp = t_1;
} else if (z <= 4e-61) {
tmp = t_3;
} else if (z <= 1.1e+72) {
tmp = t_1;
} else if (z <= 2.65e+278) {
tmp = t * -z;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = x + (x * z) t_3 = x + (y * t) tmp = 0 if z <= -8000000.0: tmp = t_2 elif z <= -4.7e-228: tmp = t_3 elif z <= 4.4e-129: tmp = t_1 elif z <= 4e-61: tmp = t_3 elif z <= 1.1e+72: tmp = t_1 elif z <= 2.65e+278: tmp = t * -z else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(x + Float64(x * z)) t_3 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -8000000.0) tmp = t_2; elseif (z <= -4.7e-228) tmp = t_3; elseif (z <= 4.4e-129) tmp = t_1; elseif (z <= 4e-61) tmp = t_3; elseif (z <= 1.1e+72) tmp = t_1; elseif (z <= 2.65e+278) tmp = Float64(t * Float64(-z)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = x + (x * z); t_3 = x + (y * t); tmp = 0.0; if (z <= -8000000.0) tmp = t_2; elseif (z <= -4.7e-228) tmp = t_3; elseif (z <= 4.4e-129) tmp = t_1; elseif (z <= 4e-61) tmp = t_3; elseif (z <= 1.1e+72) tmp = t_1; elseif (z <= 2.65e+278) tmp = t * -z; else tmp = t_2; 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[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8000000.0], t$95$2, If[LessEqual[z, -4.7e-228], t$95$3, If[LessEqual[z, 4.4e-129], t$95$1, If[LessEqual[z, 4e-61], t$95$3, If[LessEqual[z, 1.1e+72], t$95$1, If[LessEqual[z, 2.65e+278], N[(t * (-z)), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := x + x \cdot z\\
t_3 := x + y \cdot t\\
\mathbf{if}\;z \leq -8000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-228}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-61}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{+278}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8e6 or 2.64999999999999996e278 < z Initial program 100.0%
Taylor expanded in y around 0 84.6%
mul-1-neg84.6%
distribute-lft-neg-out84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in t around 0 54.2%
if -8e6 < z < -4.7000000000000002e-228 or 4.40000000000000006e-129 < z < 4.0000000000000002e-61Initial program 99.9%
Taylor expanded in t around inf 88.8%
Taylor expanded in y around inf 68.9%
*-commutative68.9%
Simplified68.9%
if -4.7000000000000002e-228 < z < 4.40000000000000006e-129 or 4.0000000000000002e-61 < z < 1.1e72Initial program 100.0%
Taylor expanded in y around inf 93.6%
*-commutative93.6%
Simplified93.6%
Taylor expanded in x around inf 71.2%
mul-1-neg71.2%
unsub-neg71.2%
Simplified71.2%
if 1.1e72 < z < 2.64999999999999996e278Initial program 100.0%
Taylor expanded in t around inf 60.0%
Taylor expanded in y around 0 52.1%
mul-1-neg52.1%
unsub-neg52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in x around 0 51.4%
associate-*r*51.4%
neg-mul-151.4%
Simplified51.4%
Final simplification63.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* x z))) (t_3 (+ x (* y t))))
(if (<= z -0.42)
t_2
(if (<= z -1.12e-225)
t_3
(if (<= z 1.8e-128)
t_1
(if (<= z 3.1e-61)
t_3
(if (<= z 1.4e+78) t_1 (if (<= z 1.1e+280) (- x (* z t)) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + (x * z);
double t_3 = x + (y * t);
double tmp;
if (z <= -0.42) {
tmp = t_2;
} else if (z <= -1.12e-225) {
tmp = t_3;
} else if (z <= 1.8e-128) {
tmp = t_1;
} else if (z <= 3.1e-61) {
tmp = t_3;
} else if (z <= 1.4e+78) {
tmp = t_1;
} else if (z <= 1.1e+280) {
tmp = x - (z * t);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = x + (x * z)
t_3 = x + (y * t)
if (z <= (-0.42d0)) then
tmp = t_2
else if (z <= (-1.12d-225)) then
tmp = t_3
else if (z <= 1.8d-128) then
tmp = t_1
else if (z <= 3.1d-61) then
tmp = t_3
else if (z <= 1.4d+78) then
tmp = t_1
else if (z <= 1.1d+280) then
tmp = x - (z * t)
else
tmp = t_2
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 + (x * z);
double t_3 = x + (y * t);
double tmp;
if (z <= -0.42) {
tmp = t_2;
} else if (z <= -1.12e-225) {
tmp = t_3;
} else if (z <= 1.8e-128) {
tmp = t_1;
} else if (z <= 3.1e-61) {
tmp = t_3;
} else if (z <= 1.4e+78) {
tmp = t_1;
} else if (z <= 1.1e+280) {
tmp = x - (z * t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = x + (x * z) t_3 = x + (y * t) tmp = 0 if z <= -0.42: tmp = t_2 elif z <= -1.12e-225: tmp = t_3 elif z <= 1.8e-128: tmp = t_1 elif z <= 3.1e-61: tmp = t_3 elif z <= 1.4e+78: tmp = t_1 elif z <= 1.1e+280: tmp = x - (z * t) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(x + Float64(x * z)) t_3 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -0.42) tmp = t_2; elseif (z <= -1.12e-225) tmp = t_3; elseif (z <= 1.8e-128) tmp = t_1; elseif (z <= 3.1e-61) tmp = t_3; elseif (z <= 1.4e+78) tmp = t_1; elseif (z <= 1.1e+280) tmp = Float64(x - Float64(z * t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = x + (x * z); t_3 = x + (y * t); tmp = 0.0; if (z <= -0.42) tmp = t_2; elseif (z <= -1.12e-225) tmp = t_3; elseif (z <= 1.8e-128) tmp = t_1; elseif (z <= 3.1e-61) tmp = t_3; elseif (z <= 1.4e+78) tmp = t_1; elseif (z <= 1.1e+280) tmp = x - (z * t); else tmp = t_2; 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[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.42], t$95$2, If[LessEqual[z, -1.12e-225], t$95$3, If[LessEqual[z, 1.8e-128], t$95$1, If[LessEqual[z, 3.1e-61], t$95$3, If[LessEqual[z, 1.4e+78], t$95$1, If[LessEqual[z, 1.1e+280], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := x + x \cdot z\\
t_3 := x + y \cdot t\\
\mathbf{if}\;z \leq -0.42:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-225}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-61}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+280}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -0.419999999999999984 or 1.10000000000000008e280 < z Initial program 100.0%
Taylor expanded in y around 0 84.6%
mul-1-neg84.6%
distribute-lft-neg-out84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in t around 0 54.2%
if -0.419999999999999984 < z < -1.12000000000000003e-225 or 1.80000000000000012e-128 < z < 3.09999999999999995e-61Initial program 99.9%
Taylor expanded in t around inf 88.8%
Taylor expanded in y around inf 68.9%
*-commutative68.9%
Simplified68.9%
if -1.12000000000000003e-225 < z < 1.80000000000000012e-128 or 3.09999999999999995e-61 < z < 1.4000000000000001e78Initial program 100.0%
Taylor expanded in y around inf 93.6%
*-commutative93.6%
Simplified93.6%
Taylor expanded in x around inf 71.2%
mul-1-neg71.2%
unsub-neg71.2%
Simplified71.2%
if 1.4000000000000001e78 < z < 1.10000000000000008e280Initial program 100.0%
Taylor expanded in t around inf 60.0%
Taylor expanded in y around 0 52.1%
mul-1-neg52.1%
unsub-neg52.1%
*-commutative52.1%
Simplified52.1%
Final simplification63.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* x z))) (t_2 (+ x (* y t))))
(if (<= z -22000000.0)
t_1
(if (<= z -7.5e-231)
t_2
(if (<= z 1.55e-128)
(- x (* x y))
(if (<= z 3.6e-61)
t_2
(if (<= z 3.1e+62)
(* x (- 1.0 y))
(if (<= z 1.5e+279) (- x (* z t)) t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x + (y * t);
double tmp;
if (z <= -22000000.0) {
tmp = t_1;
} else if (z <= -7.5e-231) {
tmp = t_2;
} else if (z <= 1.55e-128) {
tmp = x - (x * y);
} else if (z <= 3.6e-61) {
tmp = t_2;
} else if (z <= 3.1e+62) {
tmp = x * (1.0 - y);
} else if (z <= 1.5e+279) {
tmp = x - (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 = x + (x * z)
t_2 = x + (y * t)
if (z <= (-22000000.0d0)) then
tmp = t_1
else if (z <= (-7.5d-231)) then
tmp = t_2
else if (z <= 1.55d-128) then
tmp = x - (x * y)
else if (z <= 3.6d-61) then
tmp = t_2
else if (z <= 3.1d+62) then
tmp = x * (1.0d0 - y)
else if (z <= 1.5d+279) then
tmp = x - (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 = x + (x * z);
double t_2 = x + (y * t);
double tmp;
if (z <= -22000000.0) {
tmp = t_1;
} else if (z <= -7.5e-231) {
tmp = t_2;
} else if (z <= 1.55e-128) {
tmp = x - (x * y);
} else if (z <= 3.6e-61) {
tmp = t_2;
} else if (z <= 3.1e+62) {
tmp = x * (1.0 - y);
} else if (z <= 1.5e+279) {
tmp = x - (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * z) t_2 = x + (y * t) tmp = 0 if z <= -22000000.0: tmp = t_1 elif z <= -7.5e-231: tmp = t_2 elif z <= 1.55e-128: tmp = x - (x * y) elif z <= 3.6e-61: tmp = t_2 elif z <= 3.1e+62: tmp = x * (1.0 - y) elif z <= 1.5e+279: tmp = x - (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * z)) t_2 = Float64(x + Float64(y * t)) tmp = 0.0 if (z <= -22000000.0) tmp = t_1; elseif (z <= -7.5e-231) tmp = t_2; elseif (z <= 1.55e-128) tmp = Float64(x - Float64(x * y)); elseif (z <= 3.6e-61) tmp = t_2; elseif (z <= 3.1e+62) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 1.5e+279) tmp = Float64(x - Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * z); t_2 = x + (y * t); tmp = 0.0; if (z <= -22000000.0) tmp = t_1; elseif (z <= -7.5e-231) tmp = t_2; elseif (z <= 1.55e-128) tmp = x - (x * y); elseif (z <= 3.6e-61) tmp = t_2; elseif (z <= 3.1e+62) tmp = x * (1.0 - y); elseif (z <= 1.5e+279) tmp = x - (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -22000000.0], t$95$1, If[LessEqual[z, -7.5e-231], t$95$2, If[LessEqual[z, 1.55e-128], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-61], t$95$2, If[LessEqual[z, 3.1e+62], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+279], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
t_2 := x + y \cdot t\\
\mathbf{if}\;z \leq -22000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-231}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-128}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+62}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+279}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.2e7 or 1.4999999999999999e279 < z Initial program 100.0%
Taylor expanded in y around 0 84.6%
mul-1-neg84.6%
distribute-lft-neg-out84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in t around 0 54.2%
if -2.2e7 < z < -7.5000000000000001e-231 or 1.55000000000000001e-128 < z < 3.60000000000000014e-61Initial program 99.9%
Taylor expanded in t around inf 88.8%
Taylor expanded in y around inf 68.9%
*-commutative68.9%
Simplified68.9%
if -7.5000000000000001e-231 < z < 1.55000000000000001e-128Initial program 100.0%
Taylor expanded in y around inf 98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around 0 78.1%
mul-1-neg78.1%
distribute-lft-neg-out78.1%
*-commutative78.1%
Simplified78.1%
if 3.60000000000000014e-61 < z < 3.10000000000000014e62Initial program 99.9%
Taylor expanded in y around inf 84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in x around inf 58.3%
mul-1-neg58.3%
unsub-neg58.3%
Simplified58.3%
if 3.10000000000000014e62 < z < 1.4999999999999999e279Initial program 100.0%
Taylor expanded in t around inf 60.0%
Taylor expanded in y around 0 52.1%
mul-1-neg52.1%
unsub-neg52.1%
*-commutative52.1%
Simplified52.1%
Final simplification63.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (* t (- z))))
(if (<= z -1.8e+146)
t_2
(if (<= z -2.8e-14)
(* y t)
(if (<= z -7.5e-106)
t_1
(if (<= z -6.2e-226) (* y t) (if (<= z 5.8e+71) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = t * -z;
double tmp;
if (z <= -1.8e+146) {
tmp = t_2;
} else if (z <= -2.8e-14) {
tmp = y * t;
} else if (z <= -7.5e-106) {
tmp = t_1;
} else if (z <= -6.2e-226) {
tmp = y * t;
} else if (z <= 5.8e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = t * -z
if (z <= (-1.8d+146)) then
tmp = t_2
else if (z <= (-2.8d-14)) then
tmp = y * t
else if (z <= (-7.5d-106)) then
tmp = t_1
else if (z <= (-6.2d-226)) then
tmp = y * t
else if (z <= 5.8d+71) then
tmp = t_1
else
tmp = t_2
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 = t * -z;
double tmp;
if (z <= -1.8e+146) {
tmp = t_2;
} else if (z <= -2.8e-14) {
tmp = y * t;
} else if (z <= -7.5e-106) {
tmp = t_1;
} else if (z <= -6.2e-226) {
tmp = y * t;
} else if (z <= 5.8e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = t * -z tmp = 0 if z <= -1.8e+146: tmp = t_2 elif z <= -2.8e-14: tmp = y * t elif z <= -7.5e-106: tmp = t_1 elif z <= -6.2e-226: tmp = y * t elif z <= 5.8e+71: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(t * Float64(-z)) tmp = 0.0 if (z <= -1.8e+146) tmp = t_2; elseif (z <= -2.8e-14) tmp = Float64(y * t); elseif (z <= -7.5e-106) tmp = t_1; elseif (z <= -6.2e-226) tmp = Float64(y * t); elseif (z <= 5.8e+71) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = t * -z; tmp = 0.0; if (z <= -1.8e+146) tmp = t_2; elseif (z <= -2.8e-14) tmp = y * t; elseif (z <= -7.5e-106) tmp = t_1; elseif (z <= -6.2e-226) tmp = y * t; elseif (z <= 5.8e+71) tmp = t_1; else tmp = t_2; 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[(t * (-z)), $MachinePrecision]}, If[LessEqual[z, -1.8e+146], t$95$2, If[LessEqual[z, -2.8e-14], N[(y * t), $MachinePrecision], If[LessEqual[z, -7.5e-106], t$95$1, If[LessEqual[z, -6.2e-226], N[(y * t), $MachinePrecision], If[LessEqual[z, 5.8e+71], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := t \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+146}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-14}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-226}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.7999999999999999e146 or 5.80000000000000014e71 < z Initial program 100.0%
Taylor expanded in t around inf 56.2%
Taylor expanded in y around 0 50.2%
mul-1-neg50.2%
unsub-neg50.2%
*-commutative50.2%
Simplified50.2%
Taylor expanded in x around 0 49.7%
associate-*r*49.7%
neg-mul-149.7%
Simplified49.7%
if -1.7999999999999999e146 < z < -2.8000000000000001e-14 or -7.5000000000000002e-106 < z < -6.19999999999999978e-226Initial program 100.0%
Taylor expanded in y around inf 61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in x around 0 48.7%
if -2.8000000000000001e-14 < z < -7.5000000000000002e-106 or -6.19999999999999978e-226 < z < 5.80000000000000014e71Initial program 100.0%
Taylor expanded in y around inf 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in x around inf 64.8%
mul-1-neg64.8%
unsub-neg64.8%
Simplified64.8%
Final simplification56.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* x z))))
(if (<= z -2.25e-46)
t_1
(if (<= z -2.45e-222)
(* y t)
(if (<= z 9.5e+78)
(* x (- 1.0 y))
(if (<= z 3.2e+279) (* t (- z)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double tmp;
if (z <= -2.25e-46) {
tmp = t_1;
} else if (z <= -2.45e-222) {
tmp = y * t;
} else if (z <= 9.5e+78) {
tmp = x * (1.0 - y);
} else if (z <= 3.2e+279) {
tmp = t * -z;
} 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 + (x * z)
if (z <= (-2.25d-46)) then
tmp = t_1
else if (z <= (-2.45d-222)) then
tmp = y * t
else if (z <= 9.5d+78) then
tmp = x * (1.0d0 - y)
else if (z <= 3.2d+279) then
tmp = t * -z
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 + (x * z);
double tmp;
if (z <= -2.25e-46) {
tmp = t_1;
} else if (z <= -2.45e-222) {
tmp = y * t;
} else if (z <= 9.5e+78) {
tmp = x * (1.0 - y);
} else if (z <= 3.2e+279) {
tmp = t * -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * z) tmp = 0 if z <= -2.25e-46: tmp = t_1 elif z <= -2.45e-222: tmp = y * t elif z <= 9.5e+78: tmp = x * (1.0 - y) elif z <= 3.2e+279: tmp = t * -z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * z)) tmp = 0.0 if (z <= -2.25e-46) tmp = t_1; elseif (z <= -2.45e-222) tmp = Float64(y * t); elseif (z <= 9.5e+78) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 3.2e+279) tmp = Float64(t * Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * z); tmp = 0.0; if (z <= -2.25e-46) tmp = t_1; elseif (z <= -2.45e-222) tmp = y * t; elseif (z <= 9.5e+78) tmp = x * (1.0 - y); elseif (z <= 3.2e+279) tmp = t * -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.25e-46], t$95$1, If[LessEqual[z, -2.45e-222], N[(y * t), $MachinePrecision], If[LessEqual[z, 9.5e+78], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+279], N[(t * (-z)), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{-46}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-222}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+78}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+279}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.25e-46 or 3.19999999999999988e279 < z Initial program 100.0%
Taylor expanded in y around 0 81.0%
mul-1-neg81.0%
distribute-lft-neg-out81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in t around 0 52.3%
if -2.25e-46 < z < -2.45e-222Initial program 100.0%
Taylor expanded in y around inf 78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in x around 0 54.8%
if -2.45e-222 < z < 9.5000000000000006e78Initial program 100.0%
Taylor expanded in y around inf 91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in x around inf 65.9%
mul-1-neg65.9%
unsub-neg65.9%
Simplified65.9%
if 9.5000000000000006e78 < z < 3.19999999999999988e279Initial program 100.0%
Taylor expanded in t around inf 60.0%
Taylor expanded in y around 0 52.1%
mul-1-neg52.1%
unsub-neg52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in x around 0 51.4%
associate-*r*51.4%
neg-mul-151.4%
Simplified51.4%
Final simplification58.3%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.55e+241)
(* x (- 1.0 y))
(if (<= x -1.75e+85)
(+ x (* x z))
(if (<= x 1.3e+21) (+ x (* t (- y z))) (- x (* x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.55e+241) {
tmp = x * (1.0 - y);
} else if (x <= -1.75e+85) {
tmp = x + (x * z);
} else if (x <= 1.3e+21) {
tmp = x + (t * (y - z));
} else {
tmp = x - (x * 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 <= (-1.55d+241)) then
tmp = x * (1.0d0 - y)
else if (x <= (-1.75d+85)) then
tmp = x + (x * z)
else if (x <= 1.3d+21) then
tmp = x + (t * (y - z))
else
tmp = x - (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.55e+241) {
tmp = x * (1.0 - y);
} else if (x <= -1.75e+85) {
tmp = x + (x * z);
} else if (x <= 1.3e+21) {
tmp = x + (t * (y - z));
} else {
tmp = x - (x * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.55e+241: tmp = x * (1.0 - y) elif x <= -1.75e+85: tmp = x + (x * z) elif x <= 1.3e+21: tmp = x + (t * (y - z)) else: tmp = x - (x * y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.55e+241) tmp = Float64(x * Float64(1.0 - y)); elseif (x <= -1.75e+85) tmp = Float64(x + Float64(x * z)); elseif (x <= 1.3e+21) tmp = Float64(x + Float64(t * Float64(y - z))); else tmp = Float64(x - Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.55e+241) tmp = x * (1.0 - y); elseif (x <= -1.75e+85) tmp = x + (x * z); elseif (x <= 1.3e+21) tmp = x + (t * (y - z)); else tmp = x - (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.55e+241], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.75e+85], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+21], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+241}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{+85}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+21}:\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot y\\
\end{array}
\end{array}
if x < -1.55e241Initial program 100.0%
Taylor expanded in y around inf 78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in x around inf 78.6%
mul-1-neg78.6%
unsub-neg78.6%
Simplified78.6%
if -1.55e241 < x < -1.75000000000000003e85Initial program 100.0%
Taylor expanded in y around 0 74.2%
mul-1-neg74.2%
distribute-lft-neg-out74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in t around 0 66.3%
if -1.75000000000000003e85 < x < 1.3e21Initial program 100.0%
Taylor expanded in t around inf 80.3%
if 1.3e21 < x Initial program 100.0%
Taylor expanded in y around inf 65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in t around 0 61.2%
mul-1-neg61.2%
distribute-lft-neg-out61.2%
*-commutative61.2%
Simplified61.2%
Final simplification73.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* z (- x t)))))
(if (<= z -26000000.0)
t_1
(if (<= z -2.05e-170)
(+ x (* t (- y z)))
(if (<= z 2.4e+106) (+ x (* y (- t x))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x + (z * (x - t));
double tmp;
if (z <= -26000000.0) {
tmp = t_1;
} else if (z <= -2.05e-170) {
tmp = x + (t * (y - z));
} else if (z <= 2.4e+106) {
tmp = x + (y * (t - x));
} 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 * (x - t))
if (z <= (-26000000.0d0)) then
tmp = t_1
else if (z <= (-2.05d-170)) then
tmp = x + (t * (y - z))
else if (z <= 2.4d+106) then
tmp = x + (y * (t - x))
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 * (x - t));
double tmp;
if (z <= -26000000.0) {
tmp = t_1;
} else if (z <= -2.05e-170) {
tmp = x + (t * (y - z));
} else if (z <= 2.4e+106) {
tmp = x + (y * (t - x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (z * (x - t)) tmp = 0 if z <= -26000000.0: tmp = t_1 elif z <= -2.05e-170: tmp = x + (t * (y - z)) elif z <= 2.4e+106: tmp = x + (y * (t - x)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(z * Float64(x - t))) tmp = 0.0 if (z <= -26000000.0) tmp = t_1; elseif (z <= -2.05e-170) tmp = Float64(x + Float64(t * Float64(y - z))); elseif (z <= 2.4e+106) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (z * (x - t)); tmp = 0.0; if (z <= -26000000.0) tmp = t_1; elseif (z <= -2.05e-170) tmp = x + (t * (y - z)); elseif (z <= 2.4e+106) tmp = x + (y * (t - x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -26000000.0], t$95$1, If[LessEqual[z, -2.05e-170], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e+106], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -26000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-170}:\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+106}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.6e7 or 2.4000000000000001e106 < z Initial program 100.0%
Taylor expanded in y around 0 89.1%
mul-1-neg89.1%
distribute-lft-neg-out89.1%
*-commutative89.1%
Simplified89.1%
distribute-rgt-neg-out89.1%
unsub-neg89.1%
Applied egg-rr89.1%
if -2.6e7 < z < -2.04999999999999983e-170Initial program 100.0%
Taylor expanded in t around inf 91.6%
if -2.04999999999999983e-170 < z < 2.4000000000000001e106Initial program 100.0%
Taylor expanded in y around inf 90.8%
*-commutative90.8%
Simplified90.8%
Final simplification90.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.5e+85) (not (<= x 1.16e+21))) (+ x (* x (- z y))) (+ x (* t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.5e+85) || !(x <= 1.16e+21)) {
tmp = x + (x * (z - y));
} else {
tmp = x + (t * (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-5.5d+85)) .or. (.not. (x <= 1.16d+21))) then
tmp = x + (x * (z - y))
else
tmp = x + (t * (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.5e+85) || !(x <= 1.16e+21)) {
tmp = x + (x * (z - y));
} else {
tmp = x + (t * (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.5e+85) or not (x <= 1.16e+21): tmp = x + (x * (z - y)) else: tmp = x + (t * (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -5.5e+85) || !(x <= 1.16e+21)) tmp = Float64(x + Float64(x * Float64(z - y))); else tmp = Float64(x + Float64(t * Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -5.5e+85) || ~((x <= 1.16e+21))) tmp = x + (x * (z - y)); else tmp = x + (t * (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.5e+85], N[Not[LessEqual[x, 1.16e+21]], $MachinePrecision]], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+85} \lor \neg \left(x \leq 1.16 \cdot 10^{+21}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\end{array}
\end{array}
if x < -5.50000000000000008e85 or 1.16e21 < x Initial program 100.0%
*-commutative100.0%
sub-neg100.0%
distribute-lft-in95.5%
fma-def98.2%
Applied egg-rr98.2%
Taylor expanded in t around 0 86.6%
mul-1-neg86.6%
distribute-rgt-neg-in86.6%
mul-1-neg86.6%
distribute-lft-in91.1%
+-commutative91.1%
mul-1-neg91.1%
sub-neg91.1%
Simplified91.1%
if -5.50000000000000008e85 < x < 1.16e21Initial program 100.0%
Taylor expanded in t around inf 80.3%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.06e+73) (not (<= y 3.5e-29))) (* y t) (* t (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.06e+73) || !(y <= 3.5e-29)) {
tmp = y * t;
} else {
tmp = t * -z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.06d+73)) .or. (.not. (y <= 3.5d-29))) then
tmp = y * t
else
tmp = t * -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.06e+73) || !(y <= 3.5e-29)) {
tmp = y * t;
} else {
tmp = t * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.06e+73) or not (y <= 3.5e-29): tmp = y * t else: tmp = t * -z return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.06e+73) || !(y <= 3.5e-29)) tmp = Float64(y * t); else tmp = Float64(t * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.06e+73) || ~((y <= 3.5e-29))) tmp = y * t; else tmp = t * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.06e+73], N[Not[LessEqual[y, 3.5e-29]], $MachinePrecision]], N[(y * t), $MachinePrecision], N[(t * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{+73} \lor \neg \left(y \leq 3.5 \cdot 10^{-29}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\end{array}
\end{array}
if y < -1.0600000000000001e73 or 3.4999999999999997e-29 < y Initial program 100.0%
Taylor expanded in y around inf 83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in x around 0 43.5%
if -1.0600000000000001e73 < y < 3.4999999999999997e-29Initial program 100.0%
Taylor expanded in t around inf 71.2%
Taylor expanded in y around 0 61.0%
mul-1-neg61.0%
unsub-neg61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in x around 0 38.4%
associate-*r*38.4%
neg-mul-138.4%
Simplified38.4%
Final simplification41.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.5e-57) (not (<= y 5.2e-63))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.5e-57) || !(y <= 5.2e-63)) {
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 <= (-6.5d-57)) .or. (.not. (y <= 5.2d-63))) 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 <= -6.5e-57) || !(y <= 5.2e-63)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.5e-57) or not (y <= 5.2e-63): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.5e-57) || !(y <= 5.2e-63)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.5e-57) || ~((y <= 5.2e-63))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.5e-57], N[Not[LessEqual[y, 5.2e-63]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-57} \lor \neg \left(y \leq 5.2 \cdot 10^{-63}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.49999999999999992e-57 or 5.2000000000000003e-63 < y Initial program 100.0%
Taylor expanded in y around inf 74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in x around 0 38.3%
if -6.49999999999999992e-57 < y < 5.2000000000000003e-63Initial program 100.0%
Taylor expanded in t around inf 77.4%
Taylor expanded in x around inf 30.7%
Final simplification35.6%
(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.6%
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 2023336
(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))))