
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= (- y z) -4e-11)
t_1
(if (<= (- y z) 1e-78)
x
(if (<= (- y z) 4e+222)
t_1
(if (<= (- y z) 4e+248)
(* y (- x))
(if (<= (- y z) 5e+279) t_1 (* z x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -4e-11) {
tmp = t_1;
} else if ((y - z) <= 1e-78) {
tmp = x;
} else if ((y - z) <= 4e+222) {
tmp = t_1;
} else if ((y - z) <= 4e+248) {
tmp = y * -x;
} else if ((y - z) <= 5e+279) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y - z) * t
if ((y - z) <= (-4d-11)) then
tmp = t_1
else if ((y - z) <= 1d-78) then
tmp = x
else if ((y - z) <= 4d+222) then
tmp = t_1
else if ((y - z) <= 4d+248) then
tmp = y * -x
else if ((y - z) <= 5d+279) then
tmp = t_1
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if ((y - z) <= -4e-11) {
tmp = t_1;
} else if ((y - z) <= 1e-78) {
tmp = x;
} else if ((y - z) <= 4e+222) {
tmp = t_1;
} else if ((y - z) <= 4e+248) {
tmp = y * -x;
} else if ((y - z) <= 5e+279) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if (y - z) <= -4e-11: tmp = t_1 elif (y - z) <= 1e-78: tmp = x elif (y - z) <= 4e+222: tmp = t_1 elif (y - z) <= 4e+248: tmp = y * -x elif (y - z) <= 5e+279: tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (Float64(y - z) <= -4e-11) tmp = t_1; elseif (Float64(y - z) <= 1e-78) tmp = x; elseif (Float64(y - z) <= 4e+222) tmp = t_1; elseif (Float64(y - z) <= 4e+248) tmp = Float64(y * Float64(-x)); elseif (Float64(y - z) <= 5e+279) tmp = t_1; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if ((y - z) <= -4e-11) tmp = t_1; elseif ((y - z) <= 1e-78) tmp = x; elseif ((y - z) <= 4e+222) tmp = t_1; elseif ((y - z) <= 4e+248) tmp = y * -x; elseif ((y - z) <= 5e+279) tmp = t_1; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -4e-11], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 1e-78], x, If[LessEqual[N[(y - z), $MachinePrecision], 4e+222], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 4e+248], N[(y * (-x)), $MachinePrecision], If[LessEqual[N[(y - z), $MachinePrecision], 5e+279], t$95$1, N[(z * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y - z \leq -4 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y - z \leq 10^{-78}:\\
\;\;\;\;x\\
\mathbf{elif}\;y - z \leq 4 \cdot 10^{+222}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y - z \leq 4 \cdot 10^{+248}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;y - z \leq 5 \cdot 10^{+279}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if (-.f64 y z) < -3.99999999999999976e-11 or 9.99999999999999999e-79 < (-.f64 y z) < 4.0000000000000002e222 or 4.00000000000000018e248 < (-.f64 y z) < 5.0000000000000002e279Initial program 100.0%
Taylor expanded in x around -inf 95.8%
+-commutative95.8%
mul-1-neg95.8%
unsub-neg95.8%
sub-neg95.8%
+-commutative95.8%
distribute-neg-in95.8%
metadata-eval95.8%
associate-+l+95.8%
+-commutative95.8%
sub-neg95.8%
Simplified95.8%
Taylor expanded in t around inf 58.5%
if -3.99999999999999976e-11 < (-.f64 y z) < 9.99999999999999999e-79Initial program 100.0%
Taylor expanded in x around -inf 83.4%
mul-1-neg83.4%
*-commutative83.4%
distribute-rgt-neg-in83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in y around 0 83.4%
Taylor expanded in z around 0 83.3%
if 4.0000000000000002e222 < (-.f64 y z) < 4.00000000000000018e248Initial program 100.0%
Taylor expanded in x around -inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 74.1%
if 5.0000000000000002e279 < (-.f64 y z) Initial program 100.0%
Taylor expanded in x around inf 84.9%
mul-1-neg84.9%
unsub-neg84.9%
distribute-lft-out--84.9%
*-rgt-identity84.9%
Simplified84.9%
Taylor expanded in z around inf 61.9%
Final simplification63.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z 1.0))) (t_2 (* y (- t x))) (t_3 (- x (* z t))))
(if (<= y -1.8e+42)
t_2
(if (<= y -1e-209)
t_3
(if (<= y 2.7e-296)
t_1
(if (<= y 1.6e-192) t_3 (if (<= y 2.1e-10) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double t_2 = y * (t - x);
double t_3 = x - (z * t);
double tmp;
if (y <= -1.8e+42) {
tmp = t_2;
} else if (y <= -1e-209) {
tmp = t_3;
} else if (y <= 2.7e-296) {
tmp = t_1;
} else if (y <= 1.6e-192) {
tmp = t_3;
} else if (y <= 2.1e-10) {
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) :: t_3
real(8) :: tmp
t_1 = x * (z + 1.0d0)
t_2 = y * (t - x)
t_3 = x - (z * t)
if (y <= (-1.8d+42)) then
tmp = t_2
else if (y <= (-1d-209)) then
tmp = t_3
else if (y <= 2.7d-296) then
tmp = t_1
else if (y <= 1.6d-192) then
tmp = t_3
else if (y <= 2.1d-10) 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 * (z + 1.0);
double t_2 = y * (t - x);
double t_3 = x - (z * t);
double tmp;
if (y <= -1.8e+42) {
tmp = t_2;
} else if (y <= -1e-209) {
tmp = t_3;
} else if (y <= 2.7e-296) {
tmp = t_1;
} else if (y <= 1.6e-192) {
tmp = t_3;
} else if (y <= 2.1e-10) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + 1.0) t_2 = y * (t - x) t_3 = x - (z * t) tmp = 0 if y <= -1.8e+42: tmp = t_2 elif y <= -1e-209: tmp = t_3 elif y <= 2.7e-296: tmp = t_1 elif y <= 1.6e-192: tmp = t_3 elif y <= 2.1e-10: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + 1.0)) t_2 = Float64(y * Float64(t - x)) t_3 = Float64(x - Float64(z * t)) tmp = 0.0 if (y <= -1.8e+42) tmp = t_2; elseif (y <= -1e-209) tmp = t_3; elseif (y <= 2.7e-296) tmp = t_1; elseif (y <= 1.6e-192) tmp = t_3; elseif (y <= 2.1e-10) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + 1.0); t_2 = y * (t - x); t_3 = x - (z * t); tmp = 0.0; if (y <= -1.8e+42) tmp = t_2; elseif (y <= -1e-209) tmp = t_3; elseif (y <= 2.7e-296) tmp = t_1; elseif (y <= 1.6e-192) tmp = t_3; elseif (y <= 2.1e-10) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+42], t$95$2, If[LessEqual[y, -1e-209], t$95$3, If[LessEqual[y, 2.7e-296], t$95$1, If[LessEqual[y, 1.6e-192], t$95$3, If[LessEqual[y, 2.1e-10], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + 1\right)\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := x - z \cdot t\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+42}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-209}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-296}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-192}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.8e42 or 2.1e-10 < y Initial program 100.0%
Taylor expanded in x around -inf 93.9%
+-commutative93.9%
mul-1-neg93.9%
unsub-neg93.9%
sub-neg93.9%
+-commutative93.9%
distribute-neg-in93.9%
metadata-eval93.9%
associate-+l+93.9%
+-commutative93.9%
sub-neg93.9%
Simplified93.9%
Taylor expanded in y around inf 86.6%
if -1.8e42 < y < -1e-209 or 2.69999999999999999e-296 < y < 1.6000000000000001e-192Initial program 100.0%
Taylor expanded in t around inf 81.3%
Taylor expanded in y around 0 79.5%
mul-1-neg79.5%
*-commutative79.5%
distribute-rgt-neg-in79.5%
Simplified79.5%
if -1e-209 < y < 2.69999999999999999e-296 or 1.6000000000000001e-192 < y < 2.1e-10Initial program 100.0%
Taylor expanded in x around -inf 71.9%
mul-1-neg71.9%
*-commutative71.9%
distribute-rgt-neg-in71.9%
+-commutative71.9%
Simplified71.9%
Taylor expanded in y around 0 71.6%
Final simplification80.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* (- y z) t))))
(if (<= y -2e+42)
t_1
(if (<= y -1.2e-208)
t_2
(if (<= y 8.6e-296) (* x (+ z 1.0)) (if (<= y 2.25e+24) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -2e+42) {
tmp = t_1;
} else if (y <= -1.2e-208) {
tmp = t_2;
} else if (y <= 8.6e-296) {
tmp = x * (z + 1.0);
} else if (y <= 2.25e+24) {
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 * (t - x)
t_2 = x + ((y - z) * t)
if (y <= (-2d+42)) then
tmp = t_1
else if (y <= (-1.2d-208)) then
tmp = t_2
else if (y <= 8.6d-296) then
tmp = x * (z + 1.0d0)
else if (y <= 2.25d+24) 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 * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -2e+42) {
tmp = t_1;
} else if (y <= -1.2e-208) {
tmp = t_2;
} else if (y <= 8.6e-296) {
tmp = x * (z + 1.0);
} else if (y <= 2.25e+24) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + ((y - z) * t) tmp = 0 if y <= -2e+42: tmp = t_1 elif y <= -1.2e-208: tmp = t_2 elif y <= 8.6e-296: tmp = x * (z + 1.0) elif y <= 2.25e+24: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (y <= -2e+42) tmp = t_1; elseif (y <= -1.2e-208) tmp = t_2; elseif (y <= 8.6e-296) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 2.25e+24) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x + ((y - z) * t); tmp = 0.0; if (y <= -2e+42) tmp = t_1; elseif (y <= -1.2e-208) tmp = t_2; elseif (y <= 8.6e-296) tmp = x * (z + 1.0); elseif (y <= 2.25e+24) tmp = t_2; 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[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+42], t$95$1, If[LessEqual[y, -1.2e-208], t$95$2, If[LessEqual[y, 8.6e-296], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e+24], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -2 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-208}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-296}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+24}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.00000000000000009e42 or 2.2500000000000001e24 < y Initial program 100.0%
Taylor expanded in x around -inf 93.5%
+-commutative93.5%
mul-1-neg93.5%
unsub-neg93.5%
sub-neg93.5%
+-commutative93.5%
distribute-neg-in93.5%
metadata-eval93.5%
associate-+l+93.5%
+-commutative93.5%
sub-neg93.5%
Simplified93.5%
Taylor expanded in y around inf 88.9%
if -2.00000000000000009e42 < y < -1.1999999999999999e-208 or 8.59999999999999956e-296 < y < 2.2500000000000001e24Initial program 100.0%
Taylor expanded in t around inf 76.1%
if -1.1999999999999999e-208 < y < 8.59999999999999956e-296Initial program 99.9%
Taylor expanded in x around -inf 83.8%
mul-1-neg83.8%
*-commutative83.8%
distribute-rgt-neg-in83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in y around 0 83.8%
Final simplification83.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* (- y z) t))))
(if (<= y -2.1e+42)
(* y (- t x))
(if (<= y -2.05e-209)
t_1
(if (<= y 3.1e-295)
(* x (+ z 1.0))
(if (<= y 1.9e-13) t_1 (- x (* y (- x t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double tmp;
if (y <= -2.1e+42) {
tmp = y * (t - x);
} else if (y <= -2.05e-209) {
tmp = t_1;
} else if (y <= 3.1e-295) {
tmp = x * (z + 1.0);
} else if (y <= 1.9e-13) {
tmp = t_1;
} else {
tmp = x - (y * (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) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * t)
if (y <= (-2.1d+42)) then
tmp = y * (t - x)
else if (y <= (-2.05d-209)) then
tmp = t_1
else if (y <= 3.1d-295) then
tmp = x * (z + 1.0d0)
else if (y <= 1.9d-13) then
tmp = t_1
else
tmp = x - (y * (x - t))
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 tmp;
if (y <= -2.1e+42) {
tmp = y * (t - x);
} else if (y <= -2.05e-209) {
tmp = t_1;
} else if (y <= 3.1e-295) {
tmp = x * (z + 1.0);
} else if (y <= 1.9e-13) {
tmp = t_1;
} else {
tmp = x - (y * (x - t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y - z) * t) tmp = 0 if y <= -2.1e+42: tmp = y * (t - x) elif y <= -2.05e-209: tmp = t_1 elif y <= 3.1e-295: tmp = x * (z + 1.0) elif y <= 1.9e-13: tmp = t_1 else: tmp = x - (y * (x - t)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (y <= -2.1e+42) tmp = Float64(y * Float64(t - x)); elseif (y <= -2.05e-209) tmp = t_1; elseif (y <= 3.1e-295) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 1.9e-13) tmp = t_1; else tmp = Float64(x - Float64(y * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y - z) * t); tmp = 0.0; if (y <= -2.1e+42) tmp = y * (t - x); elseif (y <= -2.05e-209) tmp = t_1; elseif (y <= 3.1e-295) tmp = x * (z + 1.0); elseif (y <= 1.9e-13) tmp = t_1; else tmp = x - (y * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e+42], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.05e-209], t$95$1, If[LessEqual[y, 3.1e-295], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-13], t$95$1, N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-209}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-295}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -2.09999999999999995e42Initial program 100.0%
Taylor expanded in x around -inf 98.3%
+-commutative98.3%
mul-1-neg98.3%
unsub-neg98.3%
sub-neg98.3%
+-commutative98.3%
distribute-neg-in98.3%
metadata-eval98.3%
associate-+l+98.3%
+-commutative98.3%
sub-neg98.3%
Simplified98.3%
Taylor expanded in y around inf 85.8%
if -2.09999999999999995e42 < y < -2.04999999999999989e-209 or 3.1000000000000002e-295 < y < 1.9e-13Initial program 100.0%
Taylor expanded in t around inf 77.1%
if -2.04999999999999989e-209 < y < 3.1000000000000002e-295Initial program 99.9%
Taylor expanded in x around -inf 83.8%
mul-1-neg83.8%
*-commutative83.8%
distribute-rgt-neg-in83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in y around 0 83.8%
if 1.9e-13 < y Initial program 100.0%
Taylor expanded in y around inf 88.7%
*-commutative88.7%
Simplified88.7%
Final simplification83.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* (- y z) t))) (t_2 (+ x (* x (- z y)))))
(if (<= x -2.8e+79)
t_2
(if (<= x 1.1e+19)
t_1
(if (<= x 5.6e+64) (- x (* y (- x t))) (if (<= x 6.4e+124) 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 + (x * (z - y));
double tmp;
if (x <= -2.8e+79) {
tmp = t_2;
} else if (x <= 1.1e+19) {
tmp = t_1;
} else if (x <= 5.6e+64) {
tmp = x - (y * (x - t));
} else if (x <= 6.4e+124) {
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 + (x * (z - y))
if (x <= (-2.8d+79)) then
tmp = t_2
else if (x <= 1.1d+19) then
tmp = t_1
else if (x <= 5.6d+64) then
tmp = x - (y * (x - t))
else if (x <= 6.4d+124) 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 + (x * (z - y));
double tmp;
if (x <= -2.8e+79) {
tmp = t_2;
} else if (x <= 1.1e+19) {
tmp = t_1;
} else if (x <= 5.6e+64) {
tmp = x - (y * (x - t));
} else if (x <= 6.4e+124) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y - z) * t) t_2 = x + (x * (z - y)) tmp = 0 if x <= -2.8e+79: tmp = t_2 elif x <= 1.1e+19: tmp = t_1 elif x <= 5.6e+64: tmp = x - (y * (x - t)) elif x <= 6.4e+124: 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(x * Float64(z - y))) tmp = 0.0 if (x <= -2.8e+79) tmp = t_2; elseif (x <= 1.1e+19) tmp = t_1; elseif (x <= 5.6e+64) tmp = Float64(x - Float64(y * Float64(x - t))); elseif (x <= 6.4e+124) 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 + (x * (z - y)); tmp = 0.0; if (x <= -2.8e+79) tmp = t_2; elseif (x <= 1.1e+19) tmp = t_1; elseif (x <= 5.6e+64) tmp = x - (y * (x - t)); elseif (x <= 6.4e+124) 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[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e+79], t$95$2, If[LessEqual[x, 1.1e+19], t$95$1, If[LessEqual[x, 5.6e+64], N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.4e+124], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot t\\
t_2 := x + x \cdot \left(z - y\right)\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+79}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+64}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\mathbf{elif}\;x \leq 6.4 \cdot 10^{+124}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.8000000000000001e79 or 6.39999999999999986e124 < x Initial program 100.0%
Taylor expanded in x around inf 92.2%
mul-1-neg92.2%
unsub-neg92.2%
distribute-lft-out--92.2%
*-rgt-identity92.2%
Simplified92.2%
if -2.8000000000000001e79 < x < 1.1e19 or 5.60000000000000047e64 < x < 6.39999999999999986e124Initial program 100.0%
Taylor expanded in t around inf 80.0%
if 1.1e19 < x < 5.60000000000000047e64Initial program 100.0%
Taylor expanded in y around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification85.0%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.85e+19)
(* x (+ z 1.0))
(if (or (<= x 5.4e+19) (and (not (<= x 7.8e+66)) (<= x 2.4e+131)))
(* (- y z) t)
(* x (- 1.0 y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e+19) {
tmp = x * (z + 1.0);
} else if ((x <= 5.4e+19) || (!(x <= 7.8e+66) && (x <= 2.4e+131))) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - 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 <= (-2.85d+19)) then
tmp = x * (z + 1.0d0)
else if ((x <= 5.4d+19) .or. (.not. (x <= 7.8d+66)) .and. (x <= 2.4d+131)) then
tmp = (y - z) * t
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e+19) {
tmp = x * (z + 1.0);
} else if ((x <= 5.4e+19) || (!(x <= 7.8e+66) && (x <= 2.4e+131))) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.85e+19: tmp = x * (z + 1.0) elif (x <= 5.4e+19) or (not (x <= 7.8e+66) and (x <= 2.4e+131)): tmp = (y - z) * t else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.85e+19) tmp = Float64(x * Float64(z + 1.0)); elseif ((x <= 5.4e+19) || (!(x <= 7.8e+66) && (x <= 2.4e+131))) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.85e+19) tmp = x * (z + 1.0); elseif ((x <= 5.4e+19) || (~((x <= 7.8e+66)) && (x <= 2.4e+131))) tmp = (y - z) * t; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.85e+19], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 5.4e+19], And[N[Not[LessEqual[x, 7.8e+66]], $MachinePrecision], LessEqual[x, 2.4e+131]]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+19} \lor \neg \left(x \leq 7.8 \cdot 10^{+66}\right) \land x \leq 2.4 \cdot 10^{+131}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
if x < -2.85e19Initial program 100.0%
Taylor expanded in x around -inf 82.5%
mul-1-neg82.5%
*-commutative82.5%
distribute-rgt-neg-in82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in y around 0 58.1%
if -2.85e19 < x < 5.4e19 or 7.8000000000000007e66 < x < 2.3999999999999999e131Initial program 100.0%
Taylor expanded in x around -inf 97.8%
+-commutative97.8%
mul-1-neg97.8%
unsub-neg97.8%
sub-neg97.8%
+-commutative97.8%
distribute-neg-in97.8%
metadata-eval97.8%
associate-+l+97.8%
+-commutative97.8%
sub-neg97.8%
Simplified97.8%
Taylor expanded in t around inf 69.2%
if 5.4e19 < x < 7.8000000000000007e66 or 2.3999999999999999e131 < x Initial program 100.0%
Taylor expanded in x around inf 92.2%
mul-1-neg92.2%
unsub-neg92.2%
distribute-lft-out--92.1%
*-rgt-identity92.1%
Simplified92.1%
Taylor expanded in y around inf 68.7%
Taylor expanded in x around 0 68.7%
Final simplification66.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))))
(if (<= y -4.1e+102)
(* y t)
(if (<= y -4.8e-11)
t_1
(if (<= y 1.1e-44) x (if (<= y 1.2e+186) (* y t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (y <= -4.1e+102) {
tmp = y * t;
} else if (y <= -4.8e-11) {
tmp = t_1;
} else if (y <= 1.1e-44) {
tmp = x;
} else if (y <= 1.2e+186) {
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 = y * -x
if (y <= (-4.1d+102)) then
tmp = y * t
else if (y <= (-4.8d-11)) then
tmp = t_1
else if (y <= 1.1d-44) then
tmp = x
else if (y <= 1.2d+186) 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 = y * -x;
double tmp;
if (y <= -4.1e+102) {
tmp = y * t;
} else if (y <= -4.8e-11) {
tmp = t_1;
} else if (y <= 1.1e-44) {
tmp = x;
} else if (y <= 1.2e+186) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * -x tmp = 0 if y <= -4.1e+102: tmp = y * t elif y <= -4.8e-11: tmp = t_1 elif y <= 1.1e-44: tmp = x elif y <= 1.2e+186: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -4.1e+102) tmp = Float64(y * t); elseif (y <= -4.8e-11) tmp = t_1; elseif (y <= 1.1e-44) tmp = x; elseif (y <= 1.2e+186) tmp = Float64(y * 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 <= -4.1e+102) tmp = y * t; elseif (y <= -4.8e-11) tmp = t_1; elseif (y <= 1.1e-44) tmp = x; elseif (y <= 1.2e+186) tmp = y * 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, -4.1e+102], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.8e-11], t$95$1, If[LessEqual[y, 1.1e-44], x, If[LessEqual[y, 1.2e+186], N[(y * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{+102}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+186}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.1e102 or 1.10000000000000006e-44 < y < 1.19999999999999998e186Initial program 100.0%
Taylor expanded in y around inf 80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in x around 0 52.7%
if -4.1e102 < y < -4.8000000000000002e-11 or 1.19999999999999998e186 < y Initial program 100.0%
Taylor expanded in x around -inf 71.9%
mul-1-neg71.9%
*-commutative71.9%
distribute-rgt-neg-in71.9%
+-commutative71.9%
Simplified71.9%
Taylor expanded in y around inf 63.6%
if -4.8000000000000002e-11 < y < 1.10000000000000006e-44Initial program 100.0%
Taylor expanded in x around -inf 66.1%
mul-1-neg66.1%
*-commutative66.1%
distribute-rgt-neg-in66.1%
+-commutative66.1%
Simplified66.1%
Taylor expanded in y around 0 66.1%
Taylor expanded in z around 0 39.2%
Final simplification48.9%
(FPCore (x y z t) :precision binary64 (if (<= y -1.9e+42) (* y (- t x)) (if (<= y 1.9e-13) (+ x (* z (- x t))) (- x (* y (- x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e+42) {
tmp = y * (t - x);
} else if (y <= 1.9e-13) {
tmp = x + (z * (x - t));
} else {
tmp = x - (y * (x - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.9d+42)) then
tmp = y * (t - x)
else if (y <= 1.9d-13) then
tmp = x + (z * (x - t))
else
tmp = x - (y * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e+42) {
tmp = y * (t - x);
} else if (y <= 1.9e-13) {
tmp = x + (z * (x - t));
} else {
tmp = x - (y * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.9e+42: tmp = y * (t - x) elif y <= 1.9e-13: tmp = x + (z * (x - t)) else: tmp = x - (y * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e+42) tmp = Float64(y * Float64(t - x)); elseif (y <= 1.9e-13) tmp = Float64(x + Float64(z * Float64(x - t))); else tmp = Float64(x - Float64(y * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.9e+42) tmp = y * (t - x); elseif (y <= 1.9e-13) tmp = x + (z * (x - t)); else tmp = x - (y * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e+42], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-13], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-13}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -1.8999999999999999e42Initial program 100.0%
Taylor expanded in x around -inf 98.3%
+-commutative98.3%
mul-1-neg98.3%
unsub-neg98.3%
sub-neg98.3%
+-commutative98.3%
distribute-neg-in98.3%
metadata-eval98.3%
associate-+l+98.3%
+-commutative98.3%
sub-neg98.3%
Simplified98.3%
Taylor expanded in y around inf 85.8%
if -1.8999999999999999e42 < y < 1.9e-13Initial program 100.0%
Taylor expanded in y around 0 91.6%
mul-1-neg91.6%
unsub-neg91.6%
Simplified91.6%
if 1.9e-13 < y Initial program 100.0%
Taylor expanded in y around inf 88.7%
*-commutative88.7%
Simplified88.7%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (<= y -2.2e+90) (* y t) (if (<= y -1.15e-121) (* z x) (if (<= y 1.1e-44) x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e+90) {
tmp = y * t;
} else if (y <= -1.15e-121) {
tmp = z * x;
} else if (y <= 1.1e-44) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.2d+90)) then
tmp = y * t
else if (y <= (-1.15d-121)) then
tmp = z * x
else if (y <= 1.1d-44) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.2e+90) {
tmp = y * t;
} else if (y <= -1.15e-121) {
tmp = z * x;
} else if (y <= 1.1e-44) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.2e+90: tmp = y * t elif y <= -1.15e-121: tmp = z * x elif y <= 1.1e-44: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.2e+90) tmp = Float64(y * t); elseif (y <= -1.15e-121) tmp = Float64(z * x); elseif (y <= 1.1e-44) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.2e+90) tmp = y * t; elseif (y <= -1.15e-121) tmp = z * x; elseif (y <= 1.1e-44) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.2e+90], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.15e-121], N[(z * x), $MachinePrecision], If[LessEqual[y, 1.1e-44], x, N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+90}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-121}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.1999999999999999e90 or 1.10000000000000006e-44 < y Initial program 100.0%
Taylor expanded in y around inf 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in x around 0 50.0%
if -2.1999999999999999e90 < y < -1.15000000000000006e-121Initial program 100.0%
Taylor expanded in x around inf 68.9%
mul-1-neg68.9%
unsub-neg68.9%
distribute-lft-out--68.9%
*-rgt-identity68.9%
Simplified68.9%
Taylor expanded in z around inf 33.9%
if -1.15000000000000006e-121 < y < 1.10000000000000006e-44Initial program 100.0%
Taylor expanded in x around -inf 66.8%
mul-1-neg66.8%
*-commutative66.8%
distribute-rgt-neg-in66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in y around 0 66.8%
Taylor expanded in z around 0 42.2%
Final simplification45.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.82e+19) (not (<= x 1.6e+132))) (* x (+ z 1.0)) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.82e+19) || !(x <= 1.6e+132)) {
tmp = x * (z + 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 <= (-1.82d+19)) .or. (.not. (x <= 1.6d+132))) then
tmp = x * (z + 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 <= -1.82e+19) || !(x <= 1.6e+132)) {
tmp = x * (z + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.82e+19) or not (x <= 1.6e+132): tmp = x * (z + 1.0) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.82e+19) || !(x <= 1.6e+132)) tmp = Float64(x * Float64(z + 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 <= -1.82e+19) || ~((x <= 1.6e+132))) tmp = x * (z + 1.0); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.82e+19], N[Not[LessEqual[x, 1.6e+132]], $MachinePrecision]], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.82 \cdot 10^{+19} \lor \neg \left(x \leq 1.6 \cdot 10^{+132}\right):\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.82e19 or 1.5999999999999999e132 < x Initial program 100.0%
Taylor expanded in x around -inf 86.9%
mul-1-neg86.9%
*-commutative86.9%
distribute-rgt-neg-in86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in y around 0 59.7%
if -1.82e19 < x < 1.5999999999999999e132Initial program 100.0%
Taylor expanded in x around -inf 98.0%
+-commutative98.0%
mul-1-neg98.0%
unsub-neg98.0%
sub-neg98.0%
+-commutative98.0%
distribute-neg-in98.0%
metadata-eval98.0%
associate-+l+98.0%
+-commutative98.0%
sub-neg98.0%
Simplified98.0%
Taylor expanded in t around inf 64.8%
Final simplification62.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.8e+42) (not (<= y 5.3e-11))) (* y (- t x)) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.8e+42) || !(y <= 5.3e-11)) {
tmp = y * (t - x);
} 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 ((y <= (-1.8d+42)) .or. (.not. (y <= 5.3d-11))) then
tmp = y * (t - x)
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 ((y <= -1.8e+42) || !(y <= 5.3e-11)) {
tmp = y * (t - x);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.8e+42) or not (y <= 5.3e-11): tmp = y * (t - x) else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.8e+42) || !(y <= 5.3e-11)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.8e+42) || ~((y <= 5.3e-11))) tmp = y * (t - x); else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.8e+42], N[Not[LessEqual[y, 5.3e-11]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+42} \lor \neg \left(y \leq 5.3 \cdot 10^{-11}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if y < -1.8e42 or 5.2999999999999998e-11 < y Initial program 100.0%
Taylor expanded in x around -inf 93.9%
+-commutative93.9%
mul-1-neg93.9%
unsub-neg93.9%
sub-neg93.9%
+-commutative93.9%
distribute-neg-in93.9%
metadata-eval93.9%
associate-+l+93.9%
+-commutative93.9%
sub-neg93.9%
Simplified93.9%
Taylor expanded in y around inf 86.6%
if -1.8e42 < y < 5.2999999999999998e-11Initial program 100.0%
Taylor expanded in x around -inf 64.1%
mul-1-neg64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
+-commutative64.1%
Simplified64.1%
Taylor expanded in y around 0 63.9%
Final simplification75.6%
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -5.8e-18) (* y t) (if (<= y 9.8e-49) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e-18) {
tmp = y * t;
} else if (y <= 9.8e-49) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.8d-18)) then
tmp = y * t
else if (y <= 9.8d-49) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.8e-18) {
tmp = y * t;
} else if (y <= 9.8e-49) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.8e-18: tmp = y * t elif y <= 9.8e-49: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.8e-18) tmp = Float64(y * t); elseif (y <= 9.8e-49) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.8e-18) tmp = y * t; elseif (y <= 9.8e-49) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.8e-18], N[(y * t), $MachinePrecision], If[LessEqual[y, 9.8e-49], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-18}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -5.8e-18 or 9.8000000000000005e-49 < y Initial program 100.0%
Taylor expanded in y around inf 83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in x around 0 46.1%
if -5.8e-18 < y < 9.8000000000000005e-49Initial program 100.0%
Taylor expanded in x around -inf 66.1%
mul-1-neg66.1%
*-commutative66.1%
distribute-rgt-neg-in66.1%
+-commutative66.1%
Simplified66.1%
Taylor expanded in y around 0 66.1%
Taylor expanded in z around 0 39.2%
Final simplification43.1%
(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 x around -inf 58.6%
mul-1-neg58.6%
*-commutative58.6%
distribute-rgt-neg-in58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in y around 0 38.6%
Taylor expanded in z around 0 19.2%
Final simplification19.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 2023293
(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))))