
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
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 = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
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 = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ x 1.0)))
(t_5 (+ t_3 (+ (- t_4 (sqrt x)) (- t_1 (sqrt y))))))
(if (<= t_5 0.0)
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ (* 0.5 (sqrt (/ 1.0 y))) t_3))
(if (<= t_5 2.0)
(-
(+ t_4 (+ (* 0.5 (sqrt (/ 1.0 z))) (/ 1.0 (+ t_1 (sqrt y)))))
(sqrt x))
(+
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))
(+
(/ (+ z (- 1.0 z)) (+ t_2 (sqrt z)))
(/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((x + 1.0));
double t_5 = t_3 + ((t_4 - sqrt(x)) + (t_1 - sqrt(y)));
double tmp;
if (t_5 <= 0.0) {
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + t_3);
} else if (t_5 <= 2.0) {
tmp = (t_4 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (t_1 + sqrt(y))))) - sqrt(x);
} else {
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + (((z + (1.0 - z)) / (t_2 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((x + 1.0d0))
t_5 = t_3 + ((t_4 - sqrt(x)) + (t_1 - sqrt(y)))
if (t_5 <= 0.0d0) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((0.5d0 * sqrt((1.0d0 / y))) + t_3)
else if (t_5 <= 2.0d0) then
tmp = (t_4 + ((0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 / (t_1 + sqrt(y))))) - sqrt(x)
else
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))) + (((z + (1.0d0 - z)) / (t_2 + sqrt(z))) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((x + 1.0));
double t_5 = t_3 + ((t_4 - Math.sqrt(x)) + (t_1 - Math.sqrt(y)));
double tmp;
if (t_5 <= 0.0) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((0.5 * Math.sqrt((1.0 / y))) + t_3);
} else if (t_5 <= 2.0) {
tmp = (t_4 + ((0.5 * Math.sqrt((1.0 / z))) + (1.0 / (t_1 + Math.sqrt(y))))) - Math.sqrt(x);
} else {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + (((z + (1.0 - z)) / (t_2 + Math.sqrt(z))) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((x + 1.0)) t_5 = t_3 + ((t_4 - math.sqrt(x)) + (t_1 - math.sqrt(y))) tmp = 0 if t_5 <= 0.0: tmp = (0.5 * math.sqrt((1.0 / x))) + ((0.5 * math.sqrt((1.0 / y))) + t_3) elif t_5 <= 2.0: tmp = (t_4 + ((0.5 * math.sqrt((1.0 / z))) + (1.0 / (t_1 + math.sqrt(y))))) - math.sqrt(x) else: tmp = ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + (((z + (1.0 - z)) / (t_2 + math.sqrt(z))) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(x + 1.0)) t_5 = Float64(t_3 + Float64(Float64(t_4 - sqrt(x)) + Float64(t_1 - sqrt(y)))) tmp = 0.0 if (t_5 <= 0.0) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + t_3)); elseif (t_5 <= 2.0) tmp = Float64(Float64(t_4 + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 / Float64(t_1 + sqrt(y))))) - sqrt(x)); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(t_2 + sqrt(z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((x + 1.0));
t_5 = t_3 + ((t_4 - sqrt(x)) + (t_1 - sqrt(y)));
tmp = 0.0;
if (t_5 <= 0.0)
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + t_3);
elseif (t_5 <= 2.0)
tmp = (t_4 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (t_1 + sqrt(y))))) - sqrt(x);
else
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + (((z + (1.0 - z)) / (t_2 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 + N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 0.0], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2.0], N[(N[(t$95$4 + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
t_3 := t\_2 - \sqrt{z}\\
t_4 := \sqrt{x + 1}\\
t_5 := t\_3 + \left(\left(t\_4 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right)\\
\mathbf{if}\;t\_5 \leq 0:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + t\_3\right)\\
\mathbf{elif}\;t\_5 \leq 2:\\
\;\;\;\;\left(t\_4 + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \frac{1}{t\_1 + \sqrt{y}}\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \left(\frac{z + \left(1 - z\right)}{t\_2 + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 0.0Initial program 36.5%
associate-+l+36.5%
associate-+l+36.5%
+-commutative36.5%
+-commutative36.5%
associate-+l-36.5%
+-commutative36.5%
+-commutative36.5%
Simplified36.5%
Taylor expanded in t around inf 3.3%
Taylor expanded in x around inf 21.0%
Taylor expanded in y around inf 31.5%
if 0.0 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l-76.7%
+-commutative76.7%
+-commutative76.7%
Simplified76.7%
Taylor expanded in t around inf 58.8%
flip--58.8%
div-inv58.8%
add-sqr-sqrt47.0%
add-sqr-sqrt58.8%
associate--l+59.1%
Applied egg-rr59.1%
+-inverses59.1%
metadata-eval59.1%
*-lft-identity59.1%
+-commutative59.1%
Simplified59.1%
Taylor expanded in z around inf 21.1%
if 2 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 95.4%
associate-+l+95.4%
sub-neg95.4%
sub-neg95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
Simplified95.4%
flip--95.3%
add-sqr-sqrt95.5%
+-commutative95.5%
add-sqr-sqrt96.2%
associate--l+96.2%
Applied egg-rr96.2%
Taylor expanded in x around 0 90.9%
Taylor expanded in y around 0 82.7%
flip--82.7%
div-inv82.7%
add-sqr-sqrt68.8%
add-sqr-sqrt83.6%
associate--l+84.6%
Applied egg-rr84.6%
+-inverses84.6%
metadata-eval84.6%
*-lft-identity84.6%
+-commutative84.6%
Simplified84.6%
Final simplification31.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_2 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (+ t_3 (sqrt z))))
(if (<= t_1 0.0)
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ (* 0.5 (sqrt (/ 1.0 y))) (- t_3 (sqrt z))))
(+
t_1
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(/ (+ (* (+ 1.0 (- t t)) t_4) (* t_2 (+ z (- 1.0 z)))) (* t_4 t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double t_2 = sqrt((1.0 + t)) + sqrt(t);
double t_3 = sqrt((1.0 + z));
double t_4 = t_3 + sqrt(z);
double tmp;
if (t_1 <= 0.0) {
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + (t_3 - sqrt(z)));
} else {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_2 * (z + (1.0 - z)))) / (t_4 * t_2)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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) :: t_4
real(8) :: tmp
t_1 = sqrt((x + 1.0d0)) - sqrt(x)
t_2 = sqrt((1.0d0 + t)) + sqrt(t)
t_3 = sqrt((1.0d0 + z))
t_4 = t_3 + sqrt(z)
if (t_1 <= 0.0d0) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((0.5d0 * sqrt((1.0d0 / y))) + (t_3 - sqrt(z)))
else
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) + ((((1.0d0 + (t - t)) * t_4) + (t_2 * (z + (1.0d0 - z)))) / (t_4 * t_2)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + t)) + Math.sqrt(t);
double t_3 = Math.sqrt((1.0 + z));
double t_4 = t_3 + Math.sqrt(z);
double tmp;
if (t_1 <= 0.0) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((0.5 * Math.sqrt((1.0 / y))) + (t_3 - Math.sqrt(z)));
} else {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_2 * (z + (1.0 - z)))) / (t_4 * t_2)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) t_2 = math.sqrt((1.0 + t)) + math.sqrt(t) t_3 = math.sqrt((1.0 + z)) t_4 = t_3 + math.sqrt(z) tmp = 0 if t_1 <= 0.0: tmp = (0.5 * math.sqrt((1.0 / x))) + ((0.5 * math.sqrt((1.0 / y))) + (t_3 - math.sqrt(z))) else: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_2 * (z + (1.0 - z)))) / (t_4 * t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_2 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t)) t_3 = sqrt(Float64(1.0 + z)) t_4 = Float64(t_3 + sqrt(z)) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(t_3 - sqrt(z)))); else tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(Float64(Float64(Float64(1.0 + Float64(t - t)) * t_4) + Float64(t_2 * Float64(z + Float64(1.0 - z)))) / Float64(t_4 * t_2)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0)) - sqrt(x);
t_2 = sqrt((1.0 + t)) + sqrt(t);
t_3 = sqrt((1.0 + z));
t_4 = t_3 + sqrt(z);
tmp = 0.0;
if (t_1 <= 0.0)
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + (t_3 - sqrt(z)));
else
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + ((((1.0 + (t - t)) * t_4) + (t_2 * (z + (1.0 - z)))) / (t_4 * t_2)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(t$95$2 * N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$4 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
t_2 := \sqrt{1 + t} + \sqrt{t}\\
t_3 := \sqrt{1 + z}\\
t_4 := t\_3 + \sqrt{z}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(t\_3 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{\left(1 + \left(t - t\right)\right) \cdot t\_4 + t\_2 \cdot \left(z + \left(1 - z\right)\right)}{t\_4 \cdot t\_2}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 83.1%
associate-+l+83.1%
associate-+l+83.1%
+-commutative83.1%
+-commutative83.1%
associate-+l-64.4%
+-commutative64.4%
+-commutative64.4%
Simplified64.4%
Taylor expanded in t around inf 48.7%
Taylor expanded in x around inf 53.2%
Taylor expanded in y around inf 23.8%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.5%
associate-+l+96.5%
associate-+l+96.5%
+-commutative96.5%
+-commutative96.5%
associate-+l-74.5%
+-commutative74.5%
+-commutative74.5%
Simplified74.5%
associate--r-96.5%
flip--96.5%
flip--96.5%
frac-add96.5%
Applied egg-rr97.8%
Final simplification63.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.0)
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ (* 0.5 (sqrt (/ 1.0 y))) t_1))
(+ (- 1.0 (sqrt x)) (+ t_1 (- (sqrt (+ 1.0 y)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0) {
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + t_1);
} else {
tmp = (1.0 - sqrt(x)) + (t_1 + (sqrt((1.0 + y)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = sqrt((1.0d0 + z)) - sqrt(z)
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.0d0) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((0.5d0 * sqrt((1.0d0 / y))) + t_1)
else
tmp = (1.0d0 - sqrt(x)) + (t_1 + (sqrt((1.0d0 + y)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.0) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((0.5 * Math.sqrt((1.0 / y))) + t_1);
} else {
tmp = (1.0 - Math.sqrt(x)) + (t_1 + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.0: tmp = (0.5 * math.sqrt((1.0 / x))) + ((0.5 * math.sqrt((1.0 / y))) + t_1) else: tmp = (1.0 - math.sqrt(x)) + (t_1 + (math.sqrt((1.0 + y)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.0) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + t_1)); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.0)
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + t_1);
else
tmp = (1.0 - sqrt(x)) + (t_1 + (sqrt((1.0 + y)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(t\_1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 83.1%
associate-+l+83.1%
associate-+l+83.1%
+-commutative83.1%
+-commutative83.1%
associate-+l-64.4%
+-commutative64.4%
+-commutative64.4%
Simplified64.4%
Taylor expanded in t around inf 48.7%
Taylor expanded in x around inf 53.2%
Taylor expanded in y around inf 23.8%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.5%
associate-+l+96.5%
associate-+l+96.5%
+-commutative96.5%
+-commutative96.5%
associate-+l-74.5%
+-commutative74.5%
+-commutative74.5%
Simplified74.5%
Taylor expanded in t around inf 56.8%
Taylor expanded in x around 0 53.5%
Final simplification39.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 6.2e-22)
(+
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))
(+
(/ (+ z (- 1.0 z)) (+ (sqrt (+ 1.0 z)) (sqrt z)))
(- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 1.1e+31)
(-
(+
t_1
(+ (* 0.5 (sqrt (/ 1.0 z))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(sqrt x))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 6.2e-22) {
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + (((z + (1.0 - z)) / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
} else if (y <= 1.1e+31) {
tmp = (t_1 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = sqrt((x + 1.0d0))
if (y <= 6.2d-22) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))) + (((z + (1.0d0 - z)) / (sqrt((1.0d0 + z)) + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t)))
else if (y <= 1.1d+31) then
tmp = (t_1 + ((0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 6.2e-22) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + (((z + (1.0 - z)) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else if (y <= 1.1e+31) {
tmp = (t_1 + ((0.5 * Math.sqrt((1.0 / z))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 6.2e-22: tmp = ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + (((z + (1.0 - z)) / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) elif y <= 1.1e+31: tmp = (t_1 + ((0.5 * math.sqrt((1.0 / z))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 6.2e-22) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); elseif (y <= 1.1e+31) tmp = Float64(Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 6.2e-22)
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + (((z + (1.0 - z)) / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
elseif (y <= 1.1e+31)
tmp = (t_1 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.2e-22], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+31], N[(N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 6.2 \cdot 10^{-22}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \left(\frac{z + \left(1 - z\right)}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+31}:\\
\;\;\;\;\left(t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 6.20000000000000025e-22Initial program 97.3%
associate-+l+97.3%
sub-neg97.3%
sub-neg97.3%
+-commutative97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
flip--97.2%
add-sqr-sqrt78.2%
+-commutative78.2%
add-sqr-sqrt97.8%
associate--l+97.8%
Applied egg-rr97.8%
Taylor expanded in x around 0 46.7%
Taylor expanded in y around 0 46.7%
if 6.20000000000000025e-22 < y < 1.10000000000000005e31Initial program 82.1%
associate-+l+82.1%
associate-+l+82.1%
+-commutative82.1%
+-commutative82.1%
associate-+l-62.0%
+-commutative62.0%
+-commutative62.0%
Simplified62.0%
Taylor expanded in t around inf 54.9%
flip--55.7%
div-inv55.7%
add-sqr-sqrt51.9%
add-sqr-sqrt55.7%
associate--l+66.9%
Applied egg-rr66.9%
+-inverses66.9%
metadata-eval66.9%
*-lft-identity66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in z around inf 15.1%
if 1.10000000000000005e31 < y Initial program 84.0%
associate-+l+84.0%
associate-+l+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+l-61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in t around inf 45.9%
Taylor expanded in y around inf 25.1%
associate--l+35.9%
+-commutative35.9%
associate--r+36.5%
Simplified36.5%
Taylor expanded in z around inf 20.3%
flip--20.3%
add-sqr-sqrt20.2%
add-sqr-sqrt20.3%
Applied egg-rr20.3%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification34.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 6.2e-133)
(+
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ 1.0 (sqrt z)))))
(if (<= y 8.2e+30)
(+
(- t_1 (sqrt x))
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 6.2e-133) {
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
} else if (y <= 8.2e+30) {
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = sqrt((x + 1.0d0))
if (y <= 6.2d-133) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (1.0d0 + sqrt(z))))
else if (y <= 8.2d+30) then
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 6.2e-133) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (1.0 + Math.sqrt(z))));
} else if (y <= 8.2e+30) {
tmp = (t_1 - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 6.2e-133: tmp = ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (1.0 + math.sqrt(z)))) elif y <= 8.2e+30: tmp = (t_1 - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 6.2e-133) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(1.0 + sqrt(z))))); elseif (y <= 8.2e+30) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 6.2e-133)
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
elseif (y <= 8.2e+30)
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.2e-133], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+30], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 6.2 \cdot 10^{-133}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 6.20000000000000032e-133Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
flip--96.6%
add-sqr-sqrt76.4%
+-commutative76.4%
add-sqr-sqrt97.2%
associate--l+97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 44.7%
Taylor expanded in y around 0 44.7%
Taylor expanded in z around 0 40.4%
sub-neg40.4%
+-commutative40.4%
associate-+l+44.3%
sub-neg44.3%
Simplified44.3%
if 6.20000000000000032e-133 < y < 8.20000000000000011e30Initial program 93.3%
associate-+l+93.3%
associate-+l+93.3%
+-commutative93.3%
+-commutative93.3%
associate-+l-70.9%
+-commutative70.9%
+-commutative70.9%
Simplified70.9%
associate--r-93.3%
flip--93.4%
flip--93.3%
frac-add93.3%
Applied egg-rr94.2%
Taylor expanded in t around inf 60.1%
if 8.20000000000000011e30 < y Initial program 84.0%
associate-+l+84.0%
associate-+l+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+l-61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in t around inf 45.9%
Taylor expanded in y around inf 25.1%
associate--l+35.9%
+-commutative35.9%
associate--r+36.5%
Simplified36.5%
Taylor expanded in z around inf 20.3%
flip--20.3%
add-sqr-sqrt20.2%
add-sqr-sqrt20.3%
Applied egg-rr20.3%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification39.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 4.3e-121)
(+
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ 1.0 (sqrt z)))))
(if (<= y 2.2e+31)
(+
(- t_1 (sqrt x))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 4.3e-121) {
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
} else if (y <= 2.2e+31) {
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = sqrt((x + 1.0d0))
if (y <= 4.3d-121) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (1.0d0 + sqrt(z))))
else if (y <= 2.2d+31) then
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 4.3e-121) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (1.0 + Math.sqrt(z))));
} else if (y <= 2.2e+31) {
tmp = (t_1 - Math.sqrt(x)) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 4.3e-121: tmp = ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (1.0 + math.sqrt(z)))) elif y <= 2.2e+31: tmp = (t_1 - math.sqrt(x)) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 4.3e-121) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(1.0 + sqrt(z))))); elseif (y <= 2.2e+31) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 4.3e-121)
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
elseif (y <= 2.2e+31)
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e-121], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+31], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-121}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+31}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.29999999999999965e-121Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--96.7%
add-sqr-sqrt76.7%
+-commutative76.7%
add-sqr-sqrt97.2%
associate--l+97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 46.1%
Taylor expanded in y around 0 46.1%
Taylor expanded in z around 0 42.0%
sub-neg42.0%
+-commutative42.0%
associate-+l+45.7%
sub-neg45.7%
Simplified45.7%
if 4.29999999999999965e-121 < y < 2.2000000000000001e31Initial program 92.9%
associate-+l+92.9%
associate-+l+92.9%
+-commutative92.9%
+-commutative92.9%
associate-+l-68.9%
+-commutative68.9%
+-commutative68.9%
Simplified68.9%
Taylor expanded in t around inf 59.5%
flip--59.8%
div-inv59.8%
add-sqr-sqrt58.5%
add-sqr-sqrt59.8%
associate--l+63.5%
Applied egg-rr63.5%
+-inverses63.5%
metadata-eval63.5%
*-lft-identity63.5%
+-commutative63.5%
Simplified63.5%
if 2.2000000000000001e31 < y Initial program 84.0%
associate-+l+84.0%
associate-+l+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+l-61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in t around inf 45.9%
Taylor expanded in y around inf 25.1%
associate--l+35.9%
+-commutative35.9%
associate--r+36.5%
Simplified36.5%
Taylor expanded in z around inf 20.3%
flip--20.3%
add-sqr-sqrt20.2%
add-sqr-sqrt20.3%
Applied egg-rr20.3%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification40.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1.85e-131)
(+
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ 1.0 (sqrt z)))))
(if (<= y 1.9e+23)
(+
(+ 1.0 (- (* x 0.5) (sqrt x)))
(-
(+ (sqrt (+ 1.0 y)) (/ (+ 1.0 (- z z)) (+ (sqrt (+ 1.0 z)) (sqrt z))))
(sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.85e-131) {
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
} else if (y <= 1.9e+23) {
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + ((sqrt((1.0 + y)) + ((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z)))) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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.85d-131) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (1.0d0 + sqrt(z))))
else if (y <= 1.9d+23) then
tmp = (1.0d0 + ((x * 0.5d0) - sqrt(x))) + ((sqrt((1.0d0 + y)) + ((1.0d0 + (z - z)) / (sqrt((1.0d0 + z)) + sqrt(z)))) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.85e-131) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (1.0 + Math.sqrt(z))));
} else if (y <= 1.9e+23) {
tmp = (1.0 + ((x * 0.5) - Math.sqrt(x))) + ((Math.sqrt((1.0 + y)) + ((1.0 + (z - z)) / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.85e-131: tmp = ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (1.0 + math.sqrt(z)))) elif y <= 1.9e+23: tmp = (1.0 + ((x * 0.5) - math.sqrt(x))) + ((math.sqrt((1.0 + y)) + ((1.0 + (z - z)) / (math.sqrt((1.0 + z)) + math.sqrt(z)))) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.85e-131) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(1.0 + sqrt(z))))); elseif (y <= 1.9e+23) tmp = Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(1.0 + Float64(z - z)) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.85e-131)
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
elseif (y <= 1.9e+23)
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + ((sqrt((1.0 + y)) + ((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z)))) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.85e-131], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+23], N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{-131}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+23}:\\
\;\;\;\;\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + \left(\left(\sqrt{1 + y} + \frac{1 + \left(z - z\right)}{\sqrt{1 + z} + \sqrt{z}}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 1.8500000000000001e-131Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
flip--96.7%
add-sqr-sqrt76.7%
+-commutative76.7%
add-sqr-sqrt97.2%
associate--l+97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 45.4%
Taylor expanded in y around 0 45.4%
Taylor expanded in z around 0 41.1%
sub-neg41.1%
+-commutative41.1%
associate-+l+45.0%
sub-neg45.0%
Simplified45.0%
if 1.8500000000000001e-131 < y < 1.89999999999999987e23Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
associate-+l-73.1%
+-commutative73.1%
+-commutative73.1%
Simplified73.1%
Taylor expanded in t around inf 62.9%
Taylor expanded in x around 0 37.9%
associate--l+37.9%
Simplified37.9%
+-commutative37.9%
flip--37.9%
add-sqr-sqrt34.7%
+-commutative34.7%
add-sqr-sqrt38.4%
associate-+r-38.4%
div-inv38.4%
fma-define38.4%
+-commutative38.4%
Applied egg-rr38.4%
fma-undefine38.4%
associate-+r-38.4%
associate-*r/38.4%
*-rgt-identity38.4%
associate-+r-38.4%
+-commutative38.4%
associate--l+38.5%
+-commutative38.5%
+-commutative38.5%
Simplified38.5%
if 1.89999999999999987e23 < y Initial program 82.7%
associate-+l+82.7%
associate-+l+82.7%
+-commutative82.7%
+-commutative82.7%
associate-+l-60.6%
+-commutative60.6%
+-commutative60.6%
Simplified60.6%
Taylor expanded in t around inf 45.3%
Taylor expanded in y around inf 24.3%
associate--l+35.3%
+-commutative35.3%
associate--r+35.8%
Simplified35.8%
Taylor expanded in z around inf 20.3%
flip--20.4%
add-sqr-sqrt20.3%
add-sqr-sqrt20.4%
Applied egg-rr20.4%
associate--l+25.1%
+-inverses25.1%
metadata-eval25.1%
+-commutative25.1%
Simplified25.1%
Final simplification34.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))) (t_2 (+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))))
(if (<= y 1e-131)
(+ t_2 (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ 1.0 (sqrt z)))))
(if (<= y 6.2e-22)
(+ t_2 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 9.2e+30)
(-
(+
t_1
(+ (* 0.5 (sqrt (/ 1.0 z))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(sqrt x))
(/ 1.0 (+ (sqrt x) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = (1.0 - sqrt(x)) + (1.0 - sqrt(y));
double tmp;
if (y <= 1e-131) {
tmp = t_2 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
} else if (y <= 6.2e-22) {
tmp = t_2 + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
} else if (y <= 9.2e+30) {
tmp = (t_1 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = sqrt((x + 1.0d0))
t_2 = (1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))
if (y <= 1d-131) then
tmp = t_2 + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (1.0d0 + sqrt(z))))
else if (y <= 6.2d-22) then
tmp = t_2 + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
else if (y <= 9.2d+30) then
tmp = (t_1 + ((0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = (1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y));
double tmp;
if (y <= 1e-131) {
tmp = t_2 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (1.0 + Math.sqrt(z))));
} else if (y <= 6.2e-22) {
tmp = t_2 + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
} else if (y <= 9.2e+30) {
tmp = (t_1 + ((0.5 * Math.sqrt((1.0 / z))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = (1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y)) tmp = 0 if y <= 1e-131: tmp = t_2 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (1.0 + math.sqrt(z)))) elif y <= 6.2e-22: tmp = t_2 + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) elif y <= 9.2e+30: tmp = (t_1 + ((0.5 * math.sqrt((1.0 / z))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) tmp = 0.0 if (y <= 1e-131) tmp = Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(1.0 + sqrt(z))))); elseif (y <= 6.2e-22) tmp = Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); elseif (y <= 9.2e+30) tmp = Float64(Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = (1.0 - sqrt(x)) + (1.0 - sqrt(y));
tmp = 0.0;
if (y <= 1e-131)
tmp = t_2 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
elseif (y <= 6.2e-22)
tmp = t_2 + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
elseif (y <= 9.2e+30)
tmp = (t_1 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1e-131], N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-22], N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e+30], N[(N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\\
\mathbf{if}\;y \leq 10^{-131}:\\
\;\;\;\;t\_2 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-22}:\\
\;\;\;\;t\_2 + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+30}:\\
\;\;\;\;\left(t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 9.9999999999999999e-132Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
flip--96.6%
add-sqr-sqrt76.4%
+-commutative76.4%
add-sqr-sqrt97.2%
associate--l+97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 44.7%
Taylor expanded in y around 0 44.7%
Taylor expanded in z around 0 40.4%
sub-neg40.4%
+-commutative40.4%
associate-+l+44.3%
sub-neg44.3%
Simplified44.3%
if 9.9999999999999999e-132 < y < 6.20000000000000025e-22Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
flip--98.3%
add-sqr-sqrt81.6%
+-commutative81.6%
add-sqr-sqrt98.9%
associate--l+98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 50.5%
Taylor expanded in y around 0 50.5%
Taylor expanded in t around inf 33.5%
if 6.20000000000000025e-22 < y < 9.2e30Initial program 82.1%
associate-+l+82.1%
associate-+l+82.1%
+-commutative82.1%
+-commutative82.1%
associate-+l-62.0%
+-commutative62.0%
+-commutative62.0%
Simplified62.0%
Taylor expanded in t around inf 54.9%
flip--55.7%
div-inv55.7%
add-sqr-sqrt51.9%
add-sqr-sqrt55.7%
associate--l+66.9%
Applied egg-rr66.9%
+-inverses66.9%
metadata-eval66.9%
*-lft-identity66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in z around inf 15.1%
if 9.2e30 < y Initial program 84.0%
associate-+l+84.0%
associate-+l+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+l-61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in t around inf 45.9%
Taylor expanded in y around inf 25.1%
associate--l+35.9%
+-commutative35.9%
associate--r+36.5%
Simplified36.5%
Taylor expanded in z around inf 20.3%
flip--20.3%
add-sqr-sqrt20.2%
add-sqr-sqrt20.3%
Applied egg-rr20.3%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification31.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))) (t_2 (sqrt (+ x 1.0))))
(if (<= y 1.32e-130)
(+ t_1 (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ 1.0 (sqrt z)))))
(if (<= y 6.2e-22)
(+
t_1
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (* 0.5 (sqrt (/ 1.0 t)))))
(if (<= y 9.5e+30)
(-
(+
t_2
(+ (* 0.5 (sqrt (/ 1.0 z))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(sqrt x))
(/ 1.0 (+ (sqrt x) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (1.0 - sqrt(x)) + (1.0 - sqrt(y));
double t_2 = sqrt((x + 1.0));
double tmp;
if (y <= 1.32e-130) {
tmp = t_1 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
} else if (y <= 6.2e-22) {
tmp = t_1 + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (0.5 * sqrt((1.0 / t))));
} else if (y <= 9.5e+30) {
tmp = (t_2 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = (1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))
t_2 = sqrt((x + 1.0d0))
if (y <= 1.32d-130) then
tmp = t_1 + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (1.0d0 + sqrt(z))))
else if (y <= 6.2d-22) then
tmp = t_1 + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (0.5d0 * sqrt((1.0d0 / t))))
else if (y <= 9.5d+30) then
tmp = (t_2 + ((0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 1.32e-130) {
tmp = t_1 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (1.0 + Math.sqrt(z))));
} else if (y <= 6.2e-22) {
tmp = t_1 + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (0.5 * Math.sqrt((1.0 / t))));
} else if (y <= 9.5e+30) {
tmp = (t_2 + ((0.5 * Math.sqrt((1.0 / z))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if y <= 1.32e-130: tmp = t_1 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (1.0 + math.sqrt(z)))) elif y <= 6.2e-22: tmp = t_1 + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (0.5 * math.sqrt((1.0 / t)))) elif y <= 9.5e+30: tmp = (t_2 + ((0.5 * math.sqrt((1.0 / z))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 1.32e-130) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(1.0 + sqrt(z))))); elseif (y <= 6.2e-22) tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(0.5 * sqrt(Float64(1.0 / t))))); elseif (y <= 9.5e+30) tmp = Float64(Float64(t_2 + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (1.0 - sqrt(x)) + (1.0 - sqrt(y));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 1.32e-130)
tmp = t_1 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
elseif (y <= 6.2e-22)
tmp = t_1 + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (0.5 * sqrt((1.0 / t))));
elseif (y <= 9.5e+30)
tmp = (t_2 + ((0.5 * sqrt((1.0 / z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.32e-130], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-22], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+30], N[(N[(t$95$2 + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 1.32 \cdot 10^{-130}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1 + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+30}:\\
\;\;\;\;\left(t\_2 + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2}\\
\end{array}
\end{array}
if y < 1.3200000000000001e-130Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
flip--96.7%
add-sqr-sqrt76.7%
+-commutative76.7%
add-sqr-sqrt97.2%
associate--l+97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 45.4%
Taylor expanded in y around 0 45.4%
Taylor expanded in z around 0 41.1%
sub-neg41.1%
+-commutative41.1%
associate-+l+45.0%
sub-neg45.0%
Simplified45.0%
if 1.3200000000000001e-130 < y < 6.20000000000000025e-22Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
flip--98.3%
add-sqr-sqrt81.1%
+-commutative81.1%
add-sqr-sqrt98.9%
associate--l+98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 49.3%
Taylor expanded in y around 0 49.3%
Taylor expanded in t around inf 31.9%
if 6.20000000000000025e-22 < y < 9.5000000000000003e30Initial program 82.1%
associate-+l+82.1%
associate-+l+82.1%
+-commutative82.1%
+-commutative82.1%
associate-+l-62.0%
+-commutative62.0%
+-commutative62.0%
Simplified62.0%
Taylor expanded in t around inf 54.9%
flip--55.7%
div-inv55.7%
add-sqr-sqrt51.9%
add-sqr-sqrt55.7%
associate--l+66.9%
Applied egg-rr66.9%
+-inverses66.9%
metadata-eval66.9%
*-lft-identity66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in z around inf 15.1%
if 9.5000000000000003e30 < y Initial program 84.0%
associate-+l+84.0%
associate-+l+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+l-61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in t around inf 45.9%
Taylor expanded in y around inf 25.1%
associate--l+35.9%
+-commutative35.9%
associate--r+36.5%
Simplified36.5%
Taylor expanded in z around inf 20.3%
flip--20.3%
add-sqr-sqrt20.2%
add-sqr-sqrt20.3%
Applied egg-rr20.3%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification31.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 3.7e-121)
(+
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ 1.0 (sqrt z)))))
(if (<= y 1.9e+23)
(+
(+ 1.0 (- (* x 0.5) (sqrt x)))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 y)) (sqrt y))))
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.7e-121) {
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
} else if (y <= 1.9e+23) {
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + y)) - sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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.7d-121) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (1.0d0 + sqrt(z))))
else if (y <= 1.9d+23) then
tmp = (1.0d0 + ((x * 0.5d0) - sqrt(x))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + y)) - sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.7e-121) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (1.0 + Math.sqrt(z))));
} else if (y <= 1.9e+23) {
tmp = (1.0 + ((x * 0.5) - Math.sqrt(x))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.7e-121: tmp = ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (1.0 + math.sqrt(z)))) elif y <= 1.9e+23: tmp = (1.0 + ((x * 0.5) - math.sqrt(x))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3.7e-121) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(1.0 + sqrt(z))))); elseif (y <= 1.9e+23) tmp = Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3.7e-121)
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (1.0 + sqrt(z))));
elseif (y <= 1.9e+23)
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + y)) - sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3.7e-121], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+23], N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.7 \cdot 10^{-121}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+23}:\\
\;\;\;\;\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 3.7000000000000002e-121Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--96.7%
add-sqr-sqrt76.7%
+-commutative76.7%
add-sqr-sqrt97.2%
associate--l+97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 46.1%
Taylor expanded in y around 0 46.1%
Taylor expanded in z around 0 42.0%
sub-neg42.0%
+-commutative42.0%
associate-+l+45.7%
sub-neg45.7%
Simplified45.7%
if 3.7000000000000002e-121 < y < 1.89999999999999987e23Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
associate-+l-71.6%
+-commutative71.6%
+-commutative71.6%
Simplified71.6%
Taylor expanded in t around inf 62.4%
Taylor expanded in x around 0 36.3%
associate--l+36.3%
Simplified36.3%
if 1.89999999999999987e23 < y Initial program 82.7%
associate-+l+82.7%
associate-+l+82.7%
+-commutative82.7%
+-commutative82.7%
associate-+l-60.6%
+-commutative60.6%
+-commutative60.6%
Simplified60.6%
Taylor expanded in t around inf 45.3%
Taylor expanded in y around inf 24.3%
associate--l+35.3%
+-commutative35.3%
associate--r+35.8%
Simplified35.8%
Taylor expanded in z around inf 20.3%
flip--20.4%
add-sqr-sqrt20.3%
add-sqr-sqrt20.4%
Applied egg-rr20.4%
associate--l+25.1%
+-inverses25.1%
metadata-eval25.1%
+-commutative25.1%
Simplified25.1%
Final simplification34.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= x 23.0)
(+ (+ 1.0 (- (* x 0.5) (sqrt x))) (+ t_1 (- (sqrt (+ 1.0 y)) (sqrt y))))
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ (* 0.5 (sqrt (/ 1.0 y))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (x <= 23.0) {
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + (t_1 + (sqrt((1.0 + y)) - sqrt(y)));
} else {
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = sqrt((1.0d0 + z)) - sqrt(z)
if (x <= 23.0d0) then
tmp = (1.0d0 + ((x * 0.5d0) - sqrt(x))) + (t_1 + (sqrt((1.0d0 + y)) - sqrt(y)))
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((0.5d0 * sqrt((1.0d0 / y))) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (x <= 23.0) {
tmp = (1.0 + ((x * 0.5) - Math.sqrt(x))) + (t_1 + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((0.5 * Math.sqrt((1.0 / y))) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if x <= 23.0: tmp = (1.0 + ((x * 0.5) - math.sqrt(x))) + (t_1 + (math.sqrt((1.0 + y)) - math.sqrt(y))) else: tmp = (0.5 * math.sqrt((1.0 / x))) + ((0.5 * math.sqrt((1.0 / y))) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (x <= 23.0) tmp = Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (x <= 23.0)
tmp = (1.0 + ((x * 0.5) - sqrt(x))) + (t_1 + (sqrt((1.0 + y)) - sqrt(y)));
else
tmp = (0.5 * sqrt((1.0 / x))) + ((0.5 * sqrt((1.0 / y))) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 23.0], N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;x \leq 23:\\
\;\;\;\;\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + \left(t\_1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + t\_1\right)\\
\end{array}
\end{array}
if x < 23Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l-75.0%
+-commutative75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in t around inf 57.4%
Taylor expanded in x around 0 57.4%
associate--l+57.5%
Simplified57.5%
if 23 < x Initial program 83.3%
associate-+l+83.3%
associate-+l+83.3%
+-commutative83.3%
+-commutative83.3%
associate-+l-64.6%
+-commutative64.6%
+-commutative64.6%
Simplified64.6%
Taylor expanded in t around inf 48.6%
Taylor expanded in x around inf 52.0%
Taylor expanded in y around inf 23.7%
Final simplification40.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 4.3e-17)
(+
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1.75e+31)
(- (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (sqrt x))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 4.3e-17) {
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
} else if (y <= 1.75e+31) {
tmp = (t_1 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = sqrt((x + 1.0d0))
if (y <= 4.3d-17) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
else if (y <= 1.75d+31) then
tmp = (t_1 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 4.3e-17) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
} else if (y <= 1.75e+31) {
tmp = (t_1 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 4.3e-17: tmp = ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) elif y <= 1.75e+31: tmp = (t_1 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 4.3e-17) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); elseif (y <= 1.75e+31) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 4.3e-17)
tmp = ((1.0 - sqrt(x)) + (1.0 - sqrt(y))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
elseif (y <= 1.75e+31)
tmp = (t_1 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e-17], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+31], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-17}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+31}:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.30000000000000023e-17Initial program 97.3%
associate-+l+97.3%
sub-neg97.3%
sub-neg97.3%
+-commutative97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
flip--97.2%
add-sqr-sqrt78.2%
+-commutative78.2%
add-sqr-sqrt97.8%
associate--l+97.8%
Applied egg-rr97.8%
Taylor expanded in x around 0 46.7%
Taylor expanded in y around 0 46.7%
Taylor expanded in t around inf 25.5%
if 4.30000000000000023e-17 < y < 1.75e31Initial program 82.1%
associate-+l+82.1%
associate-+l+82.1%
+-commutative82.1%
+-commutative82.1%
associate-+l-62.0%
+-commutative62.0%
+-commutative62.0%
Simplified62.0%
Taylor expanded in t around inf 54.9%
flip--55.7%
div-inv55.7%
add-sqr-sqrt51.9%
add-sqr-sqrt55.7%
associate--l+66.9%
Applied egg-rr66.9%
+-inverses66.9%
metadata-eval66.9%
*-lft-identity66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in z around inf 19.8%
if 1.75e31 < y Initial program 84.0%
associate-+l+84.0%
associate-+l+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+l-61.4%
+-commutative61.4%
+-commutative61.4%
Simplified61.4%
Taylor expanded in t around inf 45.9%
Taylor expanded in y around inf 25.1%
associate--l+35.9%
+-commutative35.9%
associate--r+36.5%
Simplified36.5%
Taylor expanded in z around inf 20.3%
flip--20.3%
add-sqr-sqrt20.2%
add-sqr-sqrt20.3%
Applied egg-rr20.3%
associate--l+25.2%
+-inverses25.2%
metadata-eval25.2%
+-commutative25.2%
Simplified25.2%
Final simplification25.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.32e+20) (- (+ (sqrt (+ x 1.0)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.32e+20) {
tmp = (sqrt((x + 1.0)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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.32d+20) then
tmp = (sqrt((x + 1.0d0)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.32e+20) {
tmp = (Math.sqrt((x + 1.0)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.32e+20: tmp = (math.sqrt((x + 1.0)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.32e+20) tmp = Float64(Float64(sqrt(Float64(x + 1.0)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.32e+20)
tmp = (sqrt((x + 1.0)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.32e+20], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.32 \cdot 10^{+20}:\\
\;\;\;\;\left(\sqrt{x + 1} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.32e20Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
associate-+l-73.9%
+-commutative73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in t around inf 56.6%
flip--56.7%
div-inv56.7%
add-sqr-sqrt42.1%
add-sqr-sqrt56.7%
associate--l+56.8%
Applied egg-rr56.8%
+-inverses56.8%
metadata-eval56.8%
*-lft-identity56.8%
+-commutative56.8%
Simplified56.8%
Taylor expanded in z around inf 32.9%
if 1.32e20 < x Initial program 83.4%
associate-+l+83.4%
associate-+l+83.4%
+-commutative83.4%
+-commutative83.4%
associate-+l-65.0%
+-commutative65.0%
+-commutative65.0%
Simplified65.0%
Taylor expanded in t around inf 48.8%
Taylor expanded in y around inf 4.9%
associate--l+5.6%
+-commutative5.6%
associate--r+4.9%
Simplified4.9%
Taylor expanded in z around inf 3.2%
Taylor expanded in x around inf 9.8%
Final simplification22.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.0032) (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (+ 1.0 (- (* x 0.5) (sqrt x)))) (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.0032) {
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 + ((x * 0.5) - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= 0.0032d0) then
tmp = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 + ((x * 0.5d0) - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.0032) {
tmp = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 + ((x * 0.5) - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.0032: tmp = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 + ((x * 0.5) - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.0032) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.0032)
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 + ((x * 0.5) - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.0032], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0032:\\
\;\;\;\;\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if x < 0.00320000000000000015Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 57.7%
Taylor expanded in x around 0 57.7%
associate--l+57.7%
Simplified57.7%
Taylor expanded in z around inf 33.8%
if 0.00320000000000000015 < x Initial program 83.5%
associate-+l+83.5%
associate-+l+83.5%
+-commutative83.5%
+-commutative83.5%
associate-+l-64.9%
+-commutative64.9%
+-commutative64.9%
Simplified64.9%
Taylor expanded in t around inf 48.4%
Taylor expanded in y around inf 7.2%
associate--l+8.1%
+-commutative8.1%
associate--r+7.4%
Simplified7.4%
Taylor expanded in z around inf 3.9%
flip--3.9%
add-sqr-sqrt4.1%
add-sqr-sqrt3.9%
Applied egg-rr3.9%
associate--l+10.1%
+-inverses10.1%
metadata-eval10.1%
+-commutative10.1%
Simplified10.1%
Final simplification21.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.5e+16) (+ (sqrt (+ 1.0 y)) (- 1.0 (+ (sqrt x) (sqrt y)))) (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.5e+16) {
tmp = sqrt((1.0 + y)) + (1.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.5d+16) then
tmp = sqrt((1.0d0 + y)) + (1.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.5e+16) {
tmp = Math.sqrt((1.0 + y)) + (1.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.5e+16: tmp = math.sqrt((1.0 + y)) + (1.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.5e+16) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.5e+16)
tmp = sqrt((1.0 + y)) + (1.0 - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.5e+16], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.5 \cdot 10^{+16}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 2.5e16Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l-77.9%
+-commutative77.9%
+-commutative77.9%
Simplified77.9%
Taylor expanded in t around inf 59.9%
Taylor expanded in z around inf 19.8%
+-commutative19.8%
associate--l+38.4%
Simplified38.4%
Taylor expanded in x around 0 16.2%
sub-neg16.2%
+-commutative16.2%
associate-+l+16.2%
sub-neg16.2%
Simplified16.2%
if 2.5e16 < y Initial program 82.6%
associate-+l+82.6%
associate-+l+82.6%
+-commutative82.6%
+-commutative82.6%
associate-+l-60.9%
+-commutative60.9%
+-commutative60.9%
Simplified60.9%
Taylor expanded in t around inf 45.4%
Taylor expanded in y around inf 24.0%
associate--l+34.9%
+-commutative34.9%
associate--r+35.4%
Simplified35.4%
Taylor expanded in z around inf 20.2%
flip--20.2%
add-sqr-sqrt20.1%
add-sqr-sqrt20.2%
Applied egg-rr20.2%
associate--l+24.9%
+-inverses24.9%
metadata-eval24.9%
+-commutative24.9%
Simplified24.9%
Final simplification20.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 6.4e+15) (- (+ 1.0 (sqrt (+ 1.0 y))) (+ (sqrt x) (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.4e+15) {
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= 6.4d+15) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - (sqrt(x) + sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.4e+15) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.4e+15: tmp = (1.0 + math.sqrt((1.0 + y))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.4e+15) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.4e+15)
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.4e+15], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.4 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 6.4e15Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l-77.9%
+-commutative77.9%
+-commutative77.9%
Simplified77.9%
Taylor expanded in t around inf 59.9%
Taylor expanded in z around inf 19.8%
+-commutative19.8%
associate--l+38.4%
Simplified38.4%
Taylor expanded in x around 0 16.2%
if 6.4e15 < y Initial program 82.6%
associate-+l+82.6%
associate-+l+82.6%
+-commutative82.6%
+-commutative82.6%
associate-+l-60.9%
+-commutative60.9%
+-commutative60.9%
Simplified60.9%
Taylor expanded in t around inf 45.4%
Taylor expanded in y around inf 24.0%
associate--l+34.9%
+-commutative34.9%
associate--r+35.4%
Simplified35.4%
Taylor expanded in z around inf 20.2%
flip--20.2%
add-sqr-sqrt20.1%
add-sqr-sqrt20.2%
Applied egg-rr20.2%
associate--l+24.9%
+-inverses24.9%
metadata-eval24.9%
+-commutative24.9%
Simplified24.9%
Final simplification20.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 43000000.0) (- (sqrt (+ x 1.0)) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 43000000.0) {
tmp = sqrt((x + 1.0)) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= 43000000.0d0) then
tmp = sqrt((x + 1.0d0)) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 43000000.0) {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 43000000.0: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 43000000.0) tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 43000000.0)
tmp = sqrt((x + 1.0)) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 43000000.0], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 43000000:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 4.3e7Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
associate-+l-74.5%
+-commutative74.5%
+-commutative74.5%
Simplified74.5%
Taylor expanded in t around inf 57.6%
Taylor expanded in y around inf 26.4%
associate--l+38.6%
+-commutative38.6%
associate--r+39.5%
Simplified39.5%
Taylor expanded in z around inf 25.9%
if 4.3e7 < x Initial program 82.9%
associate-+l+82.9%
associate-+l+82.9%
+-commutative82.9%
+-commutative82.9%
associate-+l-64.7%
+-commutative64.7%
+-commutative64.7%
Simplified64.7%
Taylor expanded in t around inf 48.0%
Taylor expanded in y around inf 5.8%
associate--l+6.5%
+-commutative6.5%
associate--r+5.8%
Simplified5.8%
Taylor expanded in z around inf 3.4%
Taylor expanded in x around inf 9.9%
Final simplification18.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 / (sqrt(x) + sqrt((x + 1.0)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = 1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 / (sqrt(x) + sqrt((x + 1.0)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{x + 1}}
\end{array}
Initial program 90.2%
associate-+l+90.2%
associate-+l+90.2%
+-commutative90.2%
+-commutative90.2%
associate-+l-69.8%
+-commutative69.8%
+-commutative69.8%
Simplified69.8%
Taylor expanded in t around inf 53.0%
Taylor expanded in y around inf 16.5%
associate--l+23.2%
+-commutative23.2%
associate--r+23.3%
Simplified23.3%
Taylor expanded in z around inf 15.1%
flip--15.1%
add-sqr-sqrt15.2%
add-sqr-sqrt15.1%
Applied egg-rr15.1%
associate--l+18.2%
+-inverses18.2%
metadata-eval18.2%
+-commutative18.2%
Simplified18.2%
Final simplification18.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.7) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.7) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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.7d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.7) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.7: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.7) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.7)
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.7], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.7:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.69999999999999996Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 57.7%
Taylor expanded in y around inf 26.0%
associate--l+38.6%
+-commutative38.6%
associate--r+39.4%
Simplified39.4%
Taylor expanded in z around inf 26.4%
Taylor expanded in x around 0 26.4%
if 1.69999999999999996 < x Initial program 83.5%
associate-+l+83.5%
associate-+l+83.5%
+-commutative83.5%
+-commutative83.5%
associate-+l-64.9%
+-commutative64.9%
+-commutative64.9%
Simplified64.9%
Taylor expanded in t around inf 48.4%
Taylor expanded in y around inf 7.2%
associate--l+8.1%
+-commutative8.1%
associate--r+7.4%
Simplified7.4%
Taylor expanded in z around inf 3.9%
Taylor expanded in x around inf 10.1%
Final simplification18.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.05) (+ 1.0 (- (* x (+ 0.5 (* x -0.125))) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.05) {
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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.05d0) then
tmp = 1.0d0 + ((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.05) {
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.05: tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.05) tmp = Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.05)
tmp = 1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.05], N[(1.0 + N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.05:\\
\;\;\;\;1 + \left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.05000000000000004Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 57.7%
Taylor expanded in y around inf 26.0%
associate--l+38.6%
+-commutative38.6%
associate--r+39.4%
Simplified39.4%
Taylor expanded in z around inf 26.4%
Taylor expanded in x around 0 26.4%
associate--l+26.4%
Simplified26.4%
if 1.05000000000000004 < x Initial program 83.5%
associate-+l+83.5%
associate-+l+83.5%
+-commutative83.5%
+-commutative83.5%
associate-+l-64.9%
+-commutative64.9%
+-commutative64.9%
Simplified64.9%
Taylor expanded in t around inf 48.4%
Taylor expanded in y around inf 7.2%
associate--l+8.1%
+-commutative8.1%
associate--r+7.4%
Simplified7.4%
Taylor expanded in z around inf 3.9%
Taylor expanded in x around inf 10.1%
Final simplification18.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 26.0) (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 26.0) {
tmp = 1.0 + ((x * 0.5) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= 26.0d0) then
tmp = 1.0d0 + ((x * 0.5d0) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 26.0) {
tmp = 1.0 + ((x * 0.5) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 26.0: tmp = 1.0 + ((x * 0.5) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 26.0) tmp = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 26.0)
tmp = 1.0 + ((x * 0.5) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 26.0], N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 26:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 26Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l-75.0%
+-commutative75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in t around inf 57.4%
Taylor expanded in y around inf 25.8%
associate--l+38.4%
+-commutative38.4%
associate--r+39.2%
Simplified39.2%
Taylor expanded in z around inf 26.3%
Taylor expanded in x around 0 26.4%
associate--l+26.4%
Simplified26.4%
if 26 < x Initial program 83.3%
associate-+l+83.3%
associate-+l+83.3%
+-commutative83.3%
+-commutative83.3%
associate-+l-64.6%
+-commutative64.6%
+-commutative64.6%
Simplified64.6%
Taylor expanded in t around inf 48.6%
Taylor expanded in y around inf 7.2%
associate--l+8.0%
+-commutative8.0%
associate--r+7.4%
Simplified7.4%
Taylor expanded in z around inf 3.8%
Taylor expanded in x around inf 10.0%
Final simplification18.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.14) (- 1.0 (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.14) {
tmp = 1.0 - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= 0.14d0) then
tmp = 1.0d0 - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.14) {
tmp = 1.0 - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.14: tmp = 1.0 - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.14) tmp = Float64(1.0 - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.14)
tmp = 1.0 - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.14], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.14:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.14000000000000001Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
associate-+l-74.8%
+-commutative74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in t around inf 57.7%
Taylor expanded in y around inf 26.0%
associate--l+38.6%
+-commutative38.6%
associate--r+39.4%
Simplified39.4%
Taylor expanded in z around inf 26.4%
Taylor expanded in x around 0 26.1%
if 0.14000000000000001 < x Initial program 83.5%
associate-+l+83.5%
associate-+l+83.5%
+-commutative83.5%
+-commutative83.5%
associate-+l-64.9%
+-commutative64.9%
+-commutative64.9%
Simplified64.9%
Taylor expanded in t around inf 48.4%
Taylor expanded in y around inf 7.2%
associate--l+8.1%
+-commutative8.1%
associate--r+7.4%
Simplified7.4%
Taylor expanded in z around inf 3.9%
Taylor expanded in x around inf 10.1%
Final simplification18.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 90.2%
associate-+l+90.2%
associate-+l+90.2%
+-commutative90.2%
+-commutative90.2%
associate-+l-69.8%
+-commutative69.8%
+-commutative69.8%
Simplified69.8%
Taylor expanded in t around inf 53.0%
Taylor expanded in y around inf 16.5%
associate--l+23.2%
+-commutative23.2%
associate--r+23.3%
Simplified23.3%
Taylor expanded in z around inf 15.1%
Taylor expanded in x around 0 13.6%
Final simplification13.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
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 = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024059
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))