
(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 (* (- 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
(let* ((t_1 (+ x (* y t))) (t_2 (- x (* z t))) (t_3 (* x (- y))))
(if (<= y -1.6e+119)
t_1
(if (<= y -6e+16)
t_3
(if (<= y -2.2e-86)
(* x (+ z 1.0))
(if (<= y -6e-174)
t_2
(if (<= y -1.16e-225)
(+ x (* x z))
(if (<= y 3400.0) t_2 (if (<= y 1.15e+203) t_1 t_3)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double t_2 = x - (z * t);
double t_3 = x * -y;
double tmp;
if (y <= -1.6e+119) {
tmp = t_1;
} else if (y <= -6e+16) {
tmp = t_3;
} else if (y <= -2.2e-86) {
tmp = x * (z + 1.0);
} else if (y <= -6e-174) {
tmp = t_2;
} else if (y <= -1.16e-225) {
tmp = x + (x * z);
} else if (y <= 3400.0) {
tmp = t_2;
} else if (y <= 1.15e+203) {
tmp = t_1;
} else {
tmp = t_3;
}
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 + (y * t)
t_2 = x - (z * t)
t_3 = x * -y
if (y <= (-1.6d+119)) then
tmp = t_1
else if (y <= (-6d+16)) then
tmp = t_3
else if (y <= (-2.2d-86)) then
tmp = x * (z + 1.0d0)
else if (y <= (-6d-174)) then
tmp = t_2
else if (y <= (-1.16d-225)) then
tmp = x + (x * z)
else if (y <= 3400.0d0) then
tmp = t_2
else if (y <= 1.15d+203) then
tmp = t_1
else
tmp = t_3
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 t_2 = x - (z * t);
double t_3 = x * -y;
double tmp;
if (y <= -1.6e+119) {
tmp = t_1;
} else if (y <= -6e+16) {
tmp = t_3;
} else if (y <= -2.2e-86) {
tmp = x * (z + 1.0);
} else if (y <= -6e-174) {
tmp = t_2;
} else if (y <= -1.16e-225) {
tmp = x + (x * z);
} else if (y <= 3400.0) {
tmp = t_2;
} else if (y <= 1.15e+203) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * t) t_2 = x - (z * t) t_3 = x * -y tmp = 0 if y <= -1.6e+119: tmp = t_1 elif y <= -6e+16: tmp = t_3 elif y <= -2.2e-86: tmp = x * (z + 1.0) elif y <= -6e-174: tmp = t_2 elif y <= -1.16e-225: tmp = x + (x * z) elif y <= 3400.0: tmp = t_2 elif y <= 1.15e+203: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * t)) t_2 = Float64(x - Float64(z * t)) t_3 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -1.6e+119) tmp = t_1; elseif (y <= -6e+16) tmp = t_3; elseif (y <= -2.2e-86) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= -6e-174) tmp = t_2; elseif (y <= -1.16e-225) tmp = Float64(x + Float64(x * z)); elseif (y <= 3400.0) tmp = t_2; elseif (y <= 1.15e+203) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * t); t_2 = x - (z * t); t_3 = x * -y; tmp = 0.0; if (y <= -1.6e+119) tmp = t_1; elseif (y <= -6e+16) tmp = t_3; elseif (y <= -2.2e-86) tmp = x * (z + 1.0); elseif (y <= -6e-174) tmp = t_2; elseif (y <= -1.16e-225) tmp = x + (x * z); elseif (y <= 3400.0) tmp = t_2; elseif (y <= 1.15e+203) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -1.6e+119], t$95$1, If[LessEqual[y, -6e+16], t$95$3, If[LessEqual[y, -2.2e-86], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6e-174], t$95$2, If[LessEqual[y, -1.16e-225], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3400.0], t$95$2, If[LessEqual[y, 1.15e+203], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot t\\
t_2 := x - z \cdot t\\
t_3 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6 \cdot 10^{+16}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-86}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-174}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{-225}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -1.59999999999999995e119 or 3400 < y < 1.15e203Initial program 100.0%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
*-commutative86.2%
associate-/l*88.5%
distribute-lft-out88.5%
Simplified88.5%
Taylor expanded in t around inf 58.3%
Taylor expanded in z around 0 57.3%
*-commutative57.3%
Simplified57.3%
if -1.59999999999999995e119 < y < -6e16 or 1.15e203 < y Initial program 100.0%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x around inf 65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 65.5%
mul-1-neg65.5%
distribute-rgt-neg-out65.5%
Simplified65.5%
if -6e16 < y < -2.2000000000000002e-86Initial program 100.0%
Taylor expanded in y around 0 75.3%
mul-1-neg75.3%
distribute-rgt-neg-in75.3%
sub-neg75.3%
+-commutative75.3%
distribute-neg-in75.3%
remove-double-neg75.3%
sub-neg75.3%
Simplified75.3%
sub-neg75.3%
distribute-lft-in75.3%
Applied egg-rr75.3%
Taylor expanded in x around inf 57.3%
*-commutative57.3%
distribute-rgt1-in57.3%
Applied egg-rr57.3%
if -2.2000000000000002e-86 < y < -6.00000000000000042e-174 or -1.16000000000000001e-225 < y < 3400Initial program 100.0%
Taylor expanded in z around inf 98.0%
*-commutative98.0%
*-commutative98.0%
associate-/l*98.0%
distribute-lft-out98.0%
Simplified98.0%
Taylor expanded in t around inf 84.0%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
Simplified81.8%
if -6.00000000000000042e-174 < y < -1.16000000000000001e-225Initial program 100.0%
Taylor expanded in y around 0 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
sub-neg100.0%
distribute-lft-in100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 89.1%
Final simplification69.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= y -5.3e+119)
(* y t)
(if (<= y -5.6e+16)
t_1
(if (<= y -6.6e-26)
(* y t)
(if (<= y 3400.0) x (if (<= y 4.9e+204) (* y t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -5.3e+119) {
tmp = y * t;
} else if (y <= -5.6e+16) {
tmp = t_1;
} else if (y <= -6.6e-26) {
tmp = y * t;
} else if (y <= 3400.0) {
tmp = x;
} else if (y <= 4.9e+204) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * -y
if (y <= (-5.3d+119)) then
tmp = y * t
else if (y <= (-5.6d+16)) then
tmp = t_1
else if (y <= (-6.6d-26)) then
tmp = y * t
else if (y <= 3400.0d0) then
tmp = x
else if (y <= 4.9d+204) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -5.3e+119) {
tmp = y * t;
} else if (y <= -5.6e+16) {
tmp = t_1;
} else if (y <= -6.6e-26) {
tmp = y * t;
} else if (y <= 3400.0) {
tmp = x;
} else if (y <= 4.9e+204) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -y tmp = 0 if y <= -5.3e+119: tmp = y * t elif y <= -5.6e+16: tmp = t_1 elif y <= -6.6e-26: tmp = y * t elif y <= 3400.0: tmp = x elif y <= 4.9e+204: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -5.3e+119) tmp = Float64(y * t); elseif (y <= -5.6e+16) tmp = t_1; elseif (y <= -6.6e-26) tmp = Float64(y * t); elseif (y <= 3400.0) tmp = x; elseif (y <= 4.9e+204) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -y; tmp = 0.0; if (y <= -5.3e+119) tmp = y * t; elseif (y <= -5.6e+16) tmp = t_1; elseif (y <= -6.6e-26) tmp = y * t; elseif (y <= 3400.0) tmp = x; elseif (y <= 4.9e+204) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -5.3e+119], N[(y * t), $MachinePrecision], If[LessEqual[y, -5.6e+16], t$95$1, If[LessEqual[y, -6.6e-26], N[(y * t), $MachinePrecision], If[LessEqual[y, 3400.0], x, If[LessEqual[y, 4.9e+204], N[(y * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -5.3 \cdot 10^{+119}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.6 \cdot 10^{-26}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+204}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.29999999999999972e119 or -5.6e16 < y < -6.5999999999999997e-26 or 3400 < y < 4.8999999999999997e204Initial program 100.0%
Taylor expanded in z around inf 84.8%
*-commutative84.8%
*-commutative84.8%
associate-/l*86.8%
distribute-lft-out86.8%
Simplified86.8%
Taylor expanded in t around inf 55.9%
Taylor expanded in z around 0 56.2%
*-commutative56.2%
Simplified56.2%
Taylor expanded in x around 0 55.9%
if -5.29999999999999972e119 < y < -5.6e16 or 4.8999999999999997e204 < y Initial program 100.0%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x around inf 65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 65.5%
mul-1-neg65.5%
distribute-rgt-neg-out65.5%
Simplified65.5%
if -6.5999999999999997e-26 < y < 3400Initial program 100.0%
Taylor expanded in y around inf 31.9%
*-commutative31.9%
Simplified31.9%
Taylor expanded in y around 0 29.6%
Final simplification44.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* (- y z) t))) (t_2 (+ x (* z (- x t)))))
(if (<= z -2e-8)
t_2
(if (<= z 4.05e-35)
t_1
(if (<= z 1.95e-19) (* x (- 1.0 y)) (if (<= z 3.25e+27) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double t_2 = x + (z * (x - t));
double tmp;
if (z <= -2e-8) {
tmp = t_2;
} else if (z <= 4.05e-35) {
tmp = t_1;
} else if (z <= 1.95e-19) {
tmp = x * (1.0 - y);
} else if (z <= 3.25e+27) {
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 + ((y - z) * t)
t_2 = x + (z * (x - t))
if (z <= (-2d-8)) then
tmp = t_2
else if (z <= 4.05d-35) then
tmp = t_1
else if (z <= 1.95d-19) then
tmp = x * (1.0d0 - y)
else if (z <= 3.25d+27) 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 + ((y - z) * t);
double t_2 = x + (z * (x - t));
double tmp;
if (z <= -2e-8) {
tmp = t_2;
} else if (z <= 4.05e-35) {
tmp = t_1;
} else if (z <= 1.95e-19) {
tmp = x * (1.0 - y);
} else if (z <= 3.25e+27) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y - z) * t) t_2 = x + (z * (x - t)) tmp = 0 if z <= -2e-8: tmp = t_2 elif z <= 4.05e-35: tmp = t_1 elif z <= 1.95e-19: tmp = x * (1.0 - y) elif z <= 3.25e+27: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y - z) * t)) t_2 = Float64(x + Float64(z * Float64(x - t))) tmp = 0.0 if (z <= -2e-8) tmp = t_2; elseif (z <= 4.05e-35) tmp = t_1; elseif (z <= 1.95e-19) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 3.25e+27) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y - z) * t); t_2 = x + (z * (x - t)); tmp = 0.0; if (z <= -2e-8) tmp = t_2; elseif (z <= 4.05e-35) tmp = t_1; elseif (z <= 1.95e-19) tmp = x * (1.0 - y); elseif (z <= 3.25e+27) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e-8], t$95$2, If[LessEqual[z, 4.05e-35], t$95$1, If[LessEqual[z, 1.95e-19], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.25e+27], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot t\\
t_2 := x + z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{-8}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4.05 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-19}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 3.25 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2e-8 or 3.2500000000000002e27 < z Initial program 100.0%
Taylor expanded in y around 0 82.6%
mul-1-neg82.6%
distribute-rgt-neg-in82.6%
sub-neg82.6%
+-commutative82.6%
distribute-neg-in82.6%
remove-double-neg82.6%
sub-neg82.6%
Simplified82.6%
if -2e-8 < z < 4.05000000000000015e-35 or 1.94999999999999998e-19 < z < 3.2500000000000002e27Initial program 100.0%
Taylor expanded in t around inf 79.2%
if 4.05000000000000015e-35 < z < 1.94999999999999998e-19Initial program 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification81.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y t))) (t_2 (* x (- y))))
(if (<= y -7.4e+118)
t_1
(if (<= y -2.9e+16)
t_2
(if (<= y 3400.0) (+ x (* x z)) (if (<= y 1.02e+204) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double t_2 = x * -y;
double tmp;
if (y <= -7.4e+118) {
tmp = t_1;
} else if (y <= -2.9e+16) {
tmp = t_2;
} else if (y <= 3400.0) {
tmp = x + (x * z);
} else if (y <= 1.02e+204) {
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 + (y * t)
t_2 = x * -y
if (y <= (-7.4d+118)) then
tmp = t_1
else if (y <= (-2.9d+16)) then
tmp = t_2
else if (y <= 3400.0d0) then
tmp = x + (x * z)
else if (y <= 1.02d+204) 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 + (y * t);
double t_2 = x * -y;
double tmp;
if (y <= -7.4e+118) {
tmp = t_1;
} else if (y <= -2.9e+16) {
tmp = t_2;
} else if (y <= 3400.0) {
tmp = x + (x * z);
} else if (y <= 1.02e+204) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * t) t_2 = x * -y tmp = 0 if y <= -7.4e+118: tmp = t_1 elif y <= -2.9e+16: tmp = t_2 elif y <= 3400.0: tmp = x + (x * z) elif y <= 1.02e+204: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * t)) t_2 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -7.4e+118) tmp = t_1; elseif (y <= -2.9e+16) tmp = t_2; elseif (y <= 3400.0) tmp = Float64(x + Float64(x * z)); elseif (y <= 1.02e+204) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * t); t_2 = x * -y; tmp = 0.0; if (y <= -7.4e+118) tmp = t_1; elseif (y <= -2.9e+16) tmp = t_2; elseif (y <= 3400.0) tmp = x + (x * z); elseif (y <= 1.02e+204) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -7.4e+118], t$95$1, If[LessEqual[y, -2.9e+16], t$95$2, If[LessEqual[y, 3400.0], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+204], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot t\\
t_2 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{+118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.39999999999999973e118 or 3400 < y < 1.02e204Initial program 100.0%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
*-commutative86.2%
associate-/l*88.5%
distribute-lft-out88.5%
Simplified88.5%
Taylor expanded in t around inf 58.3%
Taylor expanded in z around 0 57.3%
*-commutative57.3%
Simplified57.3%
if -7.39999999999999973e118 < y < -2.9e16 or 1.02e204 < y Initial program 100.0%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x around inf 65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 65.5%
mul-1-neg65.5%
distribute-rgt-neg-out65.5%
Simplified65.5%
if -2.9e16 < y < 3400Initial program 100.0%
Taylor expanded in y around 0 93.1%
mul-1-neg93.1%
distribute-rgt-neg-in93.1%
sub-neg93.1%
+-commutative93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
sub-neg93.1%
Simplified93.1%
sub-neg93.1%
distribute-lft-in89.4%
Applied egg-rr89.4%
Taylor expanded in x around inf 52.8%
Final simplification56.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= y -2e+120)
(* y t)
(if (<= y -2.6e+17)
t_1
(if (<= y 3400.0) (* x (+ z 1.0)) (if (<= y 3.6e+205) (* y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -2e+120) {
tmp = y * t;
} else if (y <= -2.6e+17) {
tmp = t_1;
} else if (y <= 3400.0) {
tmp = x * (z + 1.0);
} else if (y <= 3.6e+205) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * -y
if (y <= (-2d+120)) then
tmp = y * t
else if (y <= (-2.6d+17)) then
tmp = t_1
else if (y <= 3400.0d0) then
tmp = x * (z + 1.0d0)
else if (y <= 3.6d+205) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -2e+120) {
tmp = y * t;
} else if (y <= -2.6e+17) {
tmp = t_1;
} else if (y <= 3400.0) {
tmp = x * (z + 1.0);
} else if (y <= 3.6e+205) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -y tmp = 0 if y <= -2e+120: tmp = y * t elif y <= -2.6e+17: tmp = t_1 elif y <= 3400.0: tmp = x * (z + 1.0) elif y <= 3.6e+205: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -2e+120) tmp = Float64(y * t); elseif (y <= -2.6e+17) tmp = t_1; elseif (y <= 3400.0) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 3.6e+205) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -y; tmp = 0.0; if (y <= -2e+120) tmp = y * t; elseif (y <= -2.6e+17) tmp = t_1; elseif (y <= 3400.0) tmp = x * (z + 1.0); elseif (y <= 3.6e+205) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -2e+120], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.6e+17], t$95$1, If[LessEqual[y, 3400.0], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+205], N[(y * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{+120}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+205}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2e120 or 3400 < y < 3.60000000000000002e205Initial program 100.0%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
*-commutative86.2%
associate-/l*88.5%
distribute-lft-out88.5%
Simplified88.5%
Taylor expanded in t around inf 58.3%
Taylor expanded in z around 0 57.3%
*-commutative57.3%
Simplified57.3%
Taylor expanded in x around 0 56.9%
if -2e120 < y < -2.6e17 or 3.60000000000000002e205 < y Initial program 100.0%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x around inf 65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 65.5%
mul-1-neg65.5%
distribute-rgt-neg-out65.5%
Simplified65.5%
if -2.6e17 < y < 3400Initial program 100.0%
Taylor expanded in y around 0 93.1%
mul-1-neg93.1%
distribute-rgt-neg-in93.1%
sub-neg93.1%
+-commutative93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
sub-neg93.1%
Simplified93.1%
sub-neg93.1%
distribute-lft-in89.4%
Applied egg-rr89.4%
Taylor expanded in x around inf 52.8%
*-commutative52.8%
distribute-rgt1-in52.8%
Applied egg-rr52.8%
Final simplification56.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= y -1.7e+119)
(* y t)
(if (<= y -2.15e+17)
t_1
(if (<= y 3400.0) (+ x (* x z)) (if (<= y 4.6e+201) (* y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -1.7e+119) {
tmp = y * t;
} else if (y <= -2.15e+17) {
tmp = t_1;
} else if (y <= 3400.0) {
tmp = x + (x * z);
} else if (y <= 4.6e+201) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * -y
if (y <= (-1.7d+119)) then
tmp = y * t
else if (y <= (-2.15d+17)) then
tmp = t_1
else if (y <= 3400.0d0) then
tmp = x + (x * z)
else if (y <= 4.6d+201) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -1.7e+119) {
tmp = y * t;
} else if (y <= -2.15e+17) {
tmp = t_1;
} else if (y <= 3400.0) {
tmp = x + (x * z);
} else if (y <= 4.6e+201) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -y tmp = 0 if y <= -1.7e+119: tmp = y * t elif y <= -2.15e+17: tmp = t_1 elif y <= 3400.0: tmp = x + (x * z) elif y <= 4.6e+201: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -1.7e+119) tmp = Float64(y * t); elseif (y <= -2.15e+17) tmp = t_1; elseif (y <= 3400.0) tmp = Float64(x + Float64(x * z)); elseif (y <= 4.6e+201) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -y; tmp = 0.0; if (y <= -1.7e+119) tmp = y * t; elseif (y <= -2.15e+17) tmp = t_1; elseif (y <= 3400.0) tmp = x + (x * z); elseif (y <= 4.6e+201) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -1.7e+119], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.15e+17], t$95$1, If[LessEqual[y, 3400.0], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+201], N[(y * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+119}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.15 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+201}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.70000000000000007e119 or 3400 < y < 4.6000000000000002e201Initial program 100.0%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
*-commutative86.2%
associate-/l*88.5%
distribute-lft-out88.5%
Simplified88.5%
Taylor expanded in t around inf 58.3%
Taylor expanded in z around 0 57.3%
*-commutative57.3%
Simplified57.3%
Taylor expanded in x around 0 56.9%
if -1.70000000000000007e119 < y < -2.15e17 or 4.6000000000000002e201 < y Initial program 100.0%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x around inf 65.5%
mul-1-neg65.5%
unsub-neg65.5%
Simplified65.5%
Taylor expanded in y around inf 65.5%
mul-1-neg65.5%
distribute-rgt-neg-out65.5%
Simplified65.5%
if -2.15e17 < y < 3400Initial program 100.0%
Taylor expanded in y around 0 93.1%
mul-1-neg93.1%
distribute-rgt-neg-in93.1%
sub-neg93.1%
+-commutative93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
sub-neg93.1%
Simplified93.1%
sub-neg93.1%
distribute-lft-in89.4%
Applied egg-rr89.4%
Taylor expanded in x around inf 52.8%
Final simplification56.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.08e-20) (not (<= z 2.05e+36))) (+ x (* z (- x t))) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.08e-20) || !(z <= 2.05e+36)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.08d-20)) .or. (.not. (z <= 2.05d+36))) then
tmp = x + (z * (x - t))
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.08e-20) || !(z <= 2.05e+36)) {
tmp = x + (z * (x - t));
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.08e-20) or not (z <= 2.05e+36): tmp = x + (z * (x - t)) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.08e-20) || !(z <= 2.05e+36)) tmp = Float64(x + Float64(z * Float64(x - t))); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.08e-20) || ~((z <= 2.05e+36))) tmp = x + (z * (x - t)); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.08e-20], N[Not[LessEqual[z, 2.05e+36]], $MachinePrecision]], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{-20} \lor \neg \left(z \leq 2.05 \cdot 10^{+36}\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -1.08e-20 or 2.05000000000000006e36 < z Initial program 100.0%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
distribute-rgt-neg-in83.2%
sub-neg83.2%
+-commutative83.2%
distribute-neg-in83.2%
remove-double-neg83.2%
sub-neg83.2%
Simplified83.2%
if -1.08e-20 < z < 2.05000000000000006e36Initial program 100.0%
Taylor expanded in y around inf 91.3%
*-commutative91.3%
Simplified91.3%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (<= x -2.16e+189) (* x (- 1.0 y)) (if (<= x 3.5e+126) (+ x (* (- y z) t)) (* x (+ z 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.16e+189) {
tmp = x * (1.0 - y);
} else if (x <= 3.5e+126) {
tmp = x + ((y - z) * 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) :: tmp
if (x <= (-2.16d+189)) then
tmp = x * (1.0d0 - y)
else if (x <= 3.5d+126) then
tmp = x + ((y - z) * 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 tmp;
if (x <= -2.16e+189) {
tmp = x * (1.0 - y);
} else if (x <= 3.5e+126) {
tmp = x + ((y - z) * t);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.16e+189: tmp = x * (1.0 - y) elif x <= 3.5e+126: tmp = x + ((y - z) * t) else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.16e+189) tmp = Float64(x * Float64(1.0 - y)); elseif (x <= 3.5e+126) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.16e+189) tmp = x * (1.0 - y); elseif (x <= 3.5e+126) tmp = x + ((y - z) * t); else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.16e+189], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+126], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.16 \cdot 10^{+189}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+126}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if x < -2.16e189Initial program 100.0%
Taylor expanded in y around inf 79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in x around inf 79.2%
mul-1-neg79.2%
unsub-neg79.2%
Simplified79.2%
if -2.16e189 < x < 3.5000000000000003e126Initial program 100.0%
Taylor expanded in t around inf 75.8%
if 3.5000000000000003e126 < x Initial program 100.0%
Taylor expanded in y around 0 69.4%
mul-1-neg69.4%
distribute-rgt-neg-in69.4%
sub-neg69.4%
+-commutative69.4%
distribute-neg-in69.4%
remove-double-neg69.4%
sub-neg69.4%
Simplified69.4%
sub-neg69.4%
distribute-lft-in62.7%
Applied egg-rr62.7%
Taylor expanded in x around inf 60.0%
*-commutative60.0%
distribute-rgt1-in60.0%
Applied egg-rr60.0%
Final simplification73.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.02e-141) (not (<= x 2.2e-108))) (* x (- 1.0 y)) (* y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.02e-141) || !(x <= 2.2e-108)) {
tmp = x * (1.0 - y);
} 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 ((x <= (-1.02d-141)) .or. (.not. (x <= 2.2d-108))) then
tmp = x * (1.0d0 - y)
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 ((x <= -1.02e-141) || !(x <= 2.2e-108)) {
tmp = x * (1.0 - y);
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.02e-141) or not (x <= 2.2e-108): tmp = x * (1.0 - y) else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.02e-141) || !(x <= 2.2e-108)) tmp = Float64(x * Float64(1.0 - y)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.02e-141) || ~((x <= 2.2e-108))) tmp = x * (1.0 - y); else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.02e-141], N[Not[LessEqual[x, 2.2e-108]], $MachinePrecision]], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(y * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-141} \lor \neg \left(x \leq 2.2 \cdot 10^{-108}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if x < -1.02e-141 or 2.2000000000000001e-108 < x Initial program 100.0%
Taylor expanded in y around inf 58.2%
*-commutative58.2%
Simplified58.2%
Taylor expanded in x around inf 45.7%
mul-1-neg45.7%
unsub-neg45.7%
Simplified45.7%
if -1.02e-141 < x < 2.2000000000000001e-108Initial program 100.0%
Taylor expanded in z around inf 88.7%
*-commutative88.7%
*-commutative88.7%
associate-/l*86.5%
distribute-lft-out86.5%
Simplified86.5%
Taylor expanded in t around inf 78.7%
Taylor expanded in z around 0 54.2%
*-commutative54.2%
Simplified54.2%
Taylor expanded in x around 0 47.4%
Final simplification46.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.7e-25) (not (<= y 3400.0))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.7e-25) || !(y <= 3400.0)) {
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 <= (-1.7d-25)) .or. (.not. (y <= 3400.0d0))) 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 <= -1.7e-25) || !(y <= 3400.0)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.7e-25) or not (y <= 3400.0): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.7e-25) || !(y <= 3400.0)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.7e-25) || ~((y <= 3400.0))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.7e-25], N[Not[LessEqual[y, 3400.0]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-25} \lor \neg \left(y \leq 3400\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.70000000000000001e-25 or 3400 < y Initial program 100.0%
Taylor expanded in z around inf 83.0%
*-commutative83.0%
*-commutative83.0%
associate-/l*83.0%
distribute-lft-out83.0%
Simplified83.0%
Taylor expanded in t around inf 47.4%
Taylor expanded in z around 0 49.0%
*-commutative49.0%
Simplified49.0%
Taylor expanded in x around 0 48.7%
if -1.70000000000000001e-25 < y < 3400Initial program 100.0%
Taylor expanded in y around inf 31.9%
*-commutative31.9%
Simplified31.9%
Taylor expanded in y around 0 29.6%
Final simplification39.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 y around inf 57.6%
*-commutative57.6%
Simplified57.6%
Taylor expanded in y around 0 15.6%
Final simplification15.6%
(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 2024060
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))