
(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 (- t x))) (t_2 (* z (- x t))) (t_3 (* (- y z) t)))
(if (<= y -4.05e+34)
t_1
(if (<= y -1.42e-58)
t_3
(if (<= y -1.05e-106)
(+ x (* z x))
(if (<= y 1.16e-104)
t_2
(if (<= y 5.9e-56)
(- x (* z t))
(if (<= y 1.95e-26)
t_2
(if (<= y 4.2e-6)
(+ x (* y t))
(if (<= y 4.7e+71) t_2 (if (<= y 1.25e+106) t_3 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 t_3 = (y - z) * t;
double tmp;
if (y <= -4.05e+34) {
tmp = t_1;
} else if (y <= -1.42e-58) {
tmp = t_3;
} else if (y <= -1.05e-106) {
tmp = x + (z * x);
} else if (y <= 1.16e-104) {
tmp = t_2;
} else if (y <= 5.9e-56) {
tmp = x - (z * t);
} else if (y <= 1.95e-26) {
tmp = t_2;
} else if (y <= 4.2e-6) {
tmp = x + (y * t);
} else if (y <= 4.7e+71) {
tmp = t_2;
} else if (y <= 1.25e+106) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = y * (t - x)
t_2 = z * (x - t)
t_3 = (y - z) * t
if (y <= (-4.05d+34)) then
tmp = t_1
else if (y <= (-1.42d-58)) then
tmp = t_3
else if (y <= (-1.05d-106)) then
tmp = x + (z * x)
else if (y <= 1.16d-104) then
tmp = t_2
else if (y <= 5.9d-56) then
tmp = x - (z * t)
else if (y <= 1.95d-26) then
tmp = t_2
else if (y <= 4.2d-6) then
tmp = x + (y * t)
else if (y <= 4.7d+71) then
tmp = t_2
else if (y <= 1.25d+106) then
tmp = t_3
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 t_3 = (y - z) * t;
double tmp;
if (y <= -4.05e+34) {
tmp = t_1;
} else if (y <= -1.42e-58) {
tmp = t_3;
} else if (y <= -1.05e-106) {
tmp = x + (z * x);
} else if (y <= 1.16e-104) {
tmp = t_2;
} else if (y <= 5.9e-56) {
tmp = x - (z * t);
} else if (y <= 1.95e-26) {
tmp = t_2;
} else if (y <= 4.2e-6) {
tmp = x + (y * t);
} else if (y <= 4.7e+71) {
tmp = t_2;
} else if (y <= 1.25e+106) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = z * (x - t) t_3 = (y - z) * t tmp = 0 if y <= -4.05e+34: tmp = t_1 elif y <= -1.42e-58: tmp = t_3 elif y <= -1.05e-106: tmp = x + (z * x) elif y <= 1.16e-104: tmp = t_2 elif y <= 5.9e-56: tmp = x - (z * t) elif y <= 1.95e-26: tmp = t_2 elif y <= 4.2e-6: tmp = x + (y * t) elif y <= 4.7e+71: tmp = t_2 elif y <= 1.25e+106: tmp = t_3 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)) t_3 = Float64(Float64(y - z) * t) tmp = 0.0 if (y <= -4.05e+34) tmp = t_1; elseif (y <= -1.42e-58) tmp = t_3; elseif (y <= -1.05e-106) tmp = Float64(x + Float64(z * x)); elseif (y <= 1.16e-104) tmp = t_2; elseif (y <= 5.9e-56) tmp = Float64(x - Float64(z * t)); elseif (y <= 1.95e-26) tmp = t_2; elseif (y <= 4.2e-6) tmp = Float64(x + Float64(y * t)); elseif (y <= 4.7e+71) tmp = t_2; elseif (y <= 1.25e+106) tmp = t_3; 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); t_3 = (y - z) * t; tmp = 0.0; if (y <= -4.05e+34) tmp = t_1; elseif (y <= -1.42e-58) tmp = t_3; elseif (y <= -1.05e-106) tmp = x + (z * x); elseif (y <= 1.16e-104) tmp = t_2; elseif (y <= 5.9e-56) tmp = x - (z * t); elseif (y <= 1.95e-26) tmp = t_2; elseif (y <= 4.2e-6) tmp = x + (y * t); elseif (y <= 4.7e+71) tmp = t_2; elseif (y <= 1.25e+106) tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -4.05e+34], t$95$1, If[LessEqual[y, -1.42e-58], t$95$3, If[LessEqual[y, -1.05e-106], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.16e-104], t$95$2, If[LessEqual[y, 5.9e-56], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e-26], t$95$2, If[LessEqual[y, 4.2e-6], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+71], t$95$2, If[LessEqual[y, 1.25e+106], t$95$3, 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)\\
t_3 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -4.05 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.42 \cdot 10^{-58}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-106}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-104}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{-56}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-26}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-6}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+106}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.05e34 or 1.25e106 < y Initial program 100.0%
flip--89.5%
associate-*r/85.3%
cancel-sign-sub-inv85.3%
fma-def87.1%
Applied egg-rr87.1%
associate-/l*91.2%
distribute-lft-neg-out91.2%
Simplified91.2%
Taylor expanded in t around inf 95.4%
Taylor expanded in y around inf 85.7%
if -4.05e34 < y < -1.4199999999999999e-58 or 4.6999999999999996e71 < y < 1.25e106Initial program 99.9%
flip--73.5%
associate-*r/69.6%
cancel-sign-sub-inv69.6%
fma-def69.6%
Applied egg-rr69.6%
associate-/l*73.4%
distribute-lft-neg-out73.4%
Simplified73.4%
Taylor expanded in t around inf 91.9%
Taylor expanded in t around inf 69.0%
*-commutative69.0%
Simplified69.0%
if -1.4199999999999999e-58 < y < -1.05000000000000002e-106Initial program 100.0%
Taylor expanded in x around inf 83.9%
*-commutative83.9%
mul-1-neg83.9%
unsub-neg83.9%
distribute-lft-out--83.9%
*-rgt-identity83.9%
Simplified83.9%
Taylor expanded in y around 0 83.9%
associate-*r*83.9%
neg-mul-183.9%
Simplified83.9%
Taylor expanded in z around 0 83.9%
if -1.05000000000000002e-106 < y < 1.16000000000000001e-104 or 5.8999999999999998e-56 < y < 1.94999999999999993e-26 or 4.1999999999999996e-6 < y < 4.6999999999999996e71Initial program 100.0%
flip--78.5%
associate-*r/75.4%
cancel-sign-sub-inv75.4%
fma-def77.5%
Applied egg-rr77.5%
associate-/l*80.5%
distribute-lft-neg-out80.5%
Simplified80.5%
Taylor expanded in t around inf 97.8%
Taylor expanded in z around inf 78.2%
distribute-lft-out--78.2%
neg-mul-178.2%
*-commutative78.2%
sub-neg78.2%
distribute-neg-in78.2%
remove-double-neg78.2%
Simplified78.2%
if 1.16000000000000001e-104 < y < 5.8999999999999998e-56Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in y around 0 89.9%
+-commutative89.9%
mul-1-neg89.9%
unsub-neg89.9%
*-commutative89.9%
Simplified89.9%
if 1.94999999999999993e-26 < y < 4.1999999999999996e-6Initial program 99.8%
Taylor expanded in t around inf 81.1%
Taylor expanded in z around 0 81.1%
Final simplification81.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -2.4e-30)
(* y t)
(if (<= y -2.7e-74)
t_1
(if (<= y -1.4e-86)
(* z x)
(if (<= y -3.25e-105)
x
(if (<= y 8e-250)
t_1
(if (<= y 2.05e-103)
(* z x)
(if (<= y 8.4e+105)
t_1
(if (or (<= y 1.1e+167) (not (<= y 2.9e+259)))
(* y (- x))
(* y t)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -2.4e-30) {
tmp = y * t;
} else if (y <= -2.7e-74) {
tmp = t_1;
} else if (y <= -1.4e-86) {
tmp = z * x;
} else if (y <= -3.25e-105) {
tmp = x;
} else if (y <= 8e-250) {
tmp = t_1;
} else if (y <= 2.05e-103) {
tmp = z * x;
} else if (y <= 8.4e+105) {
tmp = t_1;
} else if ((y <= 1.1e+167) || !(y <= 2.9e+259)) {
tmp = y * -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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-2.4d-30)) then
tmp = y * t
else if (y <= (-2.7d-74)) then
tmp = t_1
else if (y <= (-1.4d-86)) then
tmp = z * x
else if (y <= (-3.25d-105)) then
tmp = x
else if (y <= 8d-250) then
tmp = t_1
else if (y <= 2.05d-103) then
tmp = z * x
else if (y <= 8.4d+105) then
tmp = t_1
else if ((y <= 1.1d+167) .or. (.not. (y <= 2.9d+259))) then
tmp = y * -x
else
tmp = y * t
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 (y <= -2.4e-30) {
tmp = y * t;
} else if (y <= -2.7e-74) {
tmp = t_1;
} else if (y <= -1.4e-86) {
tmp = z * x;
} else if (y <= -3.25e-105) {
tmp = x;
} else if (y <= 8e-250) {
tmp = t_1;
} else if (y <= 2.05e-103) {
tmp = z * x;
} else if (y <= 8.4e+105) {
tmp = t_1;
} else if ((y <= 1.1e+167) || !(y <= 2.9e+259)) {
tmp = y * -x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -2.4e-30: tmp = y * t elif y <= -2.7e-74: tmp = t_1 elif y <= -1.4e-86: tmp = z * x elif y <= -3.25e-105: tmp = x elif y <= 8e-250: tmp = t_1 elif y <= 2.05e-103: tmp = z * x elif y <= 8.4e+105: tmp = t_1 elif (y <= 1.1e+167) or not (y <= 2.9e+259): tmp = y * -x else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -2.4e-30) tmp = Float64(y * t); elseif (y <= -2.7e-74) tmp = t_1; elseif (y <= -1.4e-86) tmp = Float64(z * x); elseif (y <= -3.25e-105) tmp = x; elseif (y <= 8e-250) tmp = t_1; elseif (y <= 2.05e-103) tmp = Float64(z * x); elseif (y <= 8.4e+105) tmp = t_1; elseif ((y <= 1.1e+167) || !(y <= 2.9e+259)) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -2.4e-30) tmp = y * t; elseif (y <= -2.7e-74) tmp = t_1; elseif (y <= -1.4e-86) tmp = z * x; elseif (y <= -3.25e-105) tmp = x; elseif (y <= 8e-250) tmp = t_1; elseif (y <= 2.05e-103) tmp = z * x; elseif (y <= 8.4e+105) tmp = t_1; elseif ((y <= 1.1e+167) || ~((y <= 2.9e+259))) tmp = y * -x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -2.4e-30], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.7e-74], t$95$1, If[LessEqual[y, -1.4e-86], N[(z * x), $MachinePrecision], If[LessEqual[y, -3.25e-105], x, If[LessEqual[y, 8e-250], t$95$1, If[LessEqual[y, 2.05e-103], N[(z * x), $MachinePrecision], If[LessEqual[y, 8.4e+105], t$95$1, If[Or[LessEqual[y, 1.1e+167], N[Not[LessEqual[y, 2.9e+259]], $MachinePrecision]], N[(y * (-x)), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{-30}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-74}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-86}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq -3.25 \cdot 10^{-105}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-250}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-103}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+167} \lor \neg \left(y \leq 2.9 \cdot 10^{+259}\right):\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -2.39999999999999985e-30 or 1.10000000000000002e167 < y < 2.8999999999999999e259Initial program 100.0%
Taylor expanded in t around inf 65.8%
Taylor expanded in y around 0 60.5%
Taylor expanded in y around inf 56.8%
if -2.39999999999999985e-30 < y < -2.70000000000000018e-74 or -3.25000000000000003e-105 < y < 8.0000000000000004e-250 or 2.04999999999999998e-103 < y < 8.4000000000000004e105Initial program 100.0%
Taylor expanded in t around inf 74.6%
Taylor expanded in y around 0 73.6%
Taylor expanded in z around inf 46.6%
associate-*r*46.6%
neg-mul-146.6%
Simplified46.6%
if -2.70000000000000018e-74 < y < -1.40000000000000005e-86 or 8.0000000000000004e-250 < y < 2.04999999999999998e-103Initial program 100.0%
Taylor expanded in x around inf 72.9%
*-commutative72.9%
mul-1-neg72.9%
unsub-neg72.9%
distribute-lft-out--72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in y around 0 72.9%
associate-*r*72.9%
neg-mul-172.9%
Simplified72.9%
Taylor expanded in z around inf 54.1%
if -1.40000000000000005e-86 < y < -3.25000000000000003e-105Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in x around inf 100.0%
if 8.4000000000000004e105 < y < 1.10000000000000002e167 or 2.8999999999999999e259 < y Initial program 100.0%
Taylor expanded in x around inf 81.9%
*-commutative81.9%
mul-1-neg81.9%
unsub-neg81.9%
distribute-lft-out--81.9%
*-rgt-identity81.9%
Simplified81.9%
Taylor expanded in y around inf 77.5%
Taylor expanded in y around inf 77.5%
associate-*r*77.5%
neg-mul-177.5%
Simplified77.5%
Final simplification55.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)) (t_2 (+ x (* y (- t x)))) (t_3 (* z (- x t))))
(if (<= z -3e+98)
t_3
(if (<= z -8.6e-187)
(+ x t_1)
(if (<= z 6.5e-84)
t_2
(if (<= z 1.45e-58)
t_1
(if (or (<= z 4.5e+31) (and (not (<= z 9.6e+124)) (<= z 6.2e+162)))
t_2
t_3)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = x + (y * (t - x));
double t_3 = z * (x - t);
double tmp;
if (z <= -3e+98) {
tmp = t_3;
} else if (z <= -8.6e-187) {
tmp = x + t_1;
} else if (z <= 6.5e-84) {
tmp = t_2;
} else if (z <= 1.45e-58) {
tmp = t_1;
} else if ((z <= 4.5e+31) || (!(z <= 9.6e+124) && (z <= 6.2e+162))) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (y - z) * t
t_2 = x + (y * (t - x))
t_3 = z * (x - t)
if (z <= (-3d+98)) then
tmp = t_3
else if (z <= (-8.6d-187)) then
tmp = x + t_1
else if (z <= 6.5d-84) then
tmp = t_2
else if (z <= 1.45d-58) then
tmp = t_1
else if ((z <= 4.5d+31) .or. (.not. (z <= 9.6d+124)) .and. (z <= 6.2d+162)) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double t_2 = x + (y * (t - x));
double t_3 = z * (x - t);
double tmp;
if (z <= -3e+98) {
tmp = t_3;
} else if (z <= -8.6e-187) {
tmp = x + t_1;
} else if (z <= 6.5e-84) {
tmp = t_2;
} else if (z <= 1.45e-58) {
tmp = t_1;
} else if ((z <= 4.5e+31) || (!(z <= 9.6e+124) && (z <= 6.2e+162))) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t t_2 = x + (y * (t - x)) t_3 = z * (x - t) tmp = 0 if z <= -3e+98: tmp = t_3 elif z <= -8.6e-187: tmp = x + t_1 elif z <= 6.5e-84: tmp = t_2 elif z <= 1.45e-58: tmp = t_1 elif (z <= 4.5e+31) or (not (z <= 9.6e+124) and (z <= 6.2e+162)): tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y - z) * t) t_2 = Float64(x + Float64(y * Float64(t - x))) t_3 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -3e+98) tmp = t_3; elseif (z <= -8.6e-187) tmp = Float64(x + t_1); elseif (z <= 6.5e-84) tmp = t_2; elseif (z <= 1.45e-58) tmp = t_1; elseif ((z <= 4.5e+31) || (!(z <= 9.6e+124) && (z <= 6.2e+162))) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y - z) * t; t_2 = x + (y * (t - x)); t_3 = z * (x - t); tmp = 0.0; if (z <= -3e+98) tmp = t_3; elseif (z <= -8.6e-187) tmp = x + t_1; elseif (z <= 6.5e-84) tmp = t_2; elseif (z <= 1.45e-58) tmp = t_1; elseif ((z <= 4.5e+31) || (~((z <= 9.6e+124)) && (z <= 6.2e+162))) tmp = t_2; else tmp = t_3; 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[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+98], t$95$3, If[LessEqual[z, -8.6e-187], N[(x + t$95$1), $MachinePrecision], If[LessEqual[z, 6.5e-84], t$95$2, If[LessEqual[z, 1.45e-58], t$95$1, If[Or[LessEqual[z, 4.5e+31], And[N[Not[LessEqual[z, 9.6e+124]], $MachinePrecision], LessEqual[z, 6.2e+162]]], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
t_2 := x + y \cdot \left(t - x\right)\\
t_3 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -3 \cdot 10^{+98}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-187}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+31} \lor \neg \left(z \leq 9.6 \cdot 10^{+124}\right) \land z \leq 6.2 \cdot 10^{+162}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -3.0000000000000001e98 or 4.4999999999999996e31 < z < 9.60000000000000026e124 or 6.1999999999999999e162 < z Initial program 100.0%
flip--87.9%
associate-*r/84.2%
cancel-sign-sub-inv84.2%
fma-def87.1%
Applied egg-rr87.1%
associate-/l*90.7%
distribute-lft-neg-out90.7%
Simplified90.7%
Taylor expanded in t around inf 95.1%
Taylor expanded in z around inf 86.5%
distribute-lft-out--86.5%
neg-mul-186.5%
*-commutative86.5%
sub-neg86.5%
distribute-neg-in86.5%
remove-double-neg86.5%
Simplified86.5%
if -3.0000000000000001e98 < z < -8.60000000000000001e-187Initial program 100.0%
Taylor expanded in t around inf 78.9%
if -8.60000000000000001e-187 < z < 6.50000000000000022e-84 or 1.44999999999999995e-58 < z < 4.4999999999999996e31 or 9.60000000000000026e124 < z < 6.1999999999999999e162Initial program 100.0%
Taylor expanded in z around 0 90.9%
if 6.50000000000000022e-84 < z < 1.44999999999999995e-58Initial program 100.0%
flip--53.1%
associate-*r/53.1%
cancel-sign-sub-inv53.1%
fma-def53.1%
Applied egg-rr53.1%
associate-/l*53.1%
distribute-lft-neg-out53.1%
Simplified53.1%
Taylor expanded in t around inf 100.0%
Taylor expanded in t around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification86.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))))
(if (<= y -1.65e-30)
(* y t)
(if (<= y -3.3e-73)
t_1
(if (<= y -4.8e-87)
(* z x)
(if (<= y -1.25e-104)
x
(if (<= y 6e-250)
t_1
(if (<= y 6.2e-105)
(* z x)
(if (<= y 5.2e+166) t_1 (* y t))))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double tmp;
if (y <= -1.65e-30) {
tmp = y * t;
} else if (y <= -3.3e-73) {
tmp = t_1;
} else if (y <= -4.8e-87) {
tmp = z * x;
} else if (y <= -1.25e-104) {
tmp = x;
} else if (y <= 6e-250) {
tmp = t_1;
} else if (y <= 6.2e-105) {
tmp = z * x;
} else if (y <= 5.2e+166) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * -t
if (y <= (-1.65d-30)) then
tmp = y * t
else if (y <= (-3.3d-73)) then
tmp = t_1
else if (y <= (-4.8d-87)) then
tmp = z * x
else if (y <= (-1.25d-104)) then
tmp = x
else if (y <= 6d-250) then
tmp = t_1
else if (y <= 6.2d-105) then
tmp = z * x
else if (y <= 5.2d+166) then
tmp = t_1
else
tmp = y * t
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 (y <= -1.65e-30) {
tmp = y * t;
} else if (y <= -3.3e-73) {
tmp = t_1;
} else if (y <= -4.8e-87) {
tmp = z * x;
} else if (y <= -1.25e-104) {
tmp = x;
} else if (y <= 6e-250) {
tmp = t_1;
} else if (y <= 6.2e-105) {
tmp = z * x;
} else if (y <= 5.2e+166) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t tmp = 0 if y <= -1.65e-30: tmp = y * t elif y <= -3.3e-73: tmp = t_1 elif y <= -4.8e-87: tmp = z * x elif y <= -1.25e-104: tmp = x elif y <= 6e-250: tmp = t_1 elif y <= 6.2e-105: tmp = z * x elif y <= 5.2e+166: tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -1.65e-30) tmp = Float64(y * t); elseif (y <= -3.3e-73) tmp = t_1; elseif (y <= -4.8e-87) tmp = Float64(z * x); elseif (y <= -1.25e-104) tmp = x; elseif (y <= 6e-250) tmp = t_1; elseif (y <= 6.2e-105) tmp = Float64(z * x); elseif (y <= 5.2e+166) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; tmp = 0.0; if (y <= -1.65e-30) tmp = y * t; elseif (y <= -3.3e-73) tmp = t_1; elseif (y <= -4.8e-87) tmp = z * x; elseif (y <= -1.25e-104) tmp = x; elseif (y <= 6e-250) tmp = t_1; elseif (y <= 6.2e-105) tmp = z * x; elseif (y <= 5.2e+166) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -1.65e-30], N[(y * t), $MachinePrecision], If[LessEqual[y, -3.3e-73], t$95$1, If[LessEqual[y, -4.8e-87], N[(z * x), $MachinePrecision], If[LessEqual[y, -1.25e-104], x, If[LessEqual[y, 6e-250], t$95$1, If[LessEqual[y, 6.2e-105], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.2e+166], t$95$1, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{-30}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-87}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-104}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-250}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-105}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+166}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.6500000000000001e-30 or 5.1999999999999999e166 < y Initial program 100.0%
Taylor expanded in t around inf 62.6%
Taylor expanded in y around 0 57.8%
Taylor expanded in y around inf 54.5%
if -1.6500000000000001e-30 < y < -3.30000000000000004e-73 or -1.24999999999999995e-104 < y < 6.00000000000000032e-250 or 6.20000000000000029e-105 < y < 5.1999999999999999e166Initial program 100.0%
Taylor expanded in t around inf 68.3%
Taylor expanded in y around 0 67.4%
Taylor expanded in z around inf 43.4%
associate-*r*43.4%
neg-mul-143.4%
Simplified43.4%
if -3.30000000000000004e-73 < y < -4.7999999999999999e-87 or 6.00000000000000032e-250 < y < 6.20000000000000029e-105Initial program 100.0%
Taylor expanded in x around inf 72.9%
*-commutative72.9%
mul-1-neg72.9%
unsub-neg72.9%
distribute-lft-out--72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in y around 0 72.9%
associate-*r*72.9%
neg-mul-172.9%
Simplified72.9%
Taylor expanded in z around inf 54.1%
if -4.7999999999999999e-87 < y < -1.24999999999999995e-104Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in x around inf 100.0%
Final simplification50.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* (- y z) t))))
(if (<= y -1.12e+36)
t_1
(if (<= y -1.1e-241)
t_2
(if (<= y 4e-107) (* z (- x t)) (if (<= y 8.4e+105) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -1.12e+36) {
tmp = t_1;
} else if (y <= -1.1e-241) {
tmp = t_2;
} else if (y <= 4e-107) {
tmp = z * (x - t);
} else if (y <= 8.4e+105) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x + ((y - z) * t)
if (y <= (-1.12d+36)) then
tmp = t_1
else if (y <= (-1.1d-241)) then
tmp = t_2
else if (y <= 4d-107) then
tmp = z * (x - t)
else if (y <= 8.4d+105) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -1.12e+36) {
tmp = t_1;
} else if (y <= -1.1e-241) {
tmp = t_2;
} else if (y <= 4e-107) {
tmp = z * (x - t);
} else if (y <= 8.4e+105) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + ((y - z) * t) tmp = 0 if y <= -1.12e+36: tmp = t_1 elif y <= -1.1e-241: tmp = t_2 elif y <= 4e-107: tmp = z * (x - t) elif y <= 8.4e+105: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (y <= -1.12e+36) tmp = t_1; elseif (y <= -1.1e-241) tmp = t_2; elseif (y <= 4e-107) tmp = Float64(z * Float64(x - t)); elseif (y <= 8.4e+105) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x + ((y - z) * t); tmp = 0.0; if (y <= -1.12e+36) tmp = t_1; elseif (y <= -1.1e-241) tmp = t_2; elseif (y <= 4e-107) tmp = z * (x - t); elseif (y <= 8.4e+105) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.12e+36], t$95$1, If[LessEqual[y, -1.1e-241], t$95$2, If[LessEqual[y, 4e-107], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.4e+105], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -1.12 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-241}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-107}:\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.11999999999999999e36 or 8.4000000000000004e105 < y Initial program 100.0%
flip--89.5%
associate-*r/85.3%
cancel-sign-sub-inv85.3%
fma-def87.1%
Applied egg-rr87.1%
associate-/l*91.2%
distribute-lft-neg-out91.2%
Simplified91.2%
Taylor expanded in t around inf 95.4%
Taylor expanded in y around inf 85.7%
if -1.11999999999999999e36 < y < -1.1e-241 or 4e-107 < y < 8.4000000000000004e105Initial program 99.9%
Taylor expanded in t around inf 74.4%
if -1.1e-241 < y < 4e-107Initial program 100.0%
flip--80.1%
associate-*r/78.4%
cancel-sign-sub-inv78.4%
fma-def81.8%
Applied egg-rr81.8%
associate-/l*83.5%
distribute-lft-neg-out83.5%
Simplified83.5%
Taylor expanded in t around inf 98.3%
Taylor expanded in z around inf 79.7%
distribute-lft-out--79.7%
neg-mul-179.7%
*-commutative79.7%
sub-neg79.7%
distribute-neg-in79.7%
remove-double-neg79.7%
Simplified79.7%
Final simplification80.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -3.2e-31)
t_1
(if (<= y 7.5e-250)
(* z (- t))
(if (<= y 6e-101) (* z x) (if (<= y 5.2e-15) x t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -3.2e-31) {
tmp = t_1;
} else if (y <= 7.5e-250) {
tmp = z * -t;
} else if (y <= 6e-101) {
tmp = z * x;
} else if (y <= 5.2e-15) {
tmp = 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 * (t - x)
if (y <= (-3.2d-31)) then
tmp = t_1
else if (y <= 7.5d-250) then
tmp = z * -t
else if (y <= 6d-101) then
tmp = z * x
else if (y <= 5.2d-15) then
tmp = 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 * (t - x);
double tmp;
if (y <= -3.2e-31) {
tmp = t_1;
} else if (y <= 7.5e-250) {
tmp = z * -t;
} else if (y <= 6e-101) {
tmp = z * x;
} else if (y <= 5.2e-15) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -3.2e-31: tmp = t_1 elif y <= 7.5e-250: tmp = z * -t elif y <= 6e-101: tmp = z * x elif y <= 5.2e-15: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -3.2e-31) tmp = t_1; elseif (y <= 7.5e-250) tmp = Float64(z * Float64(-t)); elseif (y <= 6e-101) tmp = Float64(z * x); elseif (y <= 5.2e-15) tmp = x; 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 <= -3.2e-31) tmp = t_1; elseif (y <= 7.5e-250) tmp = z * -t; elseif (y <= 6e-101) tmp = z * x; elseif (y <= 5.2e-15) tmp = x; 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, -3.2e-31], t$95$1, If[LessEqual[y, 7.5e-250], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 6e-101], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.2e-15], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{-31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-250}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-101}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.20000000000000018e-31 or 5.20000000000000009e-15 < y Initial program 99.9%
flip--84.8%
associate-*r/81.0%
cancel-sign-sub-inv81.0%
fma-def82.3%
Applied egg-rr82.3%
associate-/l*86.1%
distribute-lft-neg-out86.1%
Simplified86.1%
Taylor expanded in t around inf 95.1%
Taylor expanded in y around inf 75.0%
if -3.20000000000000018e-31 < y < 7.50000000000000009e-250Initial program 100.0%
Taylor expanded in t around inf 78.5%
Taylor expanded in y around 0 78.5%
Taylor expanded in z around inf 47.8%
associate-*r*47.8%
neg-mul-147.8%
Simplified47.8%
if 7.50000000000000009e-250 < y < 6.0000000000000006e-101Initial program 100.0%
Taylor expanded in x around inf 71.3%
*-commutative71.3%
mul-1-neg71.3%
unsub-neg71.3%
distribute-lft-out--71.3%
*-rgt-identity71.3%
Simplified71.3%
Taylor expanded in y around 0 71.3%
associate-*r*71.3%
neg-mul-171.3%
Simplified71.3%
Taylor expanded in z around inf 51.4%
if 6.0000000000000006e-101 < y < 5.20000000000000009e-15Initial program 100.0%
Taylor expanded in t around inf 86.3%
Taylor expanded in x around inf 51.4%
Final simplification63.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -1.4e-171)
t_1
(if (<= t 1.1e-212) (* z x) (if (<= t 1.46e+41) (* y (- t x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -1.4e-171) {
tmp = t_1;
} else if (t <= 1.1e-212) {
tmp = z * x;
} else if (t <= 1.46e+41) {
tmp = y * (t - 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 <= (-1.4d-171)) then
tmp = t_1
else if (t <= 1.1d-212) then
tmp = z * x
else if (t <= 1.46d+41) then
tmp = y * (t - 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 <= -1.4e-171) {
tmp = t_1;
} else if (t <= 1.1e-212) {
tmp = z * x;
} else if (t <= 1.46e+41) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -1.4e-171: tmp = t_1 elif t <= 1.1e-212: tmp = z * x elif t <= 1.46e+41: tmp = y * (t - 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 <= -1.4e-171) tmp = t_1; elseif (t <= 1.1e-212) tmp = Float64(z * x); elseif (t <= 1.46e+41) tmp = Float64(y * Float64(t - 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 <= -1.4e-171) tmp = t_1; elseif (t <= 1.1e-212) tmp = z * x; elseif (t <= 1.46e+41) tmp = y * (t - 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, -1.4e-171], t$95$1, If[LessEqual[t, 1.1e-212], N[(z * x), $MachinePrecision], If[LessEqual[t, 1.46e+41], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{-212}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;t \leq 1.46 \cdot 10^{+41}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.40000000000000011e-171 or 1.4600000000000001e41 < t Initial program 100.0%
flip--77.8%
associate-*r/75.2%
cancel-sign-sub-inv75.2%
fma-def77.9%
Applied egg-rr77.9%
associate-/l*80.3%
distribute-lft-neg-out80.3%
Simplified80.3%
Taylor expanded in t around inf 94.0%
Taylor expanded in t around inf 76.6%
*-commutative76.6%
Simplified76.6%
if -1.40000000000000011e-171 < t < 1.10000000000000002e-212Initial program 100.0%
Taylor expanded in x around inf 92.6%
*-commutative92.6%
mul-1-neg92.6%
unsub-neg92.6%
distribute-lft-out--92.6%
*-rgt-identity92.6%
Simplified92.6%
Taylor expanded in y around 0 73.0%
associate-*r*73.0%
neg-mul-173.0%
Simplified73.0%
Taylor expanded in z around inf 51.5%
if 1.10000000000000002e-212 < t < 1.4600000000000001e41Initial program 99.9%
flip--89.6%
associate-*r/86.3%
cancel-sign-sub-inv86.3%
fma-def86.3%
Applied egg-rr86.3%
associate-/l*89.6%
distribute-lft-neg-out89.6%
Simplified89.6%
Taylor expanded in t around inf 99.9%
Taylor expanded in y around inf 56.3%
Final simplification67.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- y z) t)))
(if (<= t -1.3e-24)
t_1
(if (<= t 2.7e-202)
(+ x (* z x))
(if (<= t 2.9e+40) (* y (- t x)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y - z) * t;
double tmp;
if (t <= -1.3e-24) {
tmp = t_1;
} else if (t <= 2.7e-202) {
tmp = x + (z * x);
} else if (t <= 2.9e+40) {
tmp = y * (t - 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 <= (-1.3d-24)) then
tmp = t_1
else if (t <= 2.7d-202) then
tmp = x + (z * x)
else if (t <= 2.9d+40) then
tmp = y * (t - 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 <= -1.3e-24) {
tmp = t_1;
} else if (t <= 2.7e-202) {
tmp = x + (z * x);
} else if (t <= 2.9e+40) {
tmp = y * (t - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y - z) * t tmp = 0 if t <= -1.3e-24: tmp = t_1 elif t <= 2.7e-202: tmp = x + (z * x) elif t <= 2.9e+40: tmp = y * (t - 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 <= -1.3e-24) tmp = t_1; elseif (t <= 2.7e-202) tmp = Float64(x + Float64(z * x)); elseif (t <= 2.9e+40) tmp = Float64(y * Float64(t - 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 <= -1.3e-24) tmp = t_1; elseif (t <= 2.7e-202) tmp = x + (z * x); elseif (t <= 2.9e+40) tmp = y * (t - 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, -1.3e-24], t$95$1, If[LessEqual[t, 2.7e-202], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+40], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-202}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+40}:\\
\;\;\;\;y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.3e-24 or 2.90000000000000017e40 < t Initial program 100.0%
flip--75.6%
associate-*r/72.5%
cancel-sign-sub-inv72.5%
fma-def75.8%
Applied egg-rr75.8%
associate-/l*78.9%
distribute-lft-neg-out78.9%
Simplified78.9%
Taylor expanded in t around inf 92.5%
Taylor expanded in t around inf 84.7%
*-commutative84.7%
Simplified84.7%
if -1.3e-24 < t < 2.6999999999999999e-202Initial program 100.0%
Taylor expanded in x around inf 80.9%
*-commutative80.9%
mul-1-neg80.9%
unsub-neg80.9%
distribute-lft-out--80.9%
*-rgt-identity80.9%
Simplified80.9%
Taylor expanded in y around 0 63.4%
associate-*r*63.4%
neg-mul-163.4%
Simplified63.4%
Taylor expanded in z around 0 63.4%
if 2.6999999999999999e-202 < t < 2.90000000000000017e40Initial program 99.9%
flip--89.6%
associate-*r/86.3%
cancel-sign-sub-inv86.3%
fma-def86.3%
Applied egg-rr86.3%
associate-/l*89.6%
distribute-lft-neg-out89.6%
Simplified89.6%
Taylor expanded in t around inf 99.9%
Taylor expanded in y around inf 56.3%
Final simplification71.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.85e-5) (not (<= x 4.1e-27))) (+ x (* x (- z y))) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.85e-5) || !(x <= 4.1e-27)) {
tmp = x + (x * (z - 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 <= (-1.85d-5)) .or. (.not. (x <= 4.1d-27))) then
tmp = x + (x * (z - 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 <= -1.85e-5) || !(x <= 4.1e-27)) {
tmp = x + (x * (z - y));
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.85e-5) or not (x <= 4.1e-27): tmp = x + (x * (z - y)) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.85e-5) || !(x <= 4.1e-27)) tmp = Float64(x + Float64(x * Float64(z - 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 <= -1.85e-5) || ~((x <= 4.1e-27))) tmp = x + (x * (z - y)); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.85e-5], N[Not[LessEqual[x, 4.1e-27]], $MachinePrecision]], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{-5} \lor \neg \left(x \leq 4.1 \cdot 10^{-27}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.84999999999999991e-5 or 4.0999999999999999e-27 < x Initial program 100.0%
Taylor expanded in x around inf 86.1%
*-commutative86.1%
mul-1-neg86.1%
unsub-neg86.1%
distribute-lft-out--86.1%
*-rgt-identity86.1%
Simplified86.1%
if -1.84999999999999991e-5 < x < 4.0999999999999999e-27Initial program 100.0%
Taylor expanded in t around inf 85.5%
Final simplification85.8%
(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 -1.1e-58) (* y t) (if (<= y 4.4e-20) x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.1e-58) {
tmp = y * t;
} else if (y <= 4.4e-20) {
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 <= (-1.1d-58)) then
tmp = y * t
else if (y <= 4.4d-20) 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 <= -1.1e-58) {
tmp = y * t;
} else if (y <= 4.4e-20) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.1e-58: tmp = y * t elif y <= 4.4e-20: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.1e-58) tmp = Float64(y * t); elseif (y <= 4.4e-20) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.1e-58) tmp = y * t; elseif (y <= 4.4e-20) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.1e-58], N[(y * t), $MachinePrecision], If[LessEqual[y, 4.4e-20], x, N[(y * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-58}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-20}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -1.10000000000000003e-58 or 4.39999999999999982e-20 < y Initial program 99.9%
Taylor expanded in t around inf 59.8%
Taylor expanded in y around 0 55.8%
Taylor expanded in y around inf 42.9%
if -1.10000000000000003e-58 < y < 4.39999999999999982e-20Initial program 100.0%
Taylor expanded in t around inf 72.1%
Taylor expanded in x around inf 29.2%
Final simplification37.3%
(FPCore (x y z t) :precision binary64 (if (<= x -1.02e+99) (* z x) (if (<= x 1.35e-33) (* y t) (* z x))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.02e+99) {
tmp = z * x;
} else if (x <= 1.35e-33) {
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 (x <= (-1.02d+99)) then
tmp = z * x
else if (x <= 1.35d-33) 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 (x <= -1.02e+99) {
tmp = z * x;
} else if (x <= 1.35e-33) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.02e+99: tmp = z * x elif x <= 1.35e-33: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.02e+99) tmp = Float64(z * x); elseif (x <= 1.35e-33) 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 (x <= -1.02e+99) tmp = z * x; elseif (x <= 1.35e-33) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.02e+99], N[(z * x), $MachinePrecision], If[LessEqual[x, 1.35e-33], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+99}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-33}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if x < -1.01999999999999998e99 or 1.35e-33 < x Initial program 100.0%
Taylor expanded in x around inf 90.9%
*-commutative90.9%
mul-1-neg90.9%
unsub-neg90.9%
distribute-lft-out--90.9%
*-rgt-identity90.9%
Simplified90.9%
Taylor expanded in y around 0 64.6%
associate-*r*64.6%
neg-mul-164.6%
Simplified64.6%
Taylor expanded in z around inf 46.2%
if -1.01999999999999998e99 < x < 1.35e-33Initial program 100.0%
Taylor expanded in t around inf 79.6%
Taylor expanded in y around 0 77.1%
Taylor expanded in y around inf 41.0%
Final simplification43.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 64.8%
Taylor expanded in x around inf 13.5%
Final simplification13.5%
(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 2023258
(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))))