
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)) (t_2 (* y (- x))))
(if (<= (- y z) -1e+224)
t_1
(if (<= (- y z) -5e+152)
t_2
(if (<= (- y z) -0.05)
t_1
(if (<= (- y z) 2e-13)
x
(if (or (<= (- y z) 4e+98) (not (<= (- y z) 1e+158))) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = y * -x;
double tmp;
if ((y - z) <= -1e+224) {
tmp = t_1;
} else if ((y - z) <= -5e+152) {
tmp = t_2;
} else if ((y - z) <= -0.05) {
tmp = t_1;
} else if ((y - z) <= 2e-13) {
tmp = x;
} else if (((y - z) <= 4e+98) || !((y - z) <= 1e+158)) {
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 = (y - z) * t
t_2 = y * -x
if ((y - z) <= (-1d+224)) then
tmp = t_1
else if ((y - z) <= (-5d+152)) then
tmp = t_2
else if ((y - z) <= (-0.05d0)) then
tmp = t_1
else if ((y - z) <= 2d-13) then
tmp = x
else if (((y - z) <= 4d+98) .or. (.not. ((y - z) <= 1d+158))) 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 = (y - z) * t;
double t_2 = y * -x;
double tmp;
if ((y - z) <= -1e+224) {
tmp = t_1;
} else if ((y - z) <= -5e+152) {
tmp = t_2;
} else if ((y - z) <= -0.05) {
tmp = t_1;
} else if ((y - z) <= 2e-13) {
tmp = x;
} else if (((y - z) <= 4e+98) || !((y - z) <= 1e+158)) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t t_2 = y * -x tmp = 0 if (y - z) <= -1e+224: tmp = t_1 elif (y - z) <= -5e+152: tmp = t_2 elif (y - z) <= -0.05: tmp = t_1 elif (y - z) <= 2e-13: tmp = x elif ((y - z) <= 4e+98) or not ((y - z) <= 1e+158): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(y * Float64(-x)) tmp = 0.0 if (Float64(y - z) <= -1e+224) tmp = t_1; elseif (Float64(y - z) <= -5e+152) tmp = t_2; elseif (Float64(y - z) <= -0.05) tmp = t_1; elseif (Float64(y - z) <= 2e-13) tmp = x; elseif ((Float64(y - z) <= 4e+98) || !(Float64(y - z) <= 1e+158)) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; t_2 = y * -x; tmp = 0.0; if ((y - z) <= -1e+224) tmp = t_1; elseif ((y - z) <= -5e+152) tmp = t_2; elseif ((y - z) <= -0.05) tmp = t_1; elseif ((y - z) <= 2e-13) tmp = x; elseif (((y - z) <= 4e+98) || ~(((y - z) <= 1e+158))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -1e+224], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], -5e+152], t$95$2, If[LessEqual[N[(y - z), $MachinePrecision], -0.05], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 2e-13], x, If[Or[LessEqual[N[(y - z), $MachinePrecision], 4e+98], N[Not[LessEqual[N[(y - z), $MachinePrecision], 1e+158]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := y \cdot \left(-x\right)\\
\mathbf{if}\;y - z \leq -1 \cdot 10^{+224}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y - z \leq -5 \cdot 10^{+152}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y - z \leq -0.05:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y - z \leq 2 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{elif}\;y - z \leq 4 \cdot 10^{+98} \lor \neg \left(y - z \leq 10^{+158}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (-.f64 y z) < -9.9999999999999997e223 or -5e152 < (-.f64 y z) < -0.050000000000000003 or 2.0000000000000001e-13 < (-.f64 y z) < 3.99999999999999999e98 or 9.99999999999999953e157 < (-.f64 y z) Initial program 100.0%
Taylor expanded in t around inf 62.5%
Taylor expanded in x around 0 62.5%
*-commutative62.5%
fma-udef62.5%
Simplified62.5%
Taylor expanded in t around inf 62.2%
if -9.9999999999999997e223 < (-.f64 y z) < -5e152 or 3.99999999999999999e98 < (-.f64 y z) < 9.99999999999999953e157Initial program 100.0%
Taylor expanded in x around inf 78.1%
*-commutative78.1%
mul-1-neg78.1%
unsub-neg78.1%
distribute-lft-out--78.1%
*-rgt-identity78.1%
Simplified78.1%
Taylor expanded in y around inf 48.0%
mul-1-neg48.0%
distribute-rgt-neg-in48.0%
Simplified48.0%
if -0.050000000000000003 < (-.f64 y z) < 2.0000000000000001e-13Initial program 100.0%
Taylor expanded in t around inf 97.4%
Taylor expanded in x around inf 75.5%
Final simplification63.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)) (t_2 (* x (- (+ z 1.0) y))))
(if (<= x -4.9e-18)
t_2
(if (<= x -1.9e-92)
t_1
(if (<= x -4.8e-149)
t_2
(if (<= x 7.6e-39)
t_1
(if (or (<= x 6.5e-5) (not (<= x 1.85e+32)))
t_2
(- x (* z t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = x * ((z + 1.0) - y);
double tmp;
if (x <= -4.9e-18) {
tmp = t_2;
} else if (x <= -1.9e-92) {
tmp = t_1;
} else if (x <= -4.8e-149) {
tmp = t_2;
} else if (x <= 7.6e-39) {
tmp = t_1;
} else if ((x <= 6.5e-5) || !(x <= 1.85e+32)) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y - z) * t
t_2 = x * ((z + 1.0d0) - y)
if (x <= (-4.9d-18)) then
tmp = t_2
else if (x <= (-1.9d-92)) then
tmp = t_1
else if (x <= (-4.8d-149)) then
tmp = t_2
else if (x <= 7.6d-39) then
tmp = t_1
else if ((x <= 6.5d-5) .or. (.not. (x <= 1.85d+32))) then
tmp = t_2
else
tmp = x - (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = x * ((z + 1.0) - y);
double tmp;
if (x <= -4.9e-18) {
tmp = t_2;
} else if (x <= -1.9e-92) {
tmp = t_1;
} else if (x <= -4.8e-149) {
tmp = t_2;
} else if (x <= 7.6e-39) {
tmp = t_1;
} else if ((x <= 6.5e-5) || !(x <= 1.85e+32)) {
tmp = t_2;
} else {
tmp = x - (z * t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t t_2 = x * ((z + 1.0) - y) tmp = 0 if x <= -4.9e-18: tmp = t_2 elif x <= -1.9e-92: tmp = t_1 elif x <= -4.8e-149: tmp = t_2 elif x <= 7.6e-39: tmp = t_1 elif (x <= 6.5e-5) or not (x <= 1.85e+32): tmp = t_2 else: tmp = x - (z * t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(x * Float64(Float64(z + 1.0) - y)) tmp = 0.0 if (x <= -4.9e-18) tmp = t_2; elseif (x <= -1.9e-92) tmp = t_1; elseif (x <= -4.8e-149) tmp = t_2; elseif (x <= 7.6e-39) tmp = t_1; elseif ((x <= 6.5e-5) || !(x <= 1.85e+32)) tmp = t_2; else tmp = Float64(x - Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; t_2 = x * ((z + 1.0) - y); tmp = 0.0; if (x <= -4.9e-18) tmp = t_2; elseif (x <= -1.9e-92) tmp = t_1; elseif (x <= -4.8e-149) tmp = t_2; elseif (x <= 7.6e-39) tmp = t_1; elseif ((x <= 6.5e-5) || ~((x <= 1.85e+32))) tmp = t_2; else tmp = x - (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e-18], t$95$2, If[LessEqual[x, -1.9e-92], t$95$1, If[LessEqual[x, -4.8e-149], t$95$2, If[LessEqual[x, 7.6e-39], t$95$1, If[Or[LessEqual[x, 6.5e-5], N[Not[LessEqual[x, 1.85e+32]], $MachinePrecision]], t$95$2, N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{-18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-5} \lor \neg \left(x \leq 1.85 \cdot 10^{+32}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\
\end{array}
\end{array}
if x < -4.9000000000000001e-18 or -1.9e-92 < x < -4.8000000000000002e-149 or 7.6000000000000004e-39 < x < 6.49999999999999943e-5 or 1.85e32 < x Initial program 100.0%
Taylor expanded in x around inf 87.4%
*-commutative87.4%
mul-1-neg87.4%
unsub-neg87.4%
distribute-lft-out--87.4%
*-rgt-identity87.4%
Simplified87.4%
Taylor expanded in x around 0 87.4%
if -4.9000000000000001e-18 < x < -1.9e-92 or -4.8000000000000002e-149 < x < 7.6000000000000004e-39Initial program 100.0%
Taylor expanded in t around inf 91.5%
Taylor expanded in x around 0 91.5%
*-commutative91.5%
fma-udef91.5%
Simplified91.5%
Taylor expanded in t around inf 85.7%
if 6.49999999999999943e-5 < x < 1.85e32Initial program 100.0%
Taylor expanded in t around inf 96.6%
Taylor expanded in y around 0 76.8%
+-commutative76.8%
mul-1-neg76.8%
unsub-neg76.8%
*-commutative76.8%
Simplified76.8%
Final simplification86.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z 1.0))) (t_2 (* (- y z) t)))
(if (<= x -1.6e+21)
t_1
(if (<= x -4.5e-103)
t_2
(if (<= x -4.8e-149)
t_1
(if (<= x 3.8e+36)
t_2
(if (or (<= x 4.1e+148) (not (<= x 5.1e+156)))
t_1
(* y (- x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + 1.0);
double t_2 = (y - z) * t;
double tmp;
if (x <= -1.6e+21) {
tmp = t_1;
} else if (x <= -4.5e-103) {
tmp = t_2;
} else if (x <= -4.8e-149) {
tmp = t_1;
} else if (x <= 3.8e+36) {
tmp = t_2;
} else if ((x <= 4.1e+148) || !(x <= 5.1e+156)) {
tmp = t_1;
} else {
tmp = y * -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) :: t_2
real(8) :: tmp
t_1 = x * (z + 1.0d0)
t_2 = (y - z) * t
if (x <= (-1.6d+21)) then
tmp = t_1
else if (x <= (-4.5d-103)) then
tmp = t_2
else if (x <= (-4.8d-149)) then
tmp = t_1
else if (x <= 3.8d+36) then
tmp = t_2
else if ((x <= 4.1d+148) .or. (.not. (x <= 5.1d+156))) then
tmp = t_1
else
tmp = y * -x
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 - z) * t;
double tmp;
if (x <= -1.6e+21) {
tmp = t_1;
} else if (x <= -4.5e-103) {
tmp = t_2;
} else if (x <= -4.8e-149) {
tmp = t_1;
} else if (x <= 3.8e+36) {
tmp = t_2;
} else if ((x <= 4.1e+148) || !(x <= 5.1e+156)) {
tmp = t_1;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + 1.0) t_2 = (y - z) * t tmp = 0 if x <= -1.6e+21: tmp = t_1 elif x <= -4.5e-103: tmp = t_2 elif x <= -4.8e-149: tmp = t_1 elif x <= 3.8e+36: tmp = t_2 elif (x <= 4.1e+148) or not (x <= 5.1e+156): tmp = t_1 else: tmp = y * -x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + 1.0)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (x <= -1.6e+21) tmp = t_1; elseif (x <= -4.5e-103) tmp = t_2; elseif (x <= -4.8e-149) tmp = t_1; elseif (x <= 3.8e+36) tmp = t_2; elseif ((x <= 4.1e+148) || !(x <= 5.1e+156)) tmp = t_1; else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + 1.0); t_2 = (y - z) * t; tmp = 0.0; if (x <= -1.6e+21) tmp = t_1; elseif (x <= -4.5e-103) tmp = t_2; elseif (x <= -4.8e-149) tmp = t_1; elseif (x <= 3.8e+36) tmp = t_2; elseif ((x <= 4.1e+148) || ~((x <= 5.1e+156))) tmp = t_1; else tmp = y * -x; 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[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[x, -1.6e+21], t$95$1, If[LessEqual[x, -4.5e-103], t$95$2, If[LessEqual[x, -4.8e-149], t$95$1, If[LessEqual[x, 3.8e+36], t$95$2, If[Or[LessEqual[x, 4.1e+148], N[Not[LessEqual[x, 5.1e+156]], $MachinePrecision]], t$95$1, N[(y * (-x)), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + 1\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-103}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-149}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+148} \lor \neg \left(x \leq 5.1 \cdot 10^{+156}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -1.6e21 or -4.5e-103 < x < -4.8000000000000002e-149 or 3.80000000000000025e36 < x < 4.0999999999999998e148 or 5.10000000000000014e156 < x Initial program 100.0%
Taylor expanded in x around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
+-commutative88.8%
Simplified88.8%
Taylor expanded in y around 0 64.8%
if -1.6e21 < x < -4.5e-103 or -4.8000000000000002e-149 < x < 3.80000000000000025e36Initial program 99.9%
Taylor expanded in t around inf 85.9%
Taylor expanded in x around 0 85.9%
*-commutative85.9%
fma-udef86.0%
Simplified86.0%
Taylor expanded in t around inf 75.6%
if 4.0999999999999998e148 < x < 5.10000000000000014e156Initial program 100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
distribute-lft-out--100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in y around inf 78.3%
mul-1-neg78.3%
distribute-rgt-neg-in78.3%
Simplified78.3%
Final simplification70.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= z -6.6e+284)
t_1
(if (<= z -1.08e+98)
(* z x)
(if (<= z -5.8e-34)
t_1
(if (<= z 8.5e-27) x (if (<= z 1.65e+54) (* y t) (* z x))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -6.6e+284) {
tmp = t_1;
} else if (z <= -1.08e+98) {
tmp = z * x;
} else if (z <= -5.8e-34) {
tmp = t_1;
} else if (z <= 8.5e-27) {
tmp = x;
} else if (z <= 1.65e+54) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * -t
if (z <= (-6.6d+284)) then
tmp = t_1
else if (z <= (-1.08d+98)) then
tmp = z * x
else if (z <= (-5.8d-34)) then
tmp = t_1
else if (z <= 8.5d-27) then
tmp = x
else if (z <= 1.65d+54) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (z <= -6.6e+284) {
tmp = t_1;
} else if (z <= -1.08e+98) {
tmp = z * x;
} else if (z <= -5.8e-34) {
tmp = t_1;
} else if (z <= 8.5e-27) {
tmp = x;
} else if (z <= 1.65e+54) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if z <= -6.6e+284: tmp = t_1 elif z <= -1.08e+98: tmp = z * x elif z <= -5.8e-34: tmp = t_1 elif z <= 8.5e-27: tmp = x elif z <= 1.65e+54: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (z <= -6.6e+284) tmp = t_1; elseif (z <= -1.08e+98) tmp = Float64(z * x); elseif (z <= -5.8e-34) tmp = t_1; elseif (z <= 8.5e-27) tmp = x; elseif (z <= 1.65e+54) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (z <= -6.6e+284) tmp = t_1; elseif (z <= -1.08e+98) tmp = z * x; elseif (z <= -5.8e-34) tmp = t_1; elseif (z <= 8.5e-27) tmp = x; elseif (z <= 1.65e+54) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -6.6e+284], t$95$1, If[LessEqual[z, -1.08e+98], N[(z * x), $MachinePrecision], If[LessEqual[z, -5.8e-34], t$95$1, If[LessEqual[z, 8.5e-27], x, If[LessEqual[z, 1.65e+54], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+284}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.08 \cdot 10^{+98}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+54}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -6.5999999999999995e284 or -1.07999999999999997e98 < z < -5.8000000000000004e-34Initial program 99.9%
Taylor expanded in t around inf 86.8%
Taylor expanded in z around inf 64.0%
associate-*r*64.0%
neg-mul-164.0%
Simplified64.0%
if -6.5999999999999995e284 < z < -1.07999999999999997e98 or 1.65e54 < z Initial program 100.0%
Taylor expanded in x around inf 65.5%
*-commutative65.5%
mul-1-neg65.5%
unsub-neg65.5%
distribute-lft-out--65.5%
*-rgt-identity65.5%
Simplified65.5%
Taylor expanded in z around inf 55.1%
if -5.8000000000000004e-34 < z < 8.50000000000000033e-27Initial program 100.0%
Taylor expanded in t around inf 72.6%
Taylor expanded in x around inf 45.2%
if 8.50000000000000033e-27 < z < 1.65e54Initial program 100.0%
Taylor expanded in t around inf 81.5%
Taylor expanded in y around inf 45.0%
Final simplification51.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* (- y z) t)))
(if (<= z -8.5e+97)
t_1
(if (<= z -4.5e-34)
t_2
(if (<= z 2.6e-27) x (if (<= z 3.8e+64) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -8.5e+97) {
tmp = t_1;
} else if (z <= -4.5e-34) {
tmp = t_2;
} else if (z <= 2.6e-27) {
tmp = x;
} else if (z <= 3.8e+64) {
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 = z * (x - t)
t_2 = (y - z) * t
if (z <= (-8.5d+97)) then
tmp = t_1
else if (z <= (-4.5d-34)) then
tmp = t_2
else if (z <= 2.6d-27) then
tmp = x
else if (z <= 3.8d+64) 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 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -8.5e+97) {
tmp = t_1;
} else if (z <= -4.5e-34) {
tmp = t_2;
} else if (z <= 2.6e-27) {
tmp = x;
} else if (z <= 3.8e+64) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = (y - z) * t tmp = 0 if z <= -8.5e+97: tmp = t_1 elif z <= -4.5e-34: tmp = t_2 elif z <= 2.6e-27: tmp = x elif z <= 3.8e+64: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (z <= -8.5e+97) tmp = t_1; elseif (z <= -4.5e-34) tmp = t_2; elseif (z <= 2.6e-27) tmp = x; elseif (z <= 3.8e+64) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = (y - z) * t; tmp = 0.0; if (z <= -8.5e+97) tmp = t_1; elseif (z <= -4.5e-34) tmp = t_2; elseif (z <= 2.6e-27) tmp = x; elseif (z <= 3.8e+64) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -8.5e+97], t$95$1, If[LessEqual[z, -4.5e-34], t$95$2, If[LessEqual[z, 2.6e-27], x, If[LessEqual[z, 3.8e+64], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+64}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.4999999999999993e97 or 3.8000000000000001e64 < z Initial program 100.0%
Taylor expanded in y around 0 84.5%
+-commutative84.5%
mul-1-neg84.5%
unsub-neg84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in z around inf 84.5%
if -8.4999999999999993e97 < z < -4.50000000000000042e-34 or 2.60000000000000017e-27 < z < 3.8000000000000001e64Initial program 99.9%
Taylor expanded in t around inf 81.2%
Taylor expanded in x around 0 81.2%
*-commutative81.2%
fma-udef81.2%
Simplified81.2%
Taylor expanded in t around inf 76.7%
if -4.50000000000000042e-34 < z < 2.60000000000000017e-27Initial program 100.0%
Taylor expanded in t around inf 72.6%
Taylor expanded in x around inf 45.2%
Final simplification65.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* (- y z) t)))
(if (<= z -8.5e+97)
t_1
(if (<= z -1e-33)
t_2
(if (<= z 2e-23) (* x (- 1.0 y)) (if (<= z 8.2e+69) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -8.5e+97) {
tmp = t_1;
} else if (z <= -1e-33) {
tmp = t_2;
} else if (z <= 2e-23) {
tmp = x * (1.0 - y);
} else if (z <= 8.2e+69) {
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 = z * (x - t)
t_2 = (y - z) * t
if (z <= (-8.5d+97)) then
tmp = t_1
else if (z <= (-1d-33)) then
tmp = t_2
else if (z <= 2d-23) then
tmp = x * (1.0d0 - y)
else if (z <= 8.2d+69) 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 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -8.5e+97) {
tmp = t_1;
} else if (z <= -1e-33) {
tmp = t_2;
} else if (z <= 2e-23) {
tmp = x * (1.0 - y);
} else if (z <= 8.2e+69) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = (y - z) * t tmp = 0 if z <= -8.5e+97: tmp = t_1 elif z <= -1e-33: tmp = t_2 elif z <= 2e-23: tmp = x * (1.0 - y) elif z <= 8.2e+69: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (z <= -8.5e+97) tmp = t_1; elseif (z <= -1e-33) tmp = t_2; elseif (z <= 2e-23) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 8.2e+69) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = (y - z) * t; tmp = 0.0; if (z <= -8.5e+97) tmp = t_1; elseif (z <= -1e-33) tmp = t_2; elseif (z <= 2e-23) tmp = x * (1.0 - y); elseif (z <= 8.2e+69) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -8.5e+97], t$95$1, If[LessEqual[z, -1e-33], t$95$2, If[LessEqual[z, 2e-23], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.2e+69], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+69}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.4999999999999993e97 or 8.1999999999999998e69 < z Initial program 100.0%
Taylor expanded in y around 0 84.5%
+-commutative84.5%
mul-1-neg84.5%
unsub-neg84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in z around inf 84.5%
if -8.4999999999999993e97 < z < -1.0000000000000001e-33 or 1.99999999999999992e-23 < z < 8.1999999999999998e69Initial program 99.9%
Taylor expanded in t around inf 82.9%
Taylor expanded in x around 0 82.9%
*-commutative82.9%
fma-udef82.9%
Simplified82.9%
Taylor expanded in t around inf 78.2%
if -1.0000000000000001e-33 < z < 1.99999999999999992e-23Initial program 100.0%
Taylor expanded in x around inf 71.9%
*-commutative71.9%
mul-1-neg71.9%
unsub-neg71.9%
distribute-lft-out--71.9%
*-rgt-identity71.9%
Simplified71.9%
Taylor expanded in x around 0 71.9%
Taylor expanded in z around 0 71.9%
Final simplification77.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* (- y z) t)))
(if (<= z -8.5e+97)
t_1
(if (<= z -3e-34)
t_2
(if (<= z 6e-25) (- x (* y x)) (if (<= z 4.8e+69) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -8.5e+97) {
tmp = t_1;
} else if (z <= -3e-34) {
tmp = t_2;
} else if (z <= 6e-25) {
tmp = x - (y * x);
} else if (z <= 4.8e+69) {
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 = z * (x - t)
t_2 = (y - z) * t
if (z <= (-8.5d+97)) then
tmp = t_1
else if (z <= (-3d-34)) then
tmp = t_2
else if (z <= 6d-25) then
tmp = x - (y * x)
else if (z <= 4.8d+69) 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 = z * (x - t);
double t_2 = (y - z) * t;
double tmp;
if (z <= -8.5e+97) {
tmp = t_1;
} else if (z <= -3e-34) {
tmp = t_2;
} else if (z <= 6e-25) {
tmp = x - (y * x);
} else if (z <= 4.8e+69) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = (y - z) * t tmp = 0 if z <= -8.5e+97: tmp = t_1 elif z <= -3e-34: tmp = t_2 elif z <= 6e-25: tmp = x - (y * x) elif z <= 4.8e+69: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(Float64(y - z) * t) tmp = 0.0 if (z <= -8.5e+97) tmp = t_1; elseif (z <= -3e-34) tmp = t_2; elseif (z <= 6e-25) tmp = Float64(x - Float64(y * x)); elseif (z <= 4.8e+69) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = (y - z) * t; tmp = 0.0; if (z <= -8.5e+97) tmp = t_1; elseif (z <= -3e-34) tmp = t_2; elseif (z <= 6e-25) tmp = x - (y * x); elseif (z <= 4.8e+69) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[z, -8.5e+97], t$95$1, If[LessEqual[z, -3e-34], t$95$2, If[LessEqual[z, 6e-25], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+69], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-25}:\\
\;\;\;\;x - y \cdot x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+69}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.4999999999999993e97 or 4.8000000000000003e69 < z Initial program 100.0%
Taylor expanded in y around 0 84.5%
+-commutative84.5%
mul-1-neg84.5%
unsub-neg84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in z around inf 84.5%
if -8.4999999999999993e97 < z < -3e-34 or 5.9999999999999995e-25 < z < 4.8000000000000003e69Initial program 99.9%
Taylor expanded in t around inf 82.9%
Taylor expanded in x around 0 82.9%
*-commutative82.9%
fma-udef82.9%
Simplified82.9%
Taylor expanded in t around inf 78.2%
if -3e-34 < z < 5.9999999999999995e-25Initial program 100.0%
Taylor expanded in x around inf 71.9%
*-commutative71.9%
mul-1-neg71.9%
unsub-neg71.9%
distribute-lft-out--71.9%
*-rgt-identity71.9%
Simplified71.9%
Taylor expanded in y around inf 71.9%
Final simplification77.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.3e+103)
(* z x)
(if (<= z -57000000000.0)
(* y t)
(if (<= z 5.2e-27) x (if (<= z 4e+55) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e+103) {
tmp = z * x;
} else if (z <= -57000000000.0) {
tmp = y * t;
} else if (z <= 5.2e-27) {
tmp = x;
} else if (z <= 4e+55) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.3d+103)) then
tmp = z * x
else if (z <= (-57000000000.0d0)) then
tmp = y * t
else if (z <= 5.2d-27) then
tmp = x
else if (z <= 4d+55) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.3e+103) {
tmp = z * x;
} else if (z <= -57000000000.0) {
tmp = y * t;
} else if (z <= 5.2e-27) {
tmp = x;
} else if (z <= 4e+55) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.3e+103: tmp = z * x elif z <= -57000000000.0: tmp = y * t elif z <= 5.2e-27: tmp = x elif z <= 4e+55: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.3e+103) tmp = Float64(z * x); elseif (z <= -57000000000.0) tmp = Float64(y * t); elseif (z <= 5.2e-27) tmp = x; elseif (z <= 4e+55) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.3e+103) tmp = z * x; elseif (z <= -57000000000.0) tmp = y * t; elseif (z <= 5.2e-27) tmp = x; elseif (z <= 4e+55) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.3e+103], N[(z * x), $MachinePrecision], If[LessEqual[z, -57000000000.0], N[(y * t), $MachinePrecision], If[LessEqual[z, 5.2e-27], x, If[LessEqual[z, 4e+55], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+103}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq -57000000000:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-27}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+55}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -2.30000000000000008e103 or 4.00000000000000004e55 < z Initial program 100.0%
Taylor expanded in x around inf 60.8%
*-commutative60.8%
mul-1-neg60.8%
unsub-neg60.8%
distribute-lft-out--60.8%
*-rgt-identity60.8%
Simplified60.8%
Taylor expanded in z around inf 51.7%
if -2.30000000000000008e103 < z < -5.7e10 or 5.20000000000000034e-27 < z < 4.00000000000000004e55Initial program 99.9%
Taylor expanded in t around inf 78.3%
Taylor expanded in y around inf 41.7%
if -5.7e10 < z < 5.20000000000000034e-27Initial program 100.0%
Taylor expanded in t around inf 73.4%
Taylor expanded in x around inf 42.7%
Final simplification45.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6700000000000.0) (not (<= x 2.35e+55))) (* x (- (+ z 1.0) y)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6700000000000.0) || !(x <= 2.35e+55)) {
tmp = x * ((z + 1.0) - y);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-6700000000000.0d0)) .or. (.not. (x <= 2.35d+55))) then
tmp = x * ((z + 1.0d0) - y)
else
tmp = x + ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6700000000000.0) || !(x <= 2.35e+55)) {
tmp = x * ((z + 1.0) - y);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6700000000000.0) or not (x <= 2.35e+55): tmp = x * ((z + 1.0) - y) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -6700000000000.0) || !(x <= 2.35e+55)) tmp = Float64(x * Float64(Float64(z + 1.0) - y)); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6700000000000.0) || ~((x <= 2.35e+55))) tmp = x * ((z + 1.0) - y); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6700000000000.0], N[Not[LessEqual[x, 2.35e+55]], $MachinePrecision]], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6700000000000 \lor \neg \left(x \leq 2.35 \cdot 10^{+55}\right):\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -6.7e12 or 2.35e55 < x Initial program 100.0%
Taylor expanded in x around inf 90.0%
*-commutative90.0%
mul-1-neg90.0%
unsub-neg90.0%
distribute-lft-out--90.0%
*-rgt-identity90.0%
Simplified90.0%
Taylor expanded in x around 0 90.0%
if -6.7e12 < x < 2.35e55Initial program 100.0%
Taylor expanded in t around inf 87.3%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (if (<= x -185000000000.0) (* x (- (+ z 1.0) y)) (if (<= x 1.45e+60) (+ x (* (- y z) t)) (+ x (* x (- z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -185000000000.0) {
tmp = x * ((z + 1.0) - y);
} else if (x <= 1.45e+60) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - 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 <= (-185000000000.0d0)) then
tmp = x * ((z + 1.0d0) - y)
else if (x <= 1.45d+60) then
tmp = x + ((y - z) * t)
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -185000000000.0) {
tmp = x * ((z + 1.0) - y);
} else if (x <= 1.45e+60) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -185000000000.0: tmp = x * ((z + 1.0) - y) elif x <= 1.45e+60: tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -185000000000.0) tmp = Float64(x * Float64(Float64(z + 1.0) - y)); elseif (x <= 1.45e+60) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -185000000000.0) tmp = x * ((z + 1.0) - y); elseif (x <= 1.45e+60) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -185000000000.0], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45e+60], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -185000000000:\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+60}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if x < -1.85e11Initial program 100.0%
Taylor expanded in x around inf 90.1%
*-commutative90.1%
mul-1-neg90.1%
unsub-neg90.1%
distribute-lft-out--90.1%
*-rgt-identity90.1%
Simplified90.1%
Taylor expanded in x around 0 90.1%
if -1.85e11 < x < 1.45e60Initial program 100.0%
Taylor expanded in t around inf 87.3%
if 1.45e60 < x Initial program 100.0%
Taylor expanded in x around inf 89.9%
*-commutative89.9%
mul-1-neg89.9%
unsub-neg89.9%
distribute-lft-out--90.0%
*-rgt-identity90.0%
Simplified90.0%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= y -4.5e+23) (* y t) (if (<= y 9e-6) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.5e+23) {
tmp = y * t;
} else if (y <= 9e-6) {
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 <= (-4.5d+23)) then
tmp = y * t
else if (y <= 9d-6) 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 <= -4.5e+23) {
tmp = y * t;
} else if (y <= 9e-6) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.5e+23: tmp = y * t elif y <= 9e-6: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.5e+23) tmp = Float64(y * t); elseif (y <= 9e-6) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.5e+23) tmp = y * t; elseif (y <= 9e-6) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.5e+23], N[(y * t), $MachinePrecision], If[LessEqual[y, 9e-6], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+23}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -4.49999999999999979e23 or 9.00000000000000023e-6 < y Initial program 100.0%
Taylor expanded in t around inf 50.8%
Taylor expanded in y around inf 38.6%
if -4.49999999999999979e23 < y < 9.00000000000000023e-6Initial program 99.9%
Taylor expanded in t around inf 76.9%
Taylor expanded in x around inf 40.2%
Final simplification39.5%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in t around inf 64.4%
Taylor expanded in x around inf 22.3%
Final simplification22.3%
(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 2023196
(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))))