
(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 17 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 (<= t -5.1e+85)
t_1
(if (<= t -2.3e-9)
(* z (- x t))
(if (or (<= t 0.0071) (and (not (<= t 4e+65)) (<= t 1.9e+98)))
(* x (- (+ z 1.0) y))
t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -5.1e+85) {
tmp = t_1;
} else if (t <= -2.3e-9) {
tmp = z * (x - t);
} else if ((t <= 0.0071) || (!(t <= 4e+65) && (t <= 1.9e+98))) {
tmp = x * ((z + 1.0) - y);
} 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 <= (-5.1d+85)) then
tmp = t_1
else if (t <= (-2.3d-9)) then
tmp = z * (x - t)
else if ((t <= 0.0071d0) .or. (.not. (t <= 4d+65)) .and. (t <= 1.9d+98)) then
tmp = x * ((z + 1.0d0) - y)
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 <= -5.1e+85) {
tmp = t_1;
} else if (t <= -2.3e-9) {
tmp = z * (x - t);
} else if ((t <= 0.0071) || (!(t <= 4e+65) && (t <= 1.9e+98))) {
tmp = x * ((z + 1.0) - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -5.1e+85: tmp = t_1 elif t <= -2.3e-9: tmp = z * (x - t) elif (t <= 0.0071) or (not (t <= 4e+65) and (t <= 1.9e+98)): tmp = x * ((z + 1.0) - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -5.1e+85) tmp = t_1; elseif (t <= -2.3e-9) tmp = Float64(z * Float64(x - t)); elseif ((t <= 0.0071) || (!(t <= 4e+65) && (t <= 1.9e+98))) tmp = Float64(x * Float64(Float64(z + 1.0) - y)); 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 <= -5.1e+85) tmp = t_1; elseif (t <= -2.3e-9) tmp = z * (x - t); elseif ((t <= 0.0071) || (~((t <= 4e+65)) && (t <= 1.9e+98))) tmp = x * ((z + 1.0) - y); 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, -5.1e+85], t$95$1, If[LessEqual[t, -2.3e-9], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 0.0071], And[N[Not[LessEqual[t, 4e+65]], $MachinePrecision], LessEqual[t, 1.9e+98]]], N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -5.1 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-9}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;t \leq 0.0071 \lor \neg \left(t \leq 4 \cdot 10^{+65}\right) \land t \leq 1.9 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.0999999999999998e85 or 0.0071000000000000004 < t < 4e65 or 1.89999999999999995e98 < t Initial program 100.0%
Taylor expanded in x around -inf 96.1%
+-commutative96.1%
mul-1-neg96.1%
unsub-neg96.1%
sub-neg96.1%
+-commutative96.1%
distribute-neg-in96.1%
metadata-eval96.1%
associate-+l+96.1%
+-commutative96.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in t around inf 83.8%
if -5.0999999999999998e85 < t < -2.2999999999999999e-9Initial program 100.0%
Taylor expanded in x around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
associate-+l+100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 75.6%
cancel-sign-sub-inv75.6%
metadata-eval75.6%
*-lft-identity75.6%
+-commutative75.6%
mul-1-neg75.6%
sub-neg75.6%
Simplified75.6%
if -2.2999999999999999e-9 < t < 0.0071000000000000004 or 4e65 < t < 1.89999999999999995e98Initial program 100.0%
Taylor expanded in x around -inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
associate-+l+99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in x around inf 86.2%
Final simplification84.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -8e-68)
t_1
(if (<= t 1.9e-77)
(* x (- 1.0 y))
(if (or (<= t 0.00096) (and (not (<= t 3.15e+66)) (<= t 1.45e+98)))
(* x (+ z 1.0))
t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -8e-68) {
tmp = t_1;
} else if (t <= 1.9e-77) {
tmp = x * (1.0 - y);
} else if ((t <= 0.00096) || (!(t <= 3.15e+66) && (t <= 1.45e+98))) {
tmp = x * (z + 1.0);
} 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 <= (-8d-68)) then
tmp = t_1
else if (t <= 1.9d-77) then
tmp = x * (1.0d0 - y)
else if ((t <= 0.00096d0) .or. (.not. (t <= 3.15d+66)) .and. (t <= 1.45d+98)) then
tmp = x * (z + 1.0d0)
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 <= -8e-68) {
tmp = t_1;
} else if (t <= 1.9e-77) {
tmp = x * (1.0 - y);
} else if ((t <= 0.00096) || (!(t <= 3.15e+66) && (t <= 1.45e+98))) {
tmp = x * (z + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -8e-68: tmp = t_1 elif t <= 1.9e-77: tmp = x * (1.0 - y) elif (t <= 0.00096) or (not (t <= 3.15e+66) and (t <= 1.45e+98)): tmp = x * (z + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) tmp = 0.0 if (t <= -8e-68) tmp = t_1; elseif (t <= 1.9e-77) tmp = Float64(x * Float64(1.0 - y)); elseif ((t <= 0.00096) || (!(t <= 3.15e+66) && (t <= 1.45e+98))) tmp = Float64(x * Float64(z + 1.0)); 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 <= -8e-68) tmp = t_1; elseif (t <= 1.9e-77) tmp = x * (1.0 - y); elseif ((t <= 0.00096) || (~((t <= 3.15e+66)) && (t <= 1.45e+98))) tmp = x * (z + 1.0); 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, -8e-68], t$95$1, If[LessEqual[t, 1.9e-77], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 0.00096], And[N[Not[LessEqual[t, 3.15e+66]], $MachinePrecision], LessEqual[t, 1.45e+98]]], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -8 \cdot 10^{-68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-77}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;t \leq 0.00096 \lor \neg \left(t \leq 3.15 \cdot 10^{+66}\right) \land t \leq 1.45 \cdot 10^{+98}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.00000000000000053e-68 or 9.60000000000000024e-4 < t < 3.1499999999999999e66 or 1.45000000000000005e98 < t Initial program 100.0%
Taylor expanded in x around -inf 96.9%
+-commutative96.9%
mul-1-neg96.9%
unsub-neg96.9%
sub-neg96.9%
+-commutative96.9%
distribute-neg-in96.9%
metadata-eval96.9%
associate-+l+96.9%
+-commutative96.9%
sub-neg96.9%
Simplified96.9%
Taylor expanded in t around inf 75.8%
if -8.00000000000000053e-68 < t < 1.8999999999999999e-77Initial program 100.0%
Taylor expanded in x around -inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
associate-+l+99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 71.3%
*-commutative71.3%
sub-neg71.3%
metadata-eval71.3%
Simplified71.3%
Taylor expanded in t around 0 66.2%
mul-1-neg66.2%
sub-neg66.2%
metadata-eval66.2%
distribute-rgt-neg-in66.2%
neg-sub066.2%
metadata-eval66.2%
sub-neg66.2%
associate-+l-66.2%
neg-sub066.2%
+-commutative66.2%
sub-neg66.2%
Simplified66.2%
if 1.8999999999999999e-77 < t < 9.60000000000000024e-4 or 3.1499999999999999e66 < t < 1.45000000000000005e98Initial program 100.0%
Taylor expanded in x around -inf 77.1%
mul-1-neg77.1%
*-commutative77.1%
distribute-rgt-neg-in77.1%
+-commutative77.1%
Simplified77.1%
Taylor expanded in y around 0 66.5%
Final simplification71.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y t))) (t_2 (* z (- x t))))
(if (<= z -3450000000000.0)
t_2
(if (<= z -8.5e-26)
(* y (- t x))
(if (<= z 5e-220)
t_1
(if (<= z 1.4e-68) (* x (- 1.0 y)) (if (<= z 1100.0) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double t_2 = z * (x - t);
double tmp;
if (z <= -3450000000000.0) {
tmp = t_2;
} else if (z <= -8.5e-26) {
tmp = y * (t - x);
} else if (z <= 5e-220) {
tmp = t_1;
} else if (z <= 1.4e-68) {
tmp = x * (1.0 - y);
} else if (z <= 1100.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * t)
t_2 = z * (x - t)
if (z <= (-3450000000000.0d0)) then
tmp = t_2
else if (z <= (-8.5d-26)) then
tmp = y * (t - x)
else if (z <= 5d-220) then
tmp = t_1
else if (z <= 1.4d-68) then
tmp = x * (1.0d0 - y)
else if (z <= 1100.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (y * t);
double t_2 = z * (x - t);
double tmp;
if (z <= -3450000000000.0) {
tmp = t_2;
} else if (z <= -8.5e-26) {
tmp = y * (t - x);
} else if (z <= 5e-220) {
tmp = t_1;
} else if (z <= 1.4e-68) {
tmp = x * (1.0 - y);
} else if (z <= 1100.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * t) t_2 = z * (x - t) tmp = 0 if z <= -3450000000000.0: tmp = t_2 elif z <= -8.5e-26: tmp = y * (t - x) elif z <= 5e-220: tmp = t_1 elif z <= 1.4e-68: tmp = x * (1.0 - y) elif z <= 1100.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * t)) t_2 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -3450000000000.0) tmp = t_2; elseif (z <= -8.5e-26) tmp = Float64(y * Float64(t - x)); elseif (z <= 5e-220) tmp = t_1; elseif (z <= 1.4e-68) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 1100.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * t); t_2 = z * (x - t); tmp = 0.0; if (z <= -3450000000000.0) tmp = t_2; elseif (z <= -8.5e-26) tmp = y * (t - x); elseif (z <= 5e-220) tmp = t_1; elseif (z <= 1.4e-68) tmp = x * (1.0 - y); elseif (z <= 1100.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3450000000000.0], t$95$2, If[LessEqual[z, -8.5e-26], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-220], t$95$1, If[LessEqual[z, 1.4e-68], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1100.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot t\\
t_2 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -3450000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-26}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-220}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-68}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 1100:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.45e12 or 1100 < z Initial program 100.0%
Taylor expanded in x around -inf 97.5%
+-commutative97.5%
mul-1-neg97.5%
unsub-neg97.5%
sub-neg97.5%
+-commutative97.5%
distribute-neg-in97.5%
metadata-eval97.5%
associate-+l+97.5%
+-commutative97.5%
sub-neg97.5%
Simplified97.5%
Taylor expanded in z around inf 79.0%
cancel-sign-sub-inv79.0%
metadata-eval79.0%
*-lft-identity79.0%
+-commutative79.0%
mul-1-neg79.0%
sub-neg79.0%
Simplified79.0%
if -3.45e12 < z < -8.50000000000000004e-26Initial program 100.0%
Taylor expanded in x around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
associate-+l+100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 89.3%
if -8.50000000000000004e-26 < z < 5.0000000000000002e-220 or 1.4000000000000001e-68 < z < 1100Initial program 100.0%
Taylor expanded in t around inf 78.7%
Taylor expanded in y around inf 73.2%
*-commutative73.2%
Simplified73.2%
if 5.0000000000000002e-220 < z < 1.4000000000000001e-68Initial program 99.9%
Taylor expanded in x around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
associate-+l+100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 88.7%
*-commutative88.7%
sub-neg88.7%
metadata-eval88.7%
Simplified88.7%
Taylor expanded in t around 0 75.7%
mul-1-neg75.7%
sub-neg75.7%
metadata-eval75.7%
distribute-rgt-neg-in75.7%
neg-sub075.7%
metadata-eval75.7%
sub-neg75.7%
associate-+l-75.7%
neg-sub075.7%
+-commutative75.7%
sub-neg75.7%
Simplified75.7%
Final simplification76.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* (- y z) t))))
(if (<= t -7.1e+84)
t_1
(if (<= t -1.2e+15)
(* z (- x t))
(if (or (<= t -2.95e-36) (not (<= t 0.0085)))
t_1
(* x (- (+ z 1.0) y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double tmp;
if (t <= -7.1e+84) {
tmp = t_1;
} else if (t <= -1.2e+15) {
tmp = z * (x - t);
} else if ((t <= -2.95e-36) || !(t <= 0.0085)) {
tmp = t_1;
} else {
tmp = x * ((z + 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) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * t)
if (t <= (-7.1d+84)) then
tmp = t_1
else if (t <= (-1.2d+15)) then
tmp = z * (x - t)
else if ((t <= (-2.95d-36)) .or. (.not. (t <= 0.0085d0))) then
tmp = t_1
else
tmp = x * ((z + 1.0d0) - y)
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 (t <= -7.1e+84) {
tmp = t_1;
} else if (t <= -1.2e+15) {
tmp = z * (x - t);
} else if ((t <= -2.95e-36) || !(t <= 0.0085)) {
tmp = t_1;
} else {
tmp = x * ((z + 1.0) - y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y - z) * t) tmp = 0 if t <= -7.1e+84: tmp = t_1 elif t <= -1.2e+15: tmp = z * (x - t) elif (t <= -2.95e-36) or not (t <= 0.0085): tmp = t_1 else: tmp = x * ((z + 1.0) - y) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (t <= -7.1e+84) tmp = t_1; elseif (t <= -1.2e+15) tmp = Float64(z * Float64(x - t)); elseif ((t <= -2.95e-36) || !(t <= 0.0085)) tmp = t_1; else tmp = Float64(x * Float64(Float64(z + 1.0) - y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y - z) * t); tmp = 0.0; if (t <= -7.1e+84) tmp = t_1; elseif (t <= -1.2e+15) tmp = z * (x - t); elseif ((t <= -2.95e-36) || ~((t <= 0.0085))) tmp = t_1; else tmp = x * ((z + 1.0) - y); 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[t, -7.1e+84], t$95$1, If[LessEqual[t, -1.2e+15], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.95e-36], N[Not[LessEqual[t, 0.0085]], $MachinePrecision]], t$95$1, N[(x * N[(N[(z + 1.0), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -7.1 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{+15}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;t \leq -2.95 \cdot 10^{-36} \lor \neg \left(t \leq 0.0085\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(z + 1\right) - y\right)\\
\end{array}
\end{array}
if t < -7.0999999999999998e84 or -1.2e15 < t < -2.94999999999999998e-36 or 0.0085000000000000006 < t Initial program 100.0%
Taylor expanded in t around inf 91.1%
if -7.0999999999999998e84 < t < -1.2e15Initial program 100.0%
Taylor expanded in x around -inf 100.0%
+-commutative100.0%
mul-1-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
associate-+l+100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 82.2%
cancel-sign-sub-inv82.2%
metadata-eval82.2%
*-lft-identity82.2%
+-commutative82.2%
mul-1-neg82.2%
sub-neg82.2%
Simplified82.2%
if -2.94999999999999998e-36 < t < 0.0085000000000000006Initial program 100.0%
Taylor expanded in x around -inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
associate-+l+99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in x around inf 87.1%
Final simplification88.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* (- y z) t))))
(if (<= t -7.2e+84)
t_1
(if (<= t -2.1e-41)
(+ x (* z (- x t)))
(if (<= t 0.038) (+ x (* x (- z y))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double tmp;
if (t <= -7.2e+84) {
tmp = t_1;
} else if (t <= -2.1e-41) {
tmp = x + (z * (x - t));
} else if (t <= 0.038) {
tmp = x + (x * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((y - z) * t)
if (t <= (-7.2d+84)) then
tmp = t_1
else if (t <= (-2.1d-41)) then
tmp = x + (z * (x - t))
else if (t <= 0.038d0) then
tmp = x + (x * (z - y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y - z) * t);
double tmp;
if (t <= -7.2e+84) {
tmp = t_1;
} else if (t <= -2.1e-41) {
tmp = x + (z * (x - t));
} else if (t <= 0.038) {
tmp = x + (x * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y - z) * t) tmp = 0 if t <= -7.2e+84: tmp = t_1 elif t <= -2.1e-41: tmp = x + (z * (x - t)) elif t <= 0.038: tmp = x + (x * (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (t <= -7.2e+84) tmp = t_1; elseif (t <= -2.1e-41) tmp = Float64(x + Float64(z * Float64(x - t))); elseif (t <= 0.038) tmp = Float64(x + Float64(x * Float64(z - y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y - z) * t); tmp = 0.0; if (t <= -7.2e+84) tmp = t_1; elseif (t <= -2.1e-41) tmp = x + (z * (x - t)); elseif (t <= 0.038) tmp = x + (x * (z - y)); else tmp = t_1; 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[t, -7.2e+84], t$95$1, If[LessEqual[t, -2.1e-41], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.038], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-41}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\mathbf{elif}\;t \leq 0.038:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7.1999999999999999e84 or 0.0379999999999999991 < t Initial program 100.0%
Taylor expanded in t around inf 92.1%
if -7.1999999999999999e84 < t < -2.10000000000000013e-41Initial program 100.0%
Taylor expanded in y around 0 81.7%
mul-1-neg81.7%
unsub-neg81.7%
Simplified81.7%
if -2.10000000000000013e-41 < t < 0.0379999999999999991Initial program 100.0%
Taylor expanded in x around inf 87.1%
mul-1-neg87.1%
unsub-neg87.1%
distribute-lft-out--87.2%
*-rgt-identity87.2%
Simplified87.2%
Final simplification88.8%
(FPCore (x y z t)
:precision binary64
(if (<= z -255000.0)
(* z x)
(if (<= z 2.8e-269)
(* y t)
(if (<= z 9e-10) x (if (<= z 8.2e+108) (* y (- x)) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -255000.0) {
tmp = z * x;
} else if (z <= 2.8e-269) {
tmp = y * t;
} else if (z <= 9e-10) {
tmp = x;
} else if (z <= 8.2e+108) {
tmp = y * -x;
} 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 <= (-255000.0d0)) then
tmp = z * x
else if (z <= 2.8d-269) then
tmp = y * t
else if (z <= 9d-10) then
tmp = x
else if (z <= 8.2d+108) then
tmp = y * -x
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 <= -255000.0) {
tmp = z * x;
} else if (z <= 2.8e-269) {
tmp = y * t;
} else if (z <= 9e-10) {
tmp = x;
} else if (z <= 8.2e+108) {
tmp = y * -x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -255000.0: tmp = z * x elif z <= 2.8e-269: tmp = y * t elif z <= 9e-10: tmp = x elif z <= 8.2e+108: tmp = y * -x else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -255000.0) tmp = Float64(z * x); elseif (z <= 2.8e-269) tmp = Float64(y * t); elseif (z <= 9e-10) tmp = x; elseif (z <= 8.2e+108) tmp = Float64(y * Float64(-x)); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -255000.0) tmp = z * x; elseif (z <= 2.8e-269) tmp = y * t; elseif (z <= 9e-10) tmp = x; elseif (z <= 8.2e+108) tmp = y * -x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -255000.0], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.8e-269], N[(y * t), $MachinePrecision], If[LessEqual[z, 9e-10], x, If[LessEqual[z, 8.2e+108], N[(y * (-x)), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -255000:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-269}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+108}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -255000 or 8.1999999999999998e108 < z Initial program 100.0%
Taylor expanded in x around inf 61.7%
mul-1-neg61.7%
unsub-neg61.7%
distribute-lft-out--61.7%
*-rgt-identity61.7%
Simplified61.7%
Taylor expanded in z around inf 50.1%
if -255000 < z < 2.79999999999999995e-269Initial program 100.0%
Taylor expanded in x around -inf 98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
sub-neg98.7%
+-commutative98.7%
distribute-neg-in98.7%
metadata-eval98.7%
associate-+l+98.7%
+-commutative98.7%
sub-neg98.7%
Simplified98.7%
Taylor expanded in z around 0 93.1%
*-commutative93.1%
sub-neg93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in t around inf 43.9%
*-commutative43.9%
Simplified43.9%
if 2.79999999999999995e-269 < z < 8.9999999999999999e-10Initial program 100.0%
Taylor expanded in t around inf 79.6%
Taylor expanded in x around inf 46.8%
if 8.9999999999999999e-10 < z < 8.1999999999999998e108Initial program 99.8%
Taylor expanded in x around inf 48.7%
mul-1-neg48.7%
unsub-neg48.7%
distribute-lft-out--48.7%
*-rgt-identity48.7%
Simplified48.7%
Taylor expanded in y around inf 37.0%
mul-1-neg37.0%
distribute-rgt-neg-in37.0%
Simplified37.0%
Final simplification46.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -510000.0)
(* z x)
(if (<= z 4.8e-268)
(* y t)
(if (<= z 1.1e-22) x (if (<= z 1.2e+105) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -510000.0) {
tmp = z * x;
} else if (z <= 4.8e-268) {
tmp = y * t;
} else if (z <= 1.1e-22) {
tmp = x;
} else if (z <= 1.2e+105) {
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 <= (-510000.0d0)) then
tmp = z * x
else if (z <= 4.8d-268) then
tmp = y * t
else if (z <= 1.1d-22) then
tmp = x
else if (z <= 1.2d+105) 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 <= -510000.0) {
tmp = z * x;
} else if (z <= 4.8e-268) {
tmp = y * t;
} else if (z <= 1.1e-22) {
tmp = x;
} else if (z <= 1.2e+105) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -510000.0: tmp = z * x elif z <= 4.8e-268: tmp = y * t elif z <= 1.1e-22: tmp = x elif z <= 1.2e+105: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -510000.0) tmp = Float64(z * x); elseif (z <= 4.8e-268) tmp = Float64(y * t); elseif (z <= 1.1e-22) tmp = x; elseif (z <= 1.2e+105) 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 <= -510000.0) tmp = z * x; elseif (z <= 4.8e-268) tmp = y * t; elseif (z <= 1.1e-22) tmp = x; elseif (z <= 1.2e+105) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -510000.0], N[(z * x), $MachinePrecision], If[LessEqual[z, 4.8e-268], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.1e-22], x, If[LessEqual[z, 1.2e+105], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -510000:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-268}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-22}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+105}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -5.1e5 or 1.19999999999999987e105 < z Initial program 100.0%
Taylor expanded in x around inf 61.4%
mul-1-neg61.4%
unsub-neg61.4%
distribute-lft-out--61.4%
*-rgt-identity61.4%
Simplified61.4%
Taylor expanded in z around inf 49.2%
if -5.1e5 < z < 4.7999999999999998e-268 or 1.1e-22 < z < 1.19999999999999987e105Initial program 99.9%
Taylor expanded in x around -inf 98.1%
+-commutative98.1%
mul-1-neg98.1%
unsub-neg98.1%
sub-neg98.1%
+-commutative98.1%
distribute-neg-in98.1%
metadata-eval98.1%
associate-+l+98.1%
+-commutative98.1%
sub-neg98.1%
Simplified98.1%
Taylor expanded in z around 0 82.8%
*-commutative82.8%
sub-neg82.8%
metadata-eval82.8%
Simplified82.8%
Taylor expanded in t around inf 39.4%
*-commutative39.4%
Simplified39.4%
if 4.7999999999999998e-268 < z < 1.1e-22Initial program 100.0%
Taylor expanded in t around inf 77.8%
Taylor expanded in x around inf 48.6%
Final simplification44.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -1100000000000.0)
t_1
(if (<= z 1.3e-271)
(* y (- t x))
(if (<= z 1.8e+32) (* x (- 1.0 y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1100000000000.0) {
tmp = t_1;
} else if (z <= 1.3e-271) {
tmp = y * (t - x);
} else if (z <= 1.8e+32) {
tmp = x * (1.0 - y);
} 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 = z * (x - t)
if (z <= (-1100000000000.0d0)) then
tmp = t_1
else if (z <= 1.3d-271) then
tmp = y * (t - x)
else if (z <= 1.8d+32) then
tmp = x * (1.0d0 - y)
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 tmp;
if (z <= -1100000000000.0) {
tmp = t_1;
} else if (z <= 1.3e-271) {
tmp = y * (t - x);
} else if (z <= 1.8e+32) {
tmp = x * (1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1100000000000.0: tmp = t_1 elif z <= 1.3e-271: tmp = y * (t - x) elif z <= 1.8e+32: tmp = x * (1.0 - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -1100000000000.0) tmp = t_1; elseif (z <= 1.3e-271) tmp = Float64(y * Float64(t - x)); elseif (z <= 1.8e+32) tmp = Float64(x * Float64(1.0 - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -1100000000000.0) tmp = t_1; elseif (z <= 1.3e-271) tmp = y * (t - x); elseif (z <= 1.8e+32) tmp = x * (1.0 - y); 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]}, If[LessEqual[z, -1100000000000.0], t$95$1, If[LessEqual[z, 1.3e-271], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+32], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1100000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-271}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+32}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.1e12 or 1.7999999999999998e32 < z Initial program 100.0%
Taylor expanded in x around -inf 98.2%
+-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
sub-neg98.2%
+-commutative98.2%
distribute-neg-in98.2%
metadata-eval98.2%
associate-+l+98.2%
+-commutative98.2%
sub-neg98.2%
Simplified98.2%
Taylor expanded in z around inf 81.0%
cancel-sign-sub-inv81.0%
metadata-eval81.0%
*-lft-identity81.0%
+-commutative81.0%
mul-1-neg81.0%
sub-neg81.0%
Simplified81.0%
if -1.1e12 < z < 1.3e-271Initial program 100.0%
Taylor expanded in x around -inf 98.7%
+-commutative98.7%
mul-1-neg98.7%
unsub-neg98.7%
sub-neg98.7%
+-commutative98.7%
distribute-neg-in98.7%
metadata-eval98.7%
associate-+l+98.7%
+-commutative98.7%
sub-neg98.7%
Simplified98.7%
Taylor expanded in y around inf 68.5%
if 1.3e-271 < z < 1.7999999999999998e32Initial program 100.0%
Taylor expanded in x around -inf 98.4%
+-commutative98.4%
mul-1-neg98.4%
unsub-neg98.4%
sub-neg98.4%
+-commutative98.4%
distribute-neg-in98.4%
metadata-eval98.4%
associate-+l+98.4%
+-commutative98.4%
sub-neg98.4%
Simplified98.4%
Taylor expanded in z around 0 84.6%
*-commutative84.6%
sub-neg84.6%
metadata-eval84.6%
Simplified84.6%
Taylor expanded in t around 0 67.3%
mul-1-neg67.3%
sub-neg67.3%
metadata-eval67.3%
distribute-rgt-neg-in67.3%
neg-sub067.3%
metadata-eval67.3%
sub-neg67.3%
associate-+l-67.3%
neg-sub067.3%
+-commutative67.3%
sub-neg67.3%
Simplified67.3%
Final simplification73.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -17000000000.0) (not (<= z 2.45e+32))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -17000000000.0) || !(z <= 2.45e+32)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-17000000000.0d0)) .or. (.not. (z <= 2.45d+32))) then
tmp = z * (x - t)
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -17000000000.0) || !(z <= 2.45e+32)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -17000000000.0) or not (z <= 2.45e+32): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -17000000000.0) || !(z <= 2.45e+32)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -17000000000.0) || ~((z <= 2.45e+32))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -17000000000.0], N[Not[LessEqual[z, 2.45e+32]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -17000000000 \lor \neg \left(z \leq 2.45 \cdot 10^{+32}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
if z < -1.7e10 or 2.4500000000000001e32 < z Initial program 100.0%
Taylor expanded in x around -inf 98.2%
+-commutative98.2%
mul-1-neg98.2%
unsub-neg98.2%
sub-neg98.2%
+-commutative98.2%
distribute-neg-in98.2%
metadata-eval98.2%
associate-+l+98.2%
+-commutative98.2%
sub-neg98.2%
Simplified98.2%
Taylor expanded in z around inf 81.0%
cancel-sign-sub-inv81.0%
metadata-eval81.0%
*-lft-identity81.0%
+-commutative81.0%
mul-1-neg81.0%
sub-neg81.0%
Simplified81.0%
if -1.7e10 < z < 2.4500000000000001e32Initial program 100.0%
Taylor expanded in y around inf 89.9%
*-commutative89.9%
Simplified89.9%
Final simplification86.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.1e-47) (not (<= t 8.2e-78))) (* (- y z) t) (* y (- x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.1e-47) || !(t <= 8.2e-78)) {
tmp = (y - z) * t;
} 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) :: tmp
if ((t <= (-4.1d-47)) .or. (.not. (t <= 8.2d-78))) then
tmp = (y - z) * t
else
tmp = y * -x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.1e-47) || !(t <= 8.2e-78)) {
tmp = (y - z) * t;
} else {
tmp = y * -x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.1e-47) or not (t <= 8.2e-78): tmp = (y - z) * t else: tmp = y * -x return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.1e-47) || !(t <= 8.2e-78)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(y * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.1e-47) || ~((t <= 8.2e-78))) tmp = (y - z) * t; else tmp = y * -x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.1e-47], N[Not[LessEqual[t, 8.2e-78]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{-47} \lor \neg \left(t \leq 8.2 \cdot 10^{-78}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\end{array}
\end{array}
if t < -4.10000000000000002e-47 or 8.1999999999999996e-78 < t Initial program 100.0%
Taylor expanded in x around -inf 97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
sub-neg97.3%
+-commutative97.3%
distribute-neg-in97.3%
metadata-eval97.3%
associate-+l+97.3%
+-commutative97.3%
sub-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 68.5%
if -4.10000000000000002e-47 < t < 8.1999999999999996e-78Initial program 100.0%
Taylor expanded in x around inf 89.6%
mul-1-neg89.6%
unsub-neg89.6%
distribute-lft-out--89.6%
*-rgt-identity89.6%
Simplified89.6%
Taylor expanded in y around inf 43.0%
mul-1-neg43.0%
distribute-rgt-neg-in43.0%
Simplified43.0%
Final simplification58.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.5e+14) (not (<= x 8.2e+102))) (* x (+ z 1.0)) (* (- y z) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.5e+14) || !(x <= 8.2e+102)) {
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 <= (-4.5d+14)) .or. (.not. (x <= 8.2d+102))) 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 <= -4.5e+14) || !(x <= 8.2e+102)) {
tmp = x * (z + 1.0);
} else {
tmp = (y - z) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.5e+14) or not (x <= 8.2e+102): tmp = x * (z + 1.0) else: tmp = (y - z) * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.5e+14) || !(x <= 8.2e+102)) 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 <= -4.5e+14) || ~((x <= 8.2e+102))) tmp = x * (z + 1.0); else tmp = (y - z) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.5e+14], N[Not[LessEqual[x, 8.2e+102]], $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 -4.5 \cdot 10^{+14} \lor \neg \left(x \leq 8.2 \cdot 10^{+102}\right):\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -4.5e14 or 8.1999999999999999e102 < x Initial program 100.0%
Taylor expanded in x around -inf 92.7%
mul-1-neg92.7%
*-commutative92.7%
distribute-rgt-neg-in92.7%
+-commutative92.7%
Simplified92.7%
Taylor expanded in y around 0 59.8%
if -4.5e14 < x < 8.1999999999999999e102Initial program 100.0%
Taylor expanded in x around -inf 99.3%
+-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
associate-+l+99.3%
+-commutative99.3%
sub-neg99.3%
Simplified99.3%
Taylor expanded in t around inf 65.3%
Final simplification63.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -320000.0) (not (<= y 2.8))) (* y (- t x)) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -320000.0) || !(y <= 2.8)) {
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 <= (-320000.0d0)) .or. (.not. (y <= 2.8d0))) 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 <= -320000.0) || !(y <= 2.8)) {
tmp = y * (t - x);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -320000.0) or not (y <= 2.8): tmp = y * (t - x) else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -320000.0) || !(y <= 2.8)) 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 <= -320000.0) || ~((y <= 2.8))) tmp = y * (t - x); else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -320000.0], N[Not[LessEqual[y, 2.8]], $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 -320000 \lor \neg \left(y \leq 2.8\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
if y < -3.2e5 or 2.7999999999999998 < y Initial program 100.0%
Taylor expanded in x around -inf 97.7%
+-commutative97.7%
mul-1-neg97.7%
unsub-neg97.7%
sub-neg97.7%
+-commutative97.7%
distribute-neg-in97.7%
metadata-eval97.7%
associate-+l+97.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in y around inf 79.8%
if -3.2e5 < y < 2.7999999999999998Initial program 100.0%
Taylor expanded in x around -inf 62.6%
mul-1-neg62.6%
*-commutative62.6%
distribute-rgt-neg-in62.6%
+-commutative62.6%
Simplified62.6%
Taylor expanded in y around 0 61.6%
Final simplification71.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.2e+57) (not (<= y 0.65))) (* y (- t x)) (- x (* z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.2e+57) || !(y <= 0.65)) {
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.2d+57)) .or. (.not. (y <= 0.65d0))) 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.2e+57) || !(y <= 0.65)) {
tmp = y * (t - x);
} else {
tmp = x - (z * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.2e+57) or not (y <= 0.65): tmp = y * (t - x) else: tmp = x - (z * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.2e+57) || !(y <= 0.65)) 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.2e+57) || ~((y <= 0.65))) tmp = y * (t - x); else tmp = x - (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.2e+57], N[Not[LessEqual[y, 0.65]], $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.2 \cdot 10^{+57} \lor \neg \left(y \leq 0.65\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\
\end{array}
\end{array}
if y < -3.20000000000000029e57 or 0.650000000000000022 < y Initial program 100.0%
Taylor expanded in x around -inf 97.7%
+-commutative97.7%
mul-1-neg97.7%
unsub-neg97.7%
sub-neg97.7%
+-commutative97.7%
distribute-neg-in97.7%
metadata-eval97.7%
associate-+l+97.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in y around inf 81.6%
if -3.20000000000000029e57 < y < 0.650000000000000022Initial program 100.0%
Taylor expanded in t around inf 72.4%
Taylor expanded in y around 0 72.4%
Taylor expanded in y around 0 65.4%
mul-1-neg65.4%
unsub-neg65.4%
Simplified65.4%
Final simplification73.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 (<= z -30500.0) (* z x) (if (<= z 2.2e+18) x (* z x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -30500.0) {
tmp = z * x;
} else if (z <= 2.2e+18) {
tmp = x;
} 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 <= (-30500.0d0)) then
tmp = z * x
else if (z <= 2.2d+18) then
tmp = x
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 <= -30500.0) {
tmp = z * x;
} else if (z <= 2.2e+18) {
tmp = x;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -30500.0: tmp = z * x elif z <= 2.2e+18: tmp = x else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -30500.0) tmp = Float64(z * x); elseif (z <= 2.2e+18) tmp = x; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -30500.0) tmp = z * x; elseif (z <= 2.2e+18) tmp = x; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -30500.0], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.2e+18], x, N[(z * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30500:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -30500 or 2.2e18 < z Initial program 100.0%
Taylor expanded in x around inf 59.0%
mul-1-neg59.0%
unsub-neg59.0%
distribute-lft-out--59.0%
*-rgt-identity59.0%
Simplified59.0%
Taylor expanded in z around inf 43.5%
if -30500 < z < 2.2e18Initial program 100.0%
Taylor expanded in t around inf 74.8%
Taylor expanded in x around inf 33.1%
Final simplification38.0%
(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 61.7%
Taylor expanded in x around inf 18.8%
Final simplification18.8%
(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 2023271
(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))))