
(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 (- t x))) (t_2 (* (- y z) t)))
(if (<= y -5.2e+17)
t_1
(if (<= y -9.2e-104)
t_2
(if (<= y -2.4e-165)
x
(if (<= y -1.35e-303)
t_2
(if (<= y 2.1e-246)
x
(if (<= y 2.35e-116)
t_2
(if (<= y 2.22e-66) x (if (<= y 5.2e+19) t_2 t_1))))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = (y - z) * t;
double tmp;
if (y <= -5.2e+17) {
tmp = t_1;
} else if (y <= -9.2e-104) {
tmp = t_2;
} else if (y <= -2.4e-165) {
tmp = x;
} else if (y <= -1.35e-303) {
tmp = t_2;
} else if (y <= 2.1e-246) {
tmp = x;
} else if (y <= 2.35e-116) {
tmp = t_2;
} else if (y <= 2.22e-66) {
tmp = x;
} else if (y <= 5.2e+19) {
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 = (y - z) * t
if (y <= (-5.2d+17)) then
tmp = t_1
else if (y <= (-9.2d-104)) then
tmp = t_2
else if (y <= (-2.4d-165)) then
tmp = x
else if (y <= (-1.35d-303)) then
tmp = t_2
else if (y <= 2.1d-246) then
tmp = x
else if (y <= 2.35d-116) then
tmp = t_2
else if (y <= 2.22d-66) then
tmp = x
else if (y <= 5.2d+19) 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 = (y - z) * t;
double tmp;
if (y <= -5.2e+17) {
tmp = t_1;
} else if (y <= -9.2e-104) {
tmp = t_2;
} else if (y <= -2.4e-165) {
tmp = x;
} else if (y <= -1.35e-303) {
tmp = t_2;
} else if (y <= 2.1e-246) {
tmp = x;
} else if (y <= 2.35e-116) {
tmp = t_2;
} else if (y <= 2.22e-66) {
tmp = x;
} else if (y <= 5.2e+19) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = (y - z) * t tmp = 0 if y <= -5.2e+17: tmp = t_1 elif y <= -9.2e-104: tmp = t_2 elif y <= -2.4e-165: tmp = x elif y <= -1.35e-303: tmp = t_2 elif y <= 2.1e-246: tmp = x elif y <= 2.35e-116: tmp = t_2 elif y <= 2.22e-66: tmp = x elif y <= 5.2e+19: 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(Float64(y - z) * t) tmp = 0.0 if (y <= -5.2e+17) tmp = t_1; elseif (y <= -9.2e-104) tmp = t_2; elseif (y <= -2.4e-165) tmp = x; elseif (y <= -1.35e-303) tmp = t_2; elseif (y <= 2.1e-246) tmp = x; elseif (y <= 2.35e-116) tmp = t_2; elseif (y <= 2.22e-66) tmp = x; elseif (y <= 5.2e+19) 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 = (y - z) * t; tmp = 0.0; if (y <= -5.2e+17) tmp = t_1; elseif (y <= -9.2e-104) tmp = t_2; elseif (y <= -2.4e-165) tmp = x; elseif (y <= -1.35e-303) tmp = t_2; elseif (y <= 2.1e-246) tmp = x; elseif (y <= 2.35e-116) tmp = t_2; elseif (y <= 2.22e-66) tmp = x; elseif (y <= 5.2e+19) 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[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -5.2e+17], t$95$1, If[LessEqual[y, -9.2e-104], t$95$2, If[LessEqual[y, -2.4e-165], x, If[LessEqual[y, -1.35e-303], t$95$2, If[LessEqual[y, 2.1e-246], x, If[LessEqual[y, 2.35e-116], t$95$2, If[LessEqual[y, 2.22e-66], x, If[LessEqual[y, 5.2e+19], t$95$2, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{-104}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-165}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-303}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-246}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{-116}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.22 \cdot 10^{-66}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.2e17 or 5.2e19 < y Initial program 100.0%
Taylor expanded in y around inf 83.1%
if -5.2e17 < y < -9.1999999999999998e-104 or -2.4000000000000002e-165 < y < -1.34999999999999993e-303 or 2.09999999999999995e-246 < y < 2.34999999999999997e-116 or 2.21999999999999996e-66 < y < 5.2e19Initial program 99.9%
Taylor expanded in x around 0 57.6%
if -9.1999999999999998e-104 < y < -2.4000000000000002e-165 or -1.34999999999999993e-303 < y < 2.09999999999999995e-246 or 2.34999999999999997e-116 < y < 2.21999999999999996e-66Initial program 100.0%
Taylor expanded in y around 0 97.2%
+-commutative97.2%
mul-1-neg97.2%
unsub-neg97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in z around 0 61.3%
Final simplification71.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (- x (* z t))))
(if (<= y -6.4e-15)
t_1
(if (<= y -1.3e-73)
(* x (- z -1.0))
(if (<= y -1.7e-97)
(* (- y z) t)
(if (<= y -2.5e-163)
t_2
(if (<= y -1.9e-280) (* z (- x t)) (if (<= y 1e+18) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x - (z * t);
double tmp;
if (y <= -6.4e-15) {
tmp = t_1;
} else if (y <= -1.3e-73) {
tmp = x * (z - -1.0);
} else if (y <= -1.7e-97) {
tmp = (y - z) * t;
} else if (y <= -2.5e-163) {
tmp = t_2;
} else if (y <= -1.9e-280) {
tmp = z * (x - t);
} else if (y <= 1e+18) {
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 - (z * t)
if (y <= (-6.4d-15)) then
tmp = t_1
else if (y <= (-1.3d-73)) then
tmp = x * (z - (-1.0d0))
else if (y <= (-1.7d-97)) then
tmp = (y - z) * t
else if (y <= (-2.5d-163)) then
tmp = t_2
else if (y <= (-1.9d-280)) then
tmp = z * (x - t)
else if (y <= 1d+18) 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 - (z * t);
double tmp;
if (y <= -6.4e-15) {
tmp = t_1;
} else if (y <= -1.3e-73) {
tmp = x * (z - -1.0);
} else if (y <= -1.7e-97) {
tmp = (y - z) * t;
} else if (y <= -2.5e-163) {
tmp = t_2;
} else if (y <= -1.9e-280) {
tmp = z * (x - t);
} else if (y <= 1e+18) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x - (z * t) tmp = 0 if y <= -6.4e-15: tmp = t_1 elif y <= -1.3e-73: tmp = x * (z - -1.0) elif y <= -1.7e-97: tmp = (y - z) * t elif y <= -2.5e-163: tmp = t_2 elif y <= -1.9e-280: tmp = z * (x - t) elif y <= 1e+18: 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(z * t)) tmp = 0.0 if (y <= -6.4e-15) tmp = t_1; elseif (y <= -1.3e-73) tmp = Float64(x * Float64(z - -1.0)); elseif (y <= -1.7e-97) tmp = Float64(Float64(y - z) * t); elseif (y <= -2.5e-163) tmp = t_2; elseif (y <= -1.9e-280) tmp = Float64(z * Float64(x - t)); elseif (y <= 1e+18) 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 - (z * t); tmp = 0.0; if (y <= -6.4e-15) tmp = t_1; elseif (y <= -1.3e-73) tmp = x * (z - -1.0); elseif (y <= -1.7e-97) tmp = (y - z) * t; elseif (y <= -2.5e-163) tmp = t_2; elseif (y <= -1.9e-280) tmp = z * (x - t); elseif (y <= 1e+18) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.4e-15], t$95$1, If[LessEqual[y, -1.3e-73], N[(x * N[(z - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-97], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, -2.5e-163], t$95$2, If[LessEqual[y, -1.9e-280], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+18], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x - z \cdot t\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \left(z - -1\right)\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-97}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-163}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-280}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 10^{+18}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -6.3999999999999999e-15 or 1e18 < y Initial program 100.0%
Taylor expanded in y around inf 81.2%
if -6.3999999999999999e-15 < y < -1.3e-73Initial program 99.9%
Taylor expanded in x around -inf 79.8%
mul-1-neg79.8%
distribute-rgt-neg-in79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in y around 0 79.8%
distribute-lft-in79.8%
metadata-eval79.8%
mul-1-neg79.8%
unsub-neg79.8%
Simplified79.8%
if -1.3e-73 < y < -1.6999999999999999e-97Initial program 100.0%
Taylor expanded in x around 0 100.0%
if -1.6999999999999999e-97 < y < -2.49999999999999989e-163 or -1.9000000000000001e-280 < y < 1e18Initial program 99.9%
Taylor expanded in y around 0 90.9%
+-commutative90.9%
mul-1-neg90.9%
unsub-neg90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 75.3%
*-commutative75.3%
Simplified75.3%
if -2.49999999999999989e-163 < y < -1.9000000000000001e-280Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 86.9%
+-commutative86.9%
mul-1-neg86.9%
sub-neg86.9%
*-commutative86.9%
Simplified86.9%
Final simplification80.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* y x))))
(if (<= y -5.4e+144)
t_1
(if (<= y -2.15e+57)
(* y t)
(if (<= y -1.0)
t_1
(if (<= y 1.58e-55) x (if (<= y 2.7e+166) (* y t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = -(y * x);
double tmp;
if (y <= -5.4e+144) {
tmp = t_1;
} else if (y <= -2.15e+57) {
tmp = y * t;
} else if (y <= -1.0) {
tmp = t_1;
} else if (y <= 1.58e-55) {
tmp = x;
} else if (y <= 2.7e+166) {
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 <= (-5.4d+144)) then
tmp = t_1
else if (y <= (-2.15d+57)) then
tmp = y * t
else if (y <= (-1.0d0)) then
tmp = t_1
else if (y <= 1.58d-55) then
tmp = x
else if (y <= 2.7d+166) 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 <= -5.4e+144) {
tmp = t_1;
} else if (y <= -2.15e+57) {
tmp = y * t;
} else if (y <= -1.0) {
tmp = t_1;
} else if (y <= 1.58e-55) {
tmp = x;
} else if (y <= 2.7e+166) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -(y * x) tmp = 0 if y <= -5.4e+144: tmp = t_1 elif y <= -2.15e+57: tmp = y * t elif y <= -1.0: tmp = t_1 elif y <= 1.58e-55: tmp = x elif y <= 2.7e+166: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-Float64(y * x)) tmp = 0.0 if (y <= -5.4e+144) tmp = t_1; elseif (y <= -2.15e+57) tmp = Float64(y * t); elseif (y <= -1.0) tmp = t_1; elseif (y <= 1.58e-55) tmp = x; elseif (y <= 2.7e+166) 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 <= -5.4e+144) tmp = t_1; elseif (y <= -2.15e+57) tmp = y * t; elseif (y <= -1.0) tmp = t_1; elseif (y <= 1.58e-55) tmp = x; elseif (y <= 2.7e+166) 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, -5.4e+144], t$95$1, If[LessEqual[y, -2.15e+57], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.0], t$95$1, If[LessEqual[y, 1.58e-55], x, If[LessEqual[y, 2.7e+166], N[(y * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -y \cdot x\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.15 \cdot 10^{+57}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.58 \cdot 10^{-55}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+166}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.4000000000000003e144 or -2.15000000000000016e57 < y < -1 or 2.70000000000000012e166 < y Initial program 100.0%
Taylor expanded in x around -inf 66.8%
mul-1-neg66.8%
distribute-rgt-neg-in66.8%
+-commutative66.8%
Simplified66.8%
Taylor expanded in y around inf 60.5%
if -5.4000000000000003e144 < y < -2.15000000000000016e57 or 1.58000000000000007e-55 < y < 2.70000000000000012e166Initial program 100.0%
Taylor expanded in y around inf 62.8%
Taylor expanded in t around inf 46.5%
if -1 < y < 1.58000000000000007e-55Initial program 99.9%
Taylor expanded in y around 0 92.8%
+-commutative92.8%
mul-1-neg92.8%
unsub-neg92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in z around 0 35.3%
Final simplification46.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -6.5e+36)
t_1
(if (<= y 3.2e-117)
(* z (- x t))
(if (<= y 5.4e-65) x (if (<= y 6.9e+16) (* (- y z) t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -6.5e+36) {
tmp = t_1;
} else if (y <= 3.2e-117) {
tmp = z * (x - t);
} else if (y <= 5.4e-65) {
tmp = x;
} else if (y <= 6.9e+16) {
tmp = (y - z) * t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y * (t - x)
if (y <= (-6.5d+36)) then
tmp = t_1
else if (y <= 3.2d-117) then
tmp = z * (x - t)
else if (y <= 5.4d-65) then
tmp = x
else if (y <= 6.9d+16) then
tmp = (y - z) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -6.5e+36) {
tmp = t_1;
} else if (y <= 3.2e-117) {
tmp = z * (x - t);
} else if (y <= 5.4e-65) {
tmp = x;
} else if (y <= 6.9e+16) {
tmp = (y - z) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -6.5e+36: tmp = t_1 elif y <= 3.2e-117: tmp = z * (x - t) elif y <= 5.4e-65: tmp = x elif y <= 6.9e+16: tmp = (y - z) * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -6.5e+36) tmp = t_1; elseif (y <= 3.2e-117) tmp = Float64(z * Float64(x - t)); elseif (y <= 5.4e-65) tmp = x; elseif (y <= 6.9e+16) tmp = Float64(Float64(y - z) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -6.5e+36) tmp = t_1; elseif (y <= 3.2e-117) tmp = z * (x - t); elseif (y <= 5.4e-65) tmp = x; elseif (y <= 6.9e+16) tmp = (y - z) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e+36], t$95$1, If[LessEqual[y, 3.2e-117], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e-65], x, If[LessEqual[y, 6.9e+16], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-117}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-65}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.9 \cdot 10^{+16}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -6.4999999999999998e36 or 6.9e16 < y Initial program 100.0%
Taylor expanded in y around inf 84.2%
if -6.4999999999999998e36 < y < 3.19999999999999995e-117Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 62.6%
+-commutative62.6%
mul-1-neg62.6%
sub-neg62.6%
*-commutative62.6%
Simplified62.6%
if 3.19999999999999995e-117 < y < 5.3999999999999997e-65Initial program 99.8%
Taylor expanded in y around 0 87.6%
+-commutative87.6%
mul-1-neg87.6%
unsub-neg87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in z around 0 75.4%
if 5.3999999999999997e-65 < y < 6.9e16Initial program 100.0%
Taylor expanded in x around 0 74.4%
Final simplification74.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))))
(if (<= y -7.2e+34)
t_1
(if (<= y 1.3e-116)
t_2
(if (<= y 2.2e-20) (+ x (* y t)) (if (<= y 3e+29) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = z * (x - t);
double tmp;
if (y <= -7.2e+34) {
tmp = t_1;
} else if (y <= 1.3e-116) {
tmp = t_2;
} else if (y <= 2.2e-20) {
tmp = x + (y * t);
} else if (y <= 3e+29) {
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 = z * (x - t)
if (y <= (-7.2d+34)) then
tmp = t_1
else if (y <= 1.3d-116) then
tmp = t_2
else if (y <= 2.2d-20) then
tmp = x + (y * t)
else if (y <= 3d+29) 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 = z * (x - t);
double tmp;
if (y <= -7.2e+34) {
tmp = t_1;
} else if (y <= 1.3e-116) {
tmp = t_2;
} else if (y <= 2.2e-20) {
tmp = x + (y * t);
} else if (y <= 3e+29) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = z * (x - t) tmp = 0 if y <= -7.2e+34: tmp = t_1 elif y <= 1.3e-116: tmp = t_2 elif y <= 2.2e-20: tmp = x + (y * t) elif y <= 3e+29: 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(z * Float64(x - t)) tmp = 0.0 if (y <= -7.2e+34) tmp = t_1; elseif (y <= 1.3e-116) tmp = t_2; elseif (y <= 2.2e-20) tmp = Float64(x + Float64(y * t)); elseif (y <= 3e+29) 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 = z * (x - t); tmp = 0.0; if (y <= -7.2e+34) tmp = t_1; elseif (y <= 1.3e-116) tmp = t_2; elseif (y <= 2.2e-20) tmp = x + (y * t); elseif (y <= 3e+29) 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[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e+34], t$95$1, If[LessEqual[y, 1.3e-116], t$95$2, If[LessEqual[y, 2.2e-20], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+29], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := z \cdot \left(x - t\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-116}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-20}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+29}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -7.2000000000000001e34 or 2.9999999999999999e29 < y Initial program 100.0%
Taylor expanded in y around inf 85.4%
if -7.2000000000000001e34 < y < 1.3e-116 or 2.19999999999999991e-20 < y < 2.9999999999999999e29Initial program 100.0%
Taylor expanded in x around 0 99.1%
fma-def99.1%
mul-1-neg99.1%
Simplified99.1%
Taylor expanded in z around inf 63.5%
+-commutative63.5%
mul-1-neg63.5%
sub-neg63.5%
*-commutative63.5%
Simplified63.5%
if 1.3e-116 < y < 2.19999999999999991e-20Initial program 99.9%
Taylor expanded in z around 0 75.5%
Taylor expanded in t around inf 75.5%
Final simplification75.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -4.5e-69)
t_1
(if (<= t 1.8e-258) (* z x) (if (<= t 6.9e-119) (* y (- x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -4.5e-69) {
tmp = t_1;
} else if (t <= 1.8e-258) {
tmp = z * x;
} else if (t <= 6.9e-119) {
tmp = y * -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 = (y - z) * t
if (t <= (-4.5d-69)) then
tmp = t_1
else if (t <= 1.8d-258) then
tmp = z * x
else if (t <= 6.9d-119) then
tmp = y * -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 = (y - z) * t;
double tmp;
if (t <= -4.5e-69) {
tmp = t_1;
} else if (t <= 1.8e-258) {
tmp = z * x;
} else if (t <= 6.9e-119) {
tmp = y * -x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -4.5e-69: tmp = t_1 elif t <= 1.8e-258: tmp = z * x elif t <= 6.9e-119: tmp = y * -x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -4.5e-69) tmp = t_1; elseif (t <= 1.8e-258) tmp = Float64(z * x); elseif (t <= 6.9e-119) tmp = Float64(y * Float64(-x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; tmp = 0.0; if (t <= -4.5e-69) tmp = t_1; elseif (t <= 1.8e-258) tmp = z * x; elseif (t <= 6.9e-119) tmp = y * -x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.5e-69], t$95$1, If[LessEqual[t, 1.8e-258], N[(z * x), $MachinePrecision], If[LessEqual[t, 6.9e-119], N[(y * (-x)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{-69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-258}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 6.9 \cdot 10^{-119}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.50000000000000009e-69 or 6.89999999999999953e-119 < t Initial program 100.0%
Taylor expanded in x around 0 75.2%
if -4.50000000000000009e-69 < t < 1.79999999999999989e-258Initial program 100.0%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 48.1%
+-commutative48.1%
mul-1-neg48.1%
sub-neg48.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in x around inf 46.0%
if 1.79999999999999989e-258 < t < 6.89999999999999953e-119Initial program 100.0%
Taylor expanded in x around -inf 89.9%
mul-1-neg89.9%
distribute-rgt-neg-in89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in y around inf 44.6%
Final simplification63.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -30000000000.0) (not (<= z 1.3e+36))) (* z (- x t)) (- x (* y (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -30000000000.0) || !(z <= 1.3e+36)) {
tmp = 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 ((z <= (-30000000000.0d0)) .or. (.not. (z <= 1.3d+36))) then
tmp = 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 ((z <= -30000000000.0) || !(z <= 1.3e+36)) {
tmp = z * (x - t);
} else {
tmp = x - (y * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -30000000000.0) or not (z <= 1.3e+36): tmp = z * (x - t) else: tmp = x - (y * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -30000000000.0) || !(z <= 1.3e+36)) tmp = 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 ((z <= -30000000000.0) || ~((z <= 1.3e+36))) tmp = z * (x - t); else tmp = x - (y * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -30000000000.0], N[Not[LessEqual[z, 1.3e+36]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30000000000 \lor \neg \left(z \leq 1.3 \cdot 10^{+36}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\end{array}
\end{array}
if z < -3e10 or 1.3000000000000001e36 < z Initial program 100.0%
Taylor expanded in x around 0 94.8%
fma-def97.4%
mul-1-neg97.4%
Simplified97.4%
Taylor expanded in z around inf 82.3%
+-commutative82.3%
mul-1-neg82.3%
sub-neg82.3%
*-commutative82.3%
Simplified82.3%
if -3e10 < z < 1.3000000000000001e36Initial program 100.0%
Taylor expanded in z around 0 87.3%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (<= y -3.4e+35) (* y (- t x)) (if (<= y 1.75e+31) (+ x (* z (- x t))) (- x (* y (- x t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e+35) {
tmp = y * (t - x);
} else if (y <= 1.75e+31) {
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 <= (-3.4d+35)) then
tmp = y * (t - x)
else if (y <= 1.75d+31) 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 <= -3.4e+35) {
tmp = y * (t - x);
} else if (y <= 1.75e+31) {
tmp = x + (z * (x - t));
} else {
tmp = x - (y * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.4e+35: tmp = y * (t - x) elif y <= 1.75e+31: tmp = x + (z * (x - t)) else: tmp = x - (y * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e+35) tmp = Float64(y * Float64(t - x)); elseif (y <= 1.75e+31) 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 <= -3.4e+35) tmp = y * (t - x); elseif (y <= 1.75e+31) tmp = x + (z * (x - t)); else tmp = x - (y * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e+35], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+31], 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 -3.4 \cdot 10^{+35}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+31}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -3.4000000000000001e35Initial program 100.0%
Taylor expanded in y around inf 91.2%
if -3.4000000000000001e35 < y < 1.75e31Initial program 100.0%
Taylor expanded in y around 0 89.1%
+-commutative89.1%
mul-1-neg89.1%
unsub-neg89.1%
*-commutative89.1%
Simplified89.1%
if 1.75e31 < y Initial program 100.0%
Taylor expanded in z around 0 80.8%
Final simplification87.2%
(FPCore (x y z t) :precision binary64 (if (<= t -1.05e-47) (* y t) (if (<= t 2.1e-258) (* z x) (if (<= t 4.9e-119) (* y (- x)) (* t (- z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.05e-47) {
tmp = y * t;
} else if (t <= 2.1e-258) {
tmp = z * x;
} else if (t <= 4.9e-119) {
tmp = y * -x;
} 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 (t <= (-1.05d-47)) then
tmp = y * t
else if (t <= 2.1d-258) then
tmp = z * x
else if (t <= 4.9d-119) then
tmp = y * -x
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 (t <= -1.05e-47) {
tmp = y * t;
} else if (t <= 2.1e-258) {
tmp = z * x;
} else if (t <= 4.9e-119) {
tmp = y * -x;
} else {
tmp = t * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.05e-47: tmp = y * t elif t <= 2.1e-258: tmp = z * x elif t <= 4.9e-119: tmp = y * -x else: tmp = t * -z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.05e-47) tmp = Float64(y * t); elseif (t <= 2.1e-258) tmp = Float64(z * x); elseif (t <= 4.9e-119) tmp = Float64(y * Float64(-x)); else tmp = Float64(t * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.05e-47) tmp = y * t; elseif (t <= 2.1e-258) tmp = z * x; elseif (t <= 4.9e-119) tmp = y * -x; else tmp = t * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.05e-47], N[(y * t), $MachinePrecision], If[LessEqual[t, 2.1e-258], N[(z * x), $MachinePrecision], If[LessEqual[t, 4.9e-119], N[(y * (-x)), $MachinePrecision], N[(t * (-z)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-47}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-258}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-119}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\end{array}
\end{array}
if t < -1.05e-47Initial program 100.0%
Taylor expanded in y around inf 66.8%
Taylor expanded in t around inf 54.4%
if -1.05e-47 < t < 2.0999999999999999e-258Initial program 99.9%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 48.3%
+-commutative48.3%
mul-1-neg48.3%
sub-neg48.3%
*-commutative48.3%
Simplified48.3%
Taylor expanded in x around inf 42.9%
if 2.0999999999999999e-258 < t < 4.9e-119Initial program 100.0%
Taylor expanded in x around -inf 89.9%
mul-1-neg89.9%
distribute-rgt-neg-in89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in y around inf 44.6%
if 4.9e-119 < t Initial program 100.0%
Taylor expanded in z around inf 52.7%
mul-1-neg52.7%
distribute-lft-neg-out52.7%
*-commutative52.7%
Simplified52.7%
Taylor expanded in t around inf 43.3%
associate-*r*43.3%
mul-1-neg43.3%
Simplified43.3%
Final simplification46.0%
(FPCore (x y z t) :precision binary64 (if (<= t -2.15e-48) (* y t) (if (<= t 1.15e-208) (* z x) (if (<= t 4.8e-83) x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.15e-48) {
tmp = y * t;
} else if (t <= 1.15e-208) {
tmp = z * x;
} else if (t <= 4.8e-83) {
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 (t <= (-2.15d-48)) then
tmp = y * t
else if (t <= 1.15d-208) then
tmp = z * x
else if (t <= 4.8d-83) 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 (t <= -2.15e-48) {
tmp = y * t;
} else if (t <= 1.15e-208) {
tmp = z * x;
} else if (t <= 4.8e-83) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.15e-48: tmp = y * t elif t <= 1.15e-208: tmp = z * x elif t <= 4.8e-83: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.15e-48) tmp = Float64(y * t); elseif (t <= 1.15e-208) tmp = Float64(z * x); elseif (t <= 4.8e-83) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.15e-48) tmp = y * t; elseif (t <= 1.15e-208) tmp = z * x; elseif (t <= 4.8e-83) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.15e-48], N[(y * t), $MachinePrecision], If[LessEqual[t, 1.15e-208], N[(z * x), $MachinePrecision], If[LessEqual[t, 4.8e-83], x, N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{-48}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-208}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-83}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if t < -2.15e-48 or 4.8000000000000002e-83 < t Initial program 100.0%
Taylor expanded in y around inf 55.5%
Taylor expanded in t around inf 43.9%
if -2.15e-48 < t < 1.14999999999999998e-208Initial program 99.9%
Taylor expanded in x around 0 100.0%
fma-def100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 46.6%
+-commutative46.6%
mul-1-neg46.6%
sub-neg46.6%
*-commutative46.6%
Simplified46.6%
Taylor expanded in x around inf 41.3%
if 1.14999999999999998e-208 < t < 4.8000000000000002e-83Initial program 100.0%
Taylor expanded in y around 0 64.6%
+-commutative64.6%
mul-1-neg64.6%
unsub-neg64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in z around 0 41.2%
Final simplification42.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.6e+34) (not (<= y 1e+18))) (* y (- t x)) (- x (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.6e+34) || !(y <= 1e+18)) {
tmp = y * (t - x);
} else {
tmp = x - (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 ((y <= (-3.6d+34)) .or. (.not. (y <= 1d+18))) then
tmp = y * (t - x)
else
tmp = x - (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.6e+34) || !(y <= 1e+18)) {
tmp = y * (t - x);
} else {
tmp = x - (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.6e+34) or not (y <= 1e+18): tmp = y * (t - x) else: tmp = x - (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.6e+34) || !(y <= 1e+18)) tmp = Float64(y * Float64(t - x)); else tmp = Float64(x - Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.6e+34) || ~((y <= 1e+18))) tmp = y * (t - x); else tmp = x - (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.6e+34], N[Not[LessEqual[y, 1e+18]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+34} \lor \neg \left(y \leq 10^{+18}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\
\end{array}
\end{array}
if y < -3.6e34 or 1e18 < y Initial program 100.0%
Taylor expanded in y around inf 84.2%
if -3.6e34 < y < 1e18Initial program 100.0%
Taylor expanded in y around 0 89.5%
+-commutative89.5%
mul-1-neg89.5%
unsub-neg89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in t around inf 68.2%
*-commutative68.2%
Simplified68.2%
Final simplification76.2%
(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 -2e-17) (* y t) (if (<= y 6e-61) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2e-17) {
tmp = y * t;
} else if (y <= 6e-61) {
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 <= (-2d-17)) then
tmp = y * t
else if (y <= 6d-61) 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 <= -2e-17) {
tmp = y * t;
} else if (y <= 6e-61) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2e-17: tmp = y * t elif y <= 6e-61: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2e-17) tmp = Float64(y * t); elseif (y <= 6e-61) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2e-17) tmp = y * t; elseif (y <= 6e-61) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2e-17], N[(y * t), $MachinePrecision], If[LessEqual[y, 6e-61], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-17}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-61}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.00000000000000014e-17 or 6.00000000000000024e-61 < y Initial program 100.0%
Taylor expanded in y around inf 75.2%
Taylor expanded in t around inf 42.2%
if -2.00000000000000014e-17 < y < 6.00000000000000024e-61Initial program 100.0%
Taylor expanded in y around 0 94.2%
+-commutative94.2%
mul-1-neg94.2%
unsub-neg94.2%
*-commutative94.2%
Simplified94.2%
Taylor expanded in z around 0 36.3%
Final simplification39.9%
(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 0 60.0%
+-commutative60.0%
mul-1-neg60.0%
unsub-neg60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in z around 0 17.0%
Final simplification17.0%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2023208
(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))))