
(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 24 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 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(t_2
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= (- (sqrt (+ 1.0 x)) (sqrt x)) 0.0)
(+ t_2 (+ t_1 (* 0.5 (sqrt (/ 1.0 x)))))
(+ t_2 (+ t_1 (+ 1.0 (- (* x 0.5) (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double t_2 = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t));
double tmp;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 0.0) {
tmp = t_2 + (t_1 + (0.5 * sqrt((1.0 / x))));
} else {
tmp = t_2 + (t_1 + (1.0 + ((x * 0.5) - sqrt(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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))
t_2 = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t))
if ((sqrt((1.0d0 + x)) - sqrt(x)) <= 0.0d0) then
tmp = t_2 + (t_1 + (0.5d0 * sqrt((1.0d0 / x))))
else
tmp = t_2 + (t_1 + (1.0d0 + ((x * 0.5d0) - sqrt(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 t_1 = 1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)));
double t_2 = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double tmp;
if ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) <= 0.0) {
tmp = t_2 + (t_1 + (0.5 * Math.sqrt((1.0 / x))));
} else {
tmp = t_2 + (t_1 + (1.0 + ((x * 0.5) - Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) t_2 = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t)) tmp = 0 if (math.sqrt((1.0 + x)) - math.sqrt(x)) <= 0.0: tmp = t_2 + (t_1 + (0.5 * math.sqrt((1.0 / x)))) else: tmp = t_2 + (t_1 + (1.0 + ((x * 0.5) - math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) t_2 = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) tmp = 0.0 if (Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) <= 0.0) tmp = Float64(t_2 + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / x))))); else tmp = Float64(t_2 + Float64(t_1 + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))))); 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(y) + sqrt((1.0 + y)));
t_2 = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t));
tmp = 0.0;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 0.0)
tmp = t_2 + (t_1 + (0.5 * sqrt((1.0 / x))));
else
tmp = t_2 + (t_1 + (1.0 + ((x * 0.5) - sqrt(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_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.0], N[(t$95$2 + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$1 + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
t_2 := \frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{if}\;\sqrt{1 + x} - \sqrt{x} \leq 0:\\
\;\;\;\;t\_2 + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_1 + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0Initial program 85.1%
associate-+l+85.1%
associate-+l-40.6%
associate-+l-85.1%
sub-neg85.1%
sub-neg85.1%
+-commutative85.1%
+-commutative85.1%
+-commutative85.1%
Simplified85.1%
flip--85.5%
add-sqr-sqrt68.6%
add-sqr-sqrt85.5%
Applied egg-rr85.5%
associate--l+87.8%
+-inverses87.8%
metadata-eval87.8%
+-commutative87.8%
Simplified87.8%
flip--87.8%
add-sqr-sqrt76.6%
add-sqr-sqrt88.2%
Applied egg-rr88.2%
associate--l+90.3%
+-inverses90.3%
metadata-eval90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in x around inf 93.4%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.8%
associate-+l+96.8%
associate-+l-96.8%
associate-+l-96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--97.1%
add-sqr-sqrt77.2%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
+-commutative97.5%
Simplified97.5%
flip--97.9%
add-sqr-sqrt79.1%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.2%
+-inverses98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 93.0%
associate--l+93.0%
Simplified93.0%
Final simplification93.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 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= (- t_2 (sqrt x)) 0.9999999999985)
(+ (+ (/ 1.0 (+ t_2 (sqrt x))) t_1) t_3)
(+ (+ t_3 (- (sqrt (+ 1.0 t)) (sqrt t))) (+ t_1 (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double t_2 = sqrt((1.0 + x));
double t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if ((t_2 - sqrt(x)) <= 0.9999999999985) {
tmp = ((1.0 / (t_2 + sqrt(x))) + t_1) + t_3;
} else {
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 - sqrt(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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))
t_2 = sqrt((1.0d0 + x))
t_3 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if ((t_2 - sqrt(x)) <= 0.9999999999985d0) then
tmp = ((1.0d0 / (t_2 + sqrt(x))) + t_1) + t_3
else
tmp = (t_3 + (sqrt((1.0d0 + t)) - sqrt(t))) + (t_1 + (1.0d0 - sqrt(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 t_1 = 1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if ((t_2 - Math.sqrt(x)) <= 0.9999999999985) {
tmp = ((1.0 / (t_2 + Math.sqrt(x))) + t_1) + t_3;
} else {
tmp = (t_3 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (t_1 + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) t_2 = math.sqrt((1.0 + x)) t_3 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if (t_2 - math.sqrt(x)) <= 0.9999999999985: tmp = ((1.0 / (t_2 + math.sqrt(x))) + t_1) + t_3 else: tmp = (t_3 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (t_1 + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (Float64(t_2 - sqrt(x)) <= 0.9999999999985) tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + t_1) + t_3); else tmp = Float64(Float64(t_3 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(t_1 + Float64(1.0 - sqrt(x)))); 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(y) + sqrt((1.0 + y)));
t_2 = sqrt((1.0 + x));
t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if ((t_2 - sqrt(x)) <= 0.9999999999985)
tmp = ((1.0 / (t_2 + sqrt(x))) + t_1) + t_3;
else
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 - sqrt(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_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.9999999999985], N[(N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(t$95$3 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
t_2 := \sqrt{1 + x}\\
t_3 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;t\_2 - \sqrt{x} \leq 0.9999999999985:\\
\;\;\;\;\left(\frac{1}{t\_2 + \sqrt{x}} + t\_1\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(t\_1 + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.999999999998499978Initial program 85.3%
associate-+l+85.3%
associate-+l-44.9%
associate-+l-85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
flip--85.6%
add-sqr-sqrt67.8%
add-sqr-sqrt85.6%
Applied egg-rr85.6%
associate--l+87.7%
+-inverses87.7%
metadata-eval87.7%
+-commutative87.7%
Simplified87.7%
flip--87.9%
add-sqr-sqrt76.0%
add-sqr-sqrt88.2%
Applied egg-rr88.2%
associate--l+90.2%
+-inverses90.2%
metadata-eval90.2%
+-commutative90.2%
Simplified90.2%
flip--63.9%
add-sqr-sqrt41.7%
+-commutative41.7%
add-sqr-sqrt64.6%
+-commutative64.6%
Applied egg-rr91.2%
associate-+r-66.9%
+-inverses66.9%
metadata-eval66.9%
Simplified94.0%
Taylor expanded in t around inf 51.8%
if 0.999999999998499978 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.0%
associate-+l+98.0%
associate-+l-98.0%
associate-+l-98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
flip--98.2%
add-sqr-sqrt79.0%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
associate--l+98.7%
+-inverses98.7%
metadata-eval98.7%
+-commutative98.7%
Simplified98.7%
flip--98.9%
add-sqr-sqrt80.1%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in x around 0 99.2%
Final simplification73.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 (sqrt (+ 1.0 t))) (t_2 (sqrt (+ 1.0 y))) (t_3 (sqrt (+ 1.0 z))))
(if (<= (- t_1 (sqrt t)) 0.0)
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt y) t_2)))
(/ 1.0 (+ (sqrt z) t_3)))
(+
1.0
(+
t_1
(- (+ t_2 t_3) (+ (sqrt t) (+ (sqrt z) (+ (sqrt x) (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 + t));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + z));
double tmp;
if ((t_1 - sqrt(t)) <= 0.0) {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + t_2))) + (1.0 / (sqrt(z) + t_3));
} else {
tmp = 1.0 + (t_1 + ((t_2 + t_3) - (sqrt(t) + (sqrt(z) + (sqrt(x) + 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + z))
if ((t_1 - sqrt(t)) <= 0.0d0) then
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt(y) + t_2))) + (1.0d0 / (sqrt(z) + t_3))
else
tmp = 1.0d0 + (t_1 + ((t_2 + t_3) - (sqrt(t) + (sqrt(z) + (sqrt(x) + 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 + t));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if ((t_1 - Math.sqrt(t)) <= 0.0) {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt(y) + t_2))) + (1.0 / (Math.sqrt(z) + t_3));
} else {
tmp = 1.0 + (t_1 + ((t_2 + t_3) - (Math.sqrt(t) + (Math.sqrt(z) + (Math.sqrt(x) + 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 + t)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if (t_1 - math.sqrt(t)) <= 0.0: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt(y) + t_2))) + (1.0 / (math.sqrt(z) + t_3)) else: tmp = 1.0 + (t_1 + ((t_2 + t_3) - (math.sqrt(t) + (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y)))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(t_1 - sqrt(t)) <= 0.0) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(y) + t_2))) + Float64(1.0 / Float64(sqrt(z) + t_3))); else tmp = Float64(1.0 + Float64(t_1 + Float64(Float64(t_2 + t_3) - Float64(sqrt(t) + Float64(sqrt(z) + Float64(sqrt(x) + 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 + t));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_1 - sqrt(t)) <= 0.0)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + t_2))) + (1.0 / (sqrt(z) + t_3));
else
tmp = 1.0 + (t_1 + ((t_2 + t_3) - (sqrt(t) + (sqrt(z) + (sqrt(x) + 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[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(N[(t$95$2 + t$95$3), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $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 + t}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t\_1 - \sqrt{t} \leq 0:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{y} + t\_2}\right) + \frac{1}{\sqrt{z} + t\_3}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_1 + \left(\left(t\_2 + t\_3\right) - \left(\sqrt{t} + \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) < 0.0Initial program 85.2%
associate-+l+85.2%
associate-+l-61.9%
associate-+l-85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
flip--85.2%
add-sqr-sqrt71.9%
add-sqr-sqrt85.2%
Applied egg-rr85.2%
associate--l+87.5%
+-inverses87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
flip--87.7%
add-sqr-sqrt78.3%
add-sqr-sqrt87.8%
Applied egg-rr87.8%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
Simplified90.1%
flip--43.2%
add-sqr-sqrt34.2%
+-commutative34.2%
add-sqr-sqrt43.2%
+-commutative43.2%
Applied egg-rr90.3%
associate-+r-45.2%
+-inverses45.2%
metadata-eval45.2%
Simplified92.9%
Taylor expanded in t around inf 92.9%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) Initial program 96.4%
+-commutative96.4%
associate-+r+96.4%
associate-+r-76.2%
associate-+l-58.5%
associate-+r-54.5%
Simplified44.2%
Taylor expanded in x around 0 14.3%
associate--l+24.1%
associate--l+37.5%
+-commutative37.5%
+-commutative37.5%
associate-+r+37.5%
Simplified37.5%
Final simplification63.5%
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 t))) (t_2 (sqrt (+ 1.0 z))))
(if (<= (- t_1 (sqrt t)) 0.0)
(+
(+
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(/ 1.0 (+ (sqrt z) t_2)))
(+
1.0
(-
(+ 1.0 (+ t_2 t_1))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double t_2 = sqrt((1.0 + z));
double tmp;
if ((t_1 - sqrt(t)) <= 0.0) {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (1.0 / (sqrt(z) + t_2));
} else {
tmp = 1.0 + ((1.0 + (t_2 + t_1)) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
}
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((1.0d0 + t))
t_2 = sqrt((1.0d0 + z))
if ((t_1 - sqrt(t)) <= 0.0d0) then
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (1.0d0 / (sqrt(z) + t_2))
else
tmp = 1.0d0 + ((1.0d0 + (t_2 + t_1)) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))))
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 + t));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if ((t_1 - Math.sqrt(t)) <= 0.0) {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (1.0 / (Math.sqrt(z) + t_2));
} else {
tmp = 1.0 + ((1.0 + (t_2 + t_1)) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if (t_1 - math.sqrt(t)) <= 0.0: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (1.0 / (math.sqrt(z) + t_2)) else: tmp = 1.0 + ((1.0 + (t_2 + t_1)) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(t_1 - sqrt(t)) <= 0.0) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(1.0 / Float64(sqrt(z) + t_2))); else tmp = Float64(1.0 + Float64(Float64(1.0 + Float64(t_2 + t_1)) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))))); 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 + t));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_1 - sqrt(t)) <= 0.0)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (1.0 / (sqrt(z) + t_2));
else
tmp = 1.0 + ((1.0 + (t_2 + t_1)) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
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 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(1.0 + N[(t$95$2 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $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 + t}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t\_1 - \sqrt{t} \leq 0:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \frac{1}{\sqrt{z} + t\_2}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(1 + \left(t\_2 + t\_1\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) < 0.0Initial program 85.2%
associate-+l+85.2%
associate-+l-61.9%
associate-+l-85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
flip--85.2%
add-sqr-sqrt71.9%
add-sqr-sqrt85.2%
Applied egg-rr85.2%
associate--l+87.5%
+-inverses87.5%
metadata-eval87.5%
+-commutative87.5%
Simplified87.5%
flip--87.7%
add-sqr-sqrt78.3%
add-sqr-sqrt87.8%
Applied egg-rr87.8%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
Simplified90.1%
flip--43.2%
add-sqr-sqrt34.2%
+-commutative34.2%
add-sqr-sqrt43.2%
+-commutative43.2%
Applied egg-rr90.3%
associate-+r-45.2%
+-inverses45.2%
metadata-eval45.2%
Simplified92.9%
Taylor expanded in t around inf 92.9%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t)) Initial program 96.4%
+-commutative96.4%
associate-+r+96.4%
associate-+r-76.2%
associate-+l-58.5%
associate-+r-54.5%
Simplified44.2%
Taylor expanded in x around 0 14.3%
associate--l+24.1%
associate--l+37.5%
+-commutative37.5%
+-commutative37.5%
associate-+r+37.5%
Simplified37.5%
Taylor expanded in y around 0 16.2%
Final simplification52.1%
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 (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))) (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
}
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((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t)))
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((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 91.2%
associate-+l+91.2%
associate-+l-69.6%
associate-+l-91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
flip--91.5%
add-sqr-sqrt73.0%
add-sqr-sqrt91.5%
Applied egg-rr91.5%
associate--l+92.8%
+-inverses92.8%
metadata-eval92.8%
+-commutative92.8%
Simplified92.8%
flip--93.0%
add-sqr-sqrt77.9%
add-sqr-sqrt93.2%
Applied egg-rr93.2%
associate--l+94.4%
+-inverses94.4%
metadata-eval94.4%
+-commutative94.4%
Simplified94.4%
flip--71.6%
add-sqr-sqrt59.7%
+-commutative59.7%
add-sqr-sqrt71.9%
+-commutative71.9%
Applied egg-rr94.9%
associate-+r-73.2%
+-inverses73.2%
metadata-eval73.2%
Simplified96.4%
Final simplification96.4%
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 x))) (t_2 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= y 7.5e-57)
(+
(+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- t_1 (sqrt x)) (- 1.0 (sqrt y))))
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
t_2))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if (y <= 7.5e-57) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(x)) + (1.0 - sqrt(y)));
} else {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + 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 = sqrt((1.0d0 + x))
t_2 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if (y <= 7.5d-57) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + ((t_1 - sqrt(x)) + (1.0d0 - sqrt(y)))
else
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + 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((1.0 + x));
double t_2 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if (y <= 7.5e-57) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((t_1 - Math.sqrt(x)) + (1.0 - Math.sqrt(y)));
} else {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if y <= 7.5e-57: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((t_1 - math.sqrt(x)) + (1.0 - math.sqrt(y))) else: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (y <= 7.5e-57) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + 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((1.0 + x));
t_2 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if (y <= 7.5e-57)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(x)) + (1.0 - sqrt(y)));
else
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + 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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7.5e-57], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;y \leq 7.5 \cdot 10^{-57}:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(t\_1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t\_1 + \sqrt{x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + t\_2\\
\end{array}
\end{array}
if y < 7.49999999999999973e-57Initial program 97.2%
associate-+l+97.2%
associate-+l-58.8%
associate-+l-97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
flip--97.5%
add-sqr-sqrt76.2%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in y around 0 98.1%
if 7.49999999999999973e-57 < y Initial program 87.0%
associate-+l+87.0%
associate-+l-77.1%
associate-+l-87.0%
sub-neg87.0%
sub-neg87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
Simplified87.0%
flip--87.3%
add-sqr-sqrt70.8%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
associate--l+89.1%
+-inverses89.1%
metadata-eval89.1%
+-commutative89.1%
Simplified89.1%
flip--89.5%
add-sqr-sqrt63.9%
add-sqr-sqrt89.8%
Applied egg-rr89.8%
associate--l+91.8%
+-inverses91.8%
metadata-eval91.8%
+-commutative91.8%
Simplified91.8%
flip--65.7%
add-sqr-sqrt54.9%
+-commutative54.9%
add-sqr-sqrt66.1%
+-commutative66.1%
Applied egg-rr92.4%
associate-+r-68.1%
+-inverses68.1%
metadata-eval68.1%
Simplified94.6%
Taylor expanded in t around inf 51.1%
Final simplification70.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 4.8e+27)
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (+ 1.0 (pow (+ 1.0 y) 0.5)) (+ (sqrt x) (sqrt y))))
(+
(+
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(- (sqrt (+ 1.0 t)) (sqrt t)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.8e+27) {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 + pow((1.0 + y), 0.5)) - (sqrt(x) + sqrt(y)));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (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) :: tmp
if (z <= 4.8d+27) then
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 + ((1.0d0 + y) ** 0.5d0)) - (sqrt(x) + sqrt(y)))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (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 tmp;
if (z <= 4.8e+27) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 + Math.pow((1.0 + y), 0.5)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (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): tmp = 0 if z <= 4.8e+27: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 + math.pow((1.0 + y), 0.5)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (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) tmp = 0.0 if (z <= 4.8e+27) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 + (Float64(1.0 + y) ^ 0.5)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + 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)
tmp = 0.0;
if (z <= 4.8e+27)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 + ((1.0 + y) ^ 0.5)) - (sqrt(x) + sqrt(y)));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (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_] := If[LessEqual[z, 4.8e+27], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Power[N[(1.0 + y), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.8 \cdot 10^{+27}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 + {\left(1 + y\right)}^{0.5}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\end{array}
\end{array}
if z < 4.79999999999999995e27Initial program 95.7%
+-commutative95.7%
associate-+r+95.7%
associate-+r-75.3%
associate-+l-66.2%
associate-+r-53.1%
Simplified53.1%
Taylor expanded in t around inf 16.0%
associate--l+20.5%
associate--l+20.5%
associate-+r+20.5%
Simplified20.5%
Taylor expanded in x around 0 13.7%
associate--l+23.0%
associate--l+23.0%
associate-+r+23.0%
+-commutative23.0%
associate-+r+13.7%
associate--r+13.7%
Simplified13.7%
flip--96.2%
add-sqr-sqrt95.5%
add-sqr-sqrt96.2%
Applied egg-rr13.7%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
+-commutative97.0%
Simplified13.8%
add-sqr-sqrt13.8%
fma-define14.0%
add-sqr-sqrt14.0%
hypot-1-def14.0%
pow1/214.0%
sqrt-pow114.0%
metadata-eval14.0%
add-sqr-sqrt14.0%
hypot-1-def14.0%
pow1/214.0%
sqrt-pow114.0%
metadata-eval14.0%
Applied egg-rr14.0%
fma-undefine13.9%
sub-neg13.9%
+-commutative13.9%
associate-+r+17.9%
Simplified23.2%
if 4.79999999999999995e27 < z Initial program 85.4%
associate-+l+85.4%
associate-+l-63.7%
associate-+l-85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
flip--85.4%
add-sqr-sqrt44.1%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
associate--l+87.3%
+-inverses87.3%
metadata-eval87.3%
+-commutative87.3%
Simplified87.3%
flip--87.3%
add-sqr-sqrt71.6%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
associate--l+89.7%
+-inverses89.7%
metadata-eval89.7%
+-commutative89.7%
Simplified89.7%
flip--85.6%
add-sqr-sqrt72.3%
+-commutative72.3%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr90.5%
associate-+r-88.2%
+-inverses88.2%
metadata-eval88.2%
Simplified92.7%
Taylor expanded in z around inf 89.5%
Final simplification52.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 (<= z 1.9e+28)
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (+ 1.0 (pow (+ 1.0 y) 0.5)) (+ (sqrt x) (sqrt y))))
(+
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.9e+28) {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 + pow((1.0 + y), 0.5)) - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (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) :: tmp
if (z <= 1.9d+28) then
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 + ((1.0d0 + y) ** 0.5d0)) - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (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 tmp;
if (z <= 1.9e+28) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 + Math.pow((1.0 + y), 0.5)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (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): tmp = 0 if z <= 1.9e+28: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 + math.pow((1.0 + y), 0.5)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (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) tmp = 0.0 if (z <= 1.9e+28) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 + (Float64(1.0 + y) ^ 0.5)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 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)
tmp = 0.0;
if (z <= 1.9e+28)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 + ((1.0 + y) ^ 0.5)) - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (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_] := If[LessEqual[z, 1.9e+28], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Power[N[(1.0 + y), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 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}
\mathbf{if}\;z \leq 1.9 \cdot 10^{+28}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 + {\left(1 + y\right)}^{0.5}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 1.8999999999999999e28Initial program 95.7%
+-commutative95.7%
associate-+r+95.7%
associate-+r-75.3%
associate-+l-66.2%
associate-+r-53.1%
Simplified53.1%
Taylor expanded in t around inf 16.0%
associate--l+20.5%
associate--l+20.5%
associate-+r+20.5%
Simplified20.5%
Taylor expanded in x around 0 13.7%
associate--l+23.0%
associate--l+23.0%
associate-+r+23.0%
+-commutative23.0%
associate-+r+13.7%
associate--r+13.7%
Simplified13.7%
flip--96.2%
add-sqr-sqrt95.5%
add-sqr-sqrt96.2%
Applied egg-rr13.7%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
+-commutative97.0%
Simplified13.8%
add-sqr-sqrt13.8%
fma-define14.0%
add-sqr-sqrt14.0%
hypot-1-def14.0%
pow1/214.0%
sqrt-pow114.0%
metadata-eval14.0%
add-sqr-sqrt14.0%
hypot-1-def14.0%
pow1/214.0%
sqrt-pow114.0%
metadata-eval14.0%
Applied egg-rr14.0%
fma-undefine13.9%
sub-neg13.9%
+-commutative13.9%
associate-+r+17.9%
Simplified23.2%
if 1.8999999999999999e28 < z Initial program 85.4%
associate-+l+85.4%
associate-+l+85.4%
+-commutative85.4%
+-commutative85.4%
associate-+l-85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
flip--85.6%
add-sqr-sqrt72.3%
+-commutative72.3%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr86.2%
associate-+r-88.2%
+-inverses88.2%
metadata-eval88.2%
Simplified88.2%
Taylor expanded in z around inf 88.2%
+-commutative88.2%
Simplified88.2%
Final simplification51.7%
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 2100000000.0)
(+
(+ 1.0 (sqrt (+ 1.0 y)))
(- (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (+ (sqrt x) (sqrt y))))
(+
(+ (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 y))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2100000000.0) {
tmp = (1.0 + sqrt((1.0 + y))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - (sqrt(x) + sqrt(y)));
} else {
tmp = ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
}
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 <= 2100000000.0d0) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) - (sqrt(x) + sqrt(y)))
else
tmp = ((1.0d0 + ((x * 0.5d0) - sqrt(x))) + (0.5d0 * sqrt((1.0d0 / y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (0.5d0 * sqrt((1.0d0 / z))))
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 <= 2100000000.0) {
tmp = (1.0 + Math.sqrt((1.0 + y))) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = ((1.0 + ((x * 0.5) - Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (0.5 * Math.sqrt((1.0 / z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2100000000.0: tmp = (1.0 + math.sqrt((1.0 + y))) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = ((1.0 + ((x * 0.5) - math.sqrt(x))) + (0.5 * math.sqrt((1.0 / y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (0.5 * math.sqrt((1.0 / z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2100000000.0) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(0.5 * sqrt(Float64(1.0 / z))))); 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 <= 2100000000.0)
tmp = (1.0 + sqrt((1.0 + y))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - (sqrt(x) + sqrt(y)));
else
tmp = ((1.0 + ((x * 0.5) - sqrt(x))) + (0.5 * sqrt((1.0 / y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
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, 2100000000.0], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2100000000:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\end{array}
\end{array}
if y < 2.1e9Initial program 96.9%
+-commutative96.9%
associate-+r+96.9%
associate-+r-96.9%
associate-+l-96.9%
associate-+r-96.9%
Simplified77.0%
Taylor expanded in t around inf 16.0%
associate--l+20.3%
associate--l+29.8%
associate-+r+29.8%
Simplified29.8%
Taylor expanded in x around 0 14.1%
associate--l+22.8%
associate--l+31.8%
associate-+r+31.8%
+-commutative31.8%
associate-+r+31.8%
associate--r+27.8%
Simplified27.8%
flip--97.1%
add-sqr-sqrt75.0%
add-sqr-sqrt97.1%
Applied egg-rr27.8%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
+-commutative97.7%
Simplified27.9%
if 2.1e9 < y Initial program 84.6%
associate-+l+84.6%
associate-+l-84.1%
associate-+l-84.6%
sub-neg84.6%
sub-neg84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in z around inf 37.1%
Taylor expanded in x around 0 25.2%
associate--l+52.9%
Simplified25.2%
Taylor expanded in y around inf 25.5%
Final simplification26.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 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= y 75000000.0)
(+ (+ 1.0 (sqrt (+ 1.0 y))) (- t_1 (+ (sqrt x) (sqrt y))))
(- (+ 1.0 (+ t_1 (* 0.5 (sqrt (/ 1.0 y))))) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if (y <= 75000000.0) {
tmp = (1.0 + sqrt((1.0 + y))) + (t_1 - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 + (t_1 + (0.5 * sqrt((1.0 / y))))) - sqrt(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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if (y <= 75000000.0d0) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) + (t_1 - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 + (t_1 + (0.5d0 * sqrt((1.0d0 / y))))) - sqrt(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 t_1 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if (y <= 75000000.0) {
tmp = (1.0 + Math.sqrt((1.0 + y))) + (t_1 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 + (t_1 + (0.5 * Math.sqrt((1.0 / y))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if y <= 75000000.0: tmp = (1.0 + math.sqrt((1.0 + y))) + (t_1 - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 + (t_1 + (0.5 * math.sqrt((1.0 / y))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (y <= 75000000.0) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) + Float64(t_1 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / y))))) - sqrt(x)); 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(z) + sqrt((1.0 + z)));
tmp = 0.0;
if (y <= 75000000.0)
tmp = (1.0 + sqrt((1.0 + y))) + (t_1 - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 + (t_1 + (0.5 * sqrt((1.0 / y))))) - sqrt(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_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 75000000.0], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;y \leq 75000000:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) + \left(t\_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 7.5e7Initial program 96.9%
+-commutative96.9%
associate-+r+96.9%
associate-+r-96.9%
associate-+l-96.9%
associate-+r-96.9%
Simplified77.0%
Taylor expanded in t around inf 16.0%
associate--l+20.3%
associate--l+29.8%
associate-+r+29.8%
Simplified29.8%
Taylor expanded in x around 0 14.1%
associate--l+22.8%
associate--l+31.8%
associate-+r+31.8%
+-commutative31.8%
associate-+r+31.8%
associate--r+27.8%
Simplified27.8%
flip--97.1%
add-sqr-sqrt75.0%
add-sqr-sqrt97.1%
Applied egg-rr27.8%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
+-commutative97.7%
Simplified27.9%
if 7.5e7 < y Initial program 84.6%
+-commutative84.6%
associate-+r+84.6%
associate-+r-44.2%
associate-+l-24.1%
associate-+r-8.2%
Simplified6.9%
Taylor expanded in t around inf 3.9%
associate--l+18.4%
associate--l+14.8%
associate-+r+14.8%
Simplified14.8%
Taylor expanded in x around 0 2.8%
associate--l+25.5%
associate--l+20.6%
associate-+r+20.6%
+-commutative20.6%
associate-+r+3.3%
associate--r+4.1%
Simplified4.1%
flip--84.9%
add-sqr-sqrt70.7%
add-sqr-sqrt84.9%
Applied egg-rr4.1%
associate--l+87.1%
+-inverses87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified4.1%
Taylor expanded in y around inf 27.1%
Final simplification27.5%
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) (sqrt y)))
(t_2 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= y 2.6e-20)
(- (+ t_2 2.0) t_1)
(if (<= y 2900000.0)
(+ (+ 1.0 (sqrt (+ 1.0 y))) (- (* 0.5 (sqrt (/ 1.0 z))) t_1))
(- (+ 1.0 (+ t_2 (* 0.5 (sqrt (/ 1.0 y))))) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double t_2 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if (y <= 2.6e-20) {
tmp = (t_2 + 2.0) - t_1;
} else if (y <= 2900000.0) {
tmp = (1.0 + sqrt((1.0 + y))) + ((0.5 * sqrt((1.0 / z))) - t_1);
} else {
tmp = (1.0 + (t_2 + (0.5 * sqrt((1.0 / y))))) - sqrt(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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(x) + sqrt(y)
t_2 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if (y <= 2.6d-20) then
tmp = (t_2 + 2.0d0) - t_1
else if (y <= 2900000.0d0) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) + ((0.5d0 * sqrt((1.0d0 / z))) - t_1)
else
tmp = (1.0d0 + (t_2 + (0.5d0 * sqrt((1.0d0 / y))))) - sqrt(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 t_1 = Math.sqrt(x) + Math.sqrt(y);
double t_2 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if (y <= 2.6e-20) {
tmp = (t_2 + 2.0) - t_1;
} else if (y <= 2900000.0) {
tmp = (1.0 + Math.sqrt((1.0 + y))) + ((0.5 * Math.sqrt((1.0 / z))) - t_1);
} else {
tmp = (1.0 + (t_2 + (0.5 * Math.sqrt((1.0 / y))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) t_2 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if y <= 2.6e-20: tmp = (t_2 + 2.0) - t_1 elif y <= 2900000.0: tmp = (1.0 + math.sqrt((1.0 + y))) + ((0.5 * math.sqrt((1.0 / z))) - t_1) else: tmp = (1.0 + (t_2 + (0.5 * math.sqrt((1.0 / y))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) t_2 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (y <= 2.6e-20) tmp = Float64(Float64(t_2 + 2.0) - t_1); elseif (y <= 2900000.0) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - t_1)); else tmp = Float64(Float64(1.0 + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / y))))) - sqrt(x)); 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) + sqrt(y);
t_2 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if (y <= 2.6e-20)
tmp = (t_2 + 2.0) - t_1;
elseif (y <= 2900000.0)
tmp = (1.0 + sqrt((1.0 + y))) + ((0.5 * sqrt((1.0 / z))) - t_1);
else
tmp = (1.0 + (t_2 + (0.5 * sqrt((1.0 / y))))) - sqrt(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_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.6e-20], N[(N[(t$95$2 + 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[y, 2900000.0], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;y \leq 2.6 \cdot 10^{-20}:\\
\;\;\;\;\left(t\_2 + 2\right) - t\_1\\
\mathbf{elif}\;y \leq 2900000:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) + \left(0.5 \cdot \sqrt{\frac{1}{z}} - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.59999999999999995e-20Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-96.7%
associate-+l-96.7%
associate-+r-96.7%
Simplified77.0%
Taylor expanded in t around inf 15.5%
associate--l+19.8%
associate--l+29.9%
associate-+r+29.9%
Simplified29.9%
Taylor expanded in x around 0 13.5%
associate--l+22.6%
associate--l+32.1%
associate-+r+32.1%
+-commutative32.1%
associate-+r+32.1%
associate--r+27.4%
Simplified27.4%
flip--96.9%
add-sqr-sqrt74.4%
add-sqr-sqrt96.9%
Applied egg-rr27.4%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
+-commutative97.6%
Simplified27.5%
Taylor expanded in y around 0 27.5%
if 2.59999999999999995e-20 < y < 2.9e6Initial program 99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+r-99.0%
associate-+l-98.9%
associate-+r-98.7%
Simplified77.3%
Taylor expanded in t around inf 22.2%
associate--l+26.3%
associate--l+28.7%
associate-+r+28.7%
Simplified28.7%
Taylor expanded in x around 0 21.3%
associate--l+25.4%
associate--l+27.9%
associate-+r+27.9%
+-commutative27.9%
associate-+r+27.9%
associate--r+33.1%
Simplified33.1%
Taylor expanded in z around inf 15.6%
+-commutative15.6%
Simplified15.6%
if 2.9e6 < y Initial program 84.6%
+-commutative84.6%
associate-+r+84.6%
associate-+r-44.2%
associate-+l-24.1%
associate-+r-8.2%
Simplified6.9%
Taylor expanded in t around inf 3.9%
associate--l+18.4%
associate--l+14.8%
associate-+r+14.8%
Simplified14.8%
Taylor expanded in x around 0 2.8%
associate--l+25.5%
associate--l+20.6%
associate-+r+20.6%
+-commutative20.6%
associate-+r+3.3%
associate--r+4.1%
Simplified4.1%
flip--84.9%
add-sqr-sqrt70.7%
add-sqr-sqrt84.9%
Applied egg-rr4.1%
associate--l+87.1%
+-inverses87.1%
metadata-eval87.1%
+-commutative87.1%
Simplified4.1%
Taylor expanded in y around inf 27.1%
Final simplification26.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.6e-20)
(- (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) 2.0) (+ (sqrt x) (sqrt y)))
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (+ 1.0 (- (* x 0.5) (sqrt x))) (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.6e-20) {
tmp = ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + 2.0) - (sqrt(x) + sqrt(y));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + ((x * 0.5) - sqrt(x))) + (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) :: tmp
if (y <= 2.6d-20) then
tmp = ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + 2.0d0) - (sqrt(x) + sqrt(y))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 + ((x * 0.5d0) - sqrt(x))) + (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 tmp;
if (y <= 2.6e-20) {
tmp = ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + 2.0) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 + ((x * 0.5) - Math.sqrt(x))) + (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): tmp = 0 if y <= 2.6e-20: tmp = ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + 2.0) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 + ((x * 0.5) - math.sqrt(x))) + (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) tmp = 0.0 if (y <= 2.6e-20) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + 2.0) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))) + 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)
tmp = 0.0;
if (y <= 2.6e-20)
tmp = ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + 2.0) - (sqrt(x) + sqrt(y));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + ((x * 0.5) - sqrt(x))) + (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_] := If[LessEqual[y, 2.6e-20], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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}
\mathbf{if}\;y \leq 2.6 \cdot 10^{-20}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + 2\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if y < 2.59999999999999995e-20Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-96.7%
associate-+l-96.7%
associate-+r-96.7%
Simplified77.0%
Taylor expanded in t around inf 15.5%
associate--l+19.8%
associate--l+29.9%
associate-+r+29.9%
Simplified29.9%
Taylor expanded in x around 0 13.5%
associate--l+22.6%
associate--l+32.1%
associate-+r+32.1%
+-commutative32.1%
associate-+r+32.1%
associate--r+27.4%
Simplified27.4%
flip--96.9%
add-sqr-sqrt74.4%
add-sqr-sqrt96.9%
Applied egg-rr27.4%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
+-commutative97.6%
Simplified27.5%
Taylor expanded in y around 0 27.5%
if 2.59999999999999995e-20 < y Initial program 85.8%
associate-+l+85.8%
associate-+l-82.3%
associate-+l-85.8%
sub-neg85.8%
sub-neg85.8%
+-commutative85.8%
+-commutative85.8%
+-commutative85.8%
Simplified85.8%
Taylor expanded in z around inf 37.3%
Taylor expanded in x around 0 25.7%
associate--l+53.2%
Simplified25.7%
Taylor expanded in z around 0 14.4%
Final simplification20.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 4000000000.0) (+ (+ 1.0 (sqrt (+ 1.0 y))) (- (- (sqrt (+ 1.0 z)) (sqrt z)) (sqrt y))) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4000000000.0) {
tmp = (1.0 + sqrt((1.0 + y))) + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
} else {
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(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 (y <= 4000000000.0d0) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) + ((sqrt((1.0d0 + z)) - sqrt(z)) - sqrt(y))
else
tmp = (1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(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 (y <= 4000000000.0) {
tmp = (1.0 + Math.sqrt((1.0 + y))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) - Math.sqrt(y));
} else {
tmp = (1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4000000000.0: tmp = (1.0 + math.sqrt((1.0 + y))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) - math.sqrt(y)) else: tmp = (1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4000000000.0) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) - sqrt(y))); else tmp = Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(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 (y <= 4000000000.0)
tmp = (1.0 + sqrt((1.0 + y))) + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
else
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(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[y, 4000000000.0], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4000000000:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 4e9Initial program 96.8%
+-commutative96.8%
associate-+r+96.8%
associate-+r-96.7%
associate-+l-96.7%
associate-+r-96.7%
Simplified77.0%
Taylor expanded in t around inf 16.0%
associate--l+20.2%
associate--l+29.6%
associate-+r+29.6%
Simplified29.6%
Taylor expanded in x around 0 14.0%
associate--l+22.7%
associate--l+31.6%
associate-+r+31.6%
+-commutative31.6%
associate-+r+31.6%
associate--r+27.6%
Simplified27.6%
Taylor expanded in y around inf 57.4%
if 4e9 < y Initial program 84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+r-43.9%
associate-+l-23.6%
associate-+r-7.6%
Simplified6.3%
Taylor expanded in t around inf 3.9%
associate--l+18.5%
associate--l+14.9%
associate-+r+14.9%
Simplified14.9%
Taylor expanded in x around 0 2.9%
associate--l+25.7%
associate--l+20.7%
associate-+r+20.7%
+-commutative20.7%
associate-+r+3.3%
associate--r+4.1%
Simplified4.1%
Taylor expanded in z around inf 4.1%
+-commutative4.1%
Simplified4.1%
Taylor expanded in y around inf 16.4%
Final simplification38.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 3.5e-11) (- (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) 2.0) (+ (sqrt x) (sqrt y))) (+ 1.0 (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.5e-11) {
tmp = ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + 2.0) - (sqrt(x) + sqrt(y));
} else {
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(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 (y <= 3.5d-11) then
tmp = ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + 2.0d0) - (sqrt(x) + sqrt(y))
else
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(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 (y <= 3.5e-11) {
tmp = ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + 2.0) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.5e-11: tmp = ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + 2.0) - (math.sqrt(x) + math.sqrt(y)) else: tmp = 1.0 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3.5e-11) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + 2.0) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(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 (y <= 3.5e-11)
tmp = ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + 2.0) - (sqrt(x) + sqrt(y));
else
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(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[y, 3.5e-11], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-11}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + 2\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 3.50000000000000019e-11Initial program 96.8%
+-commutative96.8%
associate-+r+96.8%
associate-+r-96.8%
associate-+l-96.8%
associate-+r-96.8%
Simplified77.1%
Taylor expanded in t around inf 15.9%
associate--l+20.2%
associate--l+30.0%
associate-+r+30.0%
Simplified30.0%
Taylor expanded in x around 0 13.9%
associate--l+22.8%
associate--l+32.1%
associate-+r+32.1%
+-commutative32.1%
associate-+r+32.1%
associate--r+27.5%
Simplified27.5%
flip--97.0%
add-sqr-sqrt75.2%
add-sqr-sqrt97.0%
Applied egg-rr27.5%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
+-commutative97.6%
Simplified27.6%
Taylor expanded in y around 0 27.5%
if 3.50000000000000019e-11 < y Initial program 85.4%
+-commutative85.4%
associate-+r+85.4%
associate-+r-47.2%
associate-+l-28.2%
associate-+r-13.2%
Simplified10.7%
Taylor expanded in t around inf 4.8%
associate--l+18.7%
associate--l+15.5%
associate-+r+15.5%
Simplified15.5%
Taylor expanded in x around 0 3.7%
associate--l+25.4%
associate--l+20.9%
associate-+r+20.9%
+-commutative20.9%
associate-+r+4.6%
associate--r+5.8%
Simplified5.8%
Taylor expanded in z around inf 5.1%
+-commutative5.1%
Simplified5.1%
Taylor expanded in x around 0 5.1%
associate--l+25.3%
+-commutative25.3%
associate--r+16.3%
Simplified16.3%
Final simplification22.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 (<= z 950000000000.0) (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z))))) (+ 1.0 (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 950000000000.0) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(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 (z <= 950000000000.0d0) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(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 (z <= 950000000000.0) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 950000000000.0: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = 1.0 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 950000000000.0) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(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 (z <= 950000000000.0)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(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[z, 950000000000.0], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 950000000000:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 9.5e11Initial program 96.8%
+-commutative96.8%
associate-+r+96.8%
associate-+r-75.9%
associate-+l-67.1%
associate-+r-53.2%
Simplified53.2%
Taylor expanded in t around inf 16.2%
associate--l+20.7%
associate--l+20.7%
associate-+r+20.7%
Simplified20.7%
Taylor expanded in x around 0 13.8%
associate--l+23.4%
associate--l+23.4%
associate-+r+23.4%
+-commutative23.4%
associate-+r+13.8%
associate--r+13.8%
Simplified13.8%
Taylor expanded in y around 0 12.4%
associate--l+12.4%
Simplified12.4%
if 9.5e11 < z Initial program 84.8%
+-commutative84.8%
associate-+r+84.8%
associate-+r-68.4%
associate-+l-58.4%
associate-+r-58.4%
Simplified34.4%
Taylor expanded in t around inf 3.8%
associate--l+18.0%
associate--l+25.3%
associate-+r+25.3%
Simplified25.3%
Taylor expanded in x around 0 3.3%
associate--l+24.9%
associate--l+30.2%
associate-+r+30.2%
+-commutative30.2%
associate-+r+24.0%
associate--r+20.2%
Simplified20.2%
Taylor expanded in z around inf 20.2%
+-commutative20.2%
Simplified20.2%
Taylor expanded in x around 0 20.2%
associate--l+30.5%
+-commutative30.5%
associate--r+27.8%
Simplified27.8%
Final simplification19.6%
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 (+ 1.0 y)) (sqrt y)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) - 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((1.0d0 + y)) - sqrt(y)) - 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((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) - 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[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)
\end{array}
Initial program 91.2%
+-commutative91.2%
associate-+r+91.2%
associate-+r-72.4%
associate-+l-63.0%
associate-+r-55.6%
Simplified44.4%
Taylor expanded in t around inf 10.4%
associate--l+19.4%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around 0 8.9%
associate--l+24.1%
associate--l+26.6%
associate-+r+26.6%
+-commutative26.6%
associate-+r+18.6%
associate--r+16.8%
Simplified16.8%
Taylor expanded in z around inf 12.6%
+-commutative12.6%
Simplified12.6%
Taylor expanded in x around 0 12.6%
associate--l+22.6%
+-commutative22.6%
associate--r+18.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 (<= y 2800000.0) (- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y)) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2800000.0) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(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 (y <= 2800000.0d0) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = (1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(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 (y <= 2800000.0) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = (1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2800000.0: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = (1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2800000.0) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(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 (y <= 2800000.0)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(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[y, 2800000.0], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2800000:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.8e6Initial program 96.9%
+-commutative96.9%
associate-+r+96.9%
associate-+r-96.9%
associate-+l-96.9%
associate-+r-96.9%
Simplified77.0%
Taylor expanded in t around inf 16.0%
associate--l+20.3%
associate--l+29.8%
associate-+r+29.8%
Simplified29.8%
Taylor expanded in x around 0 14.1%
associate--l+22.8%
associate--l+31.8%
associate-+r+31.8%
+-commutative31.8%
associate-+r+31.8%
associate--r+27.8%
Simplified27.8%
Taylor expanded in z around inf 20.1%
+-commutative20.1%
Simplified20.1%
Taylor expanded in y around inf 49.7%
if 2.8e6 < y Initial program 84.6%
+-commutative84.6%
associate-+r+84.6%
associate-+r-44.2%
associate-+l-24.1%
associate-+r-8.2%
Simplified6.9%
Taylor expanded in t around inf 3.9%
associate--l+18.4%
associate--l+14.8%
associate-+r+14.8%
Simplified14.8%
Taylor expanded in x around 0 2.8%
associate--l+25.5%
associate--l+20.6%
associate-+r+20.6%
+-commutative20.6%
associate-+r+3.3%
associate--r+4.1%
Simplified4.1%
Taylor expanded in z around inf 4.1%
+-commutative4.1%
Simplified4.1%
Taylor expanded in y around inf 16.3%
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 (if (<= y 2.3e+26) (- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y)) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.3e+26) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = sqrt((1.0 + x)) - sqrt(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 (y <= 2.3d+26) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = sqrt((1.0d0 + x)) - sqrt(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 (y <= 2.3e+26) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.3e+26: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.3e+26) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(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 (y <= 2.3e+26)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = sqrt((1.0 + x)) - sqrt(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[y, 2.3e+26], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{+26}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.3000000000000001e26Initial program 95.8%
+-commutative95.8%
associate-+r+95.8%
associate-+r-95.8%
associate-+l-95.8%
associate-+r-95.8%
Simplified76.5%
Taylor expanded in t around inf 16.0%
associate--l+20.5%
associate--l+29.2%
associate-+r+29.2%
Simplified29.2%
Taylor expanded in x around 0 13.6%
associate--l+22.3%
associate--l+30.5%
associate-+r+30.5%
+-commutative30.5%
associate-+r+30.5%
associate--r+27.1%
Simplified27.1%
Taylor expanded in z around inf 19.7%
+-commutative19.7%
Simplified19.7%
Taylor expanded in y around inf 49.2%
if 2.3000000000000001e26 < y Initial program 85.3%
+-commutative85.3%
associate-+r+85.3%
associate-+r-42.3%
associate-+l-20.9%
associate-+r-4.0%
Simplified3.2%
Taylor expanded in t around inf 3.2%
associate--l+18.1%
associate--l+14.7%
associate-+r+14.7%
Simplified14.7%
Taylor expanded in x around inf 5.7%
mul-1-neg5.7%
Simplified5.7%
Taylor expanded in x around inf 17.3%
neg-mul-117.3%
Simplified17.3%
Final simplification35.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 1.0) (- 2.0 (+ (sqrt x) (sqrt y))) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - (sqrt(x) + sqrt(y));
} else {
tmp = 1.0 - sqrt(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 (y <= 1.0d0) then
tmp = 2.0d0 - (sqrt(x) + sqrt(y))
else
tmp = 1.0d0 - sqrt(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 (y <= 1.0) {
tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 2.0 - (math.sqrt(x) + math.sqrt(y)) else: tmp = 1.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 - sqrt(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 (y <= 1.0)
tmp = 2.0 - (sqrt(x) + sqrt(y));
else
tmp = 1.0 - sqrt(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[y, 1.0], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 1Initial program 96.9%
+-commutative96.9%
associate-+r+96.9%
associate-+r-96.9%
associate-+l-96.9%
associate-+r-96.9%
Simplified76.9%
Taylor expanded in t around inf 16.1%
associate--l+20.5%
associate--l+30.0%
associate-+r+30.0%
Simplified30.0%
Taylor expanded in x around 0 14.2%
associate--l+23.0%
associate--l+32.0%
associate-+r+32.0%
+-commutative32.0%
associate-+r+32.0%
associate--r+28.0%
Simplified28.0%
Taylor expanded in z around inf 20.2%
+-commutative20.2%
Simplified20.2%
Taylor expanded in y around 0 20.0%
if 1 < y Initial program 84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+r-44.6%
associate-+l-24.6%
associate-+r-8.9%
Simplified7.6%
Taylor expanded in t around inf 3.9%
associate--l+18.3%
associate--l+14.7%
associate-+r+14.7%
Simplified14.7%
Taylor expanded in x around 0 2.8%
associate--l+25.3%
associate--l+20.4%
associate-+r+20.4%
+-commutative20.4%
associate-+r+3.3%
associate--r+4.1%
Simplified4.1%
Taylor expanded in z around inf 4.1%
+-commutative4.1%
Simplified4.1%
Taylor expanded in y around inf 15.8%
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 (if (<= y 0.95) (- 2.0 (+ (sqrt x) (sqrt y))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.95) {
tmp = 2.0 - (sqrt(x) + sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(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 (y <= 0.95d0) then
tmp = 2.0d0 - (sqrt(x) + sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(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 (y <= 0.95) {
tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.95: tmp = 2.0 - (math.sqrt(x) + math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.95) tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(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 (y <= 0.95)
tmp = 2.0 - (sqrt(x) + sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(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[y, 0.95], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.95:\\
\;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.94999999999999996Initial program 96.9%
+-commutative96.9%
associate-+r+96.9%
associate-+r-96.9%
associate-+l-96.9%
associate-+r-96.9%
Simplified76.9%
Taylor expanded in t around inf 16.1%
associate--l+20.5%
associate--l+30.0%
associate-+r+30.0%
Simplified30.0%
Taylor expanded in x around 0 14.2%
associate--l+23.0%
associate--l+32.0%
associate-+r+32.0%
+-commutative32.0%
associate-+r+32.0%
associate--r+28.0%
Simplified28.0%
Taylor expanded in z around inf 20.2%
+-commutative20.2%
Simplified20.2%
Taylor expanded in y around 0 20.0%
if 0.94999999999999996 < y Initial program 84.7%
+-commutative84.7%
associate-+r+84.7%
associate-+r-44.6%
associate-+l-24.6%
associate-+r-8.9%
Simplified7.6%
Taylor expanded in t around inf 3.9%
associate--l+18.3%
associate--l+14.7%
associate-+r+14.7%
Simplified14.7%
Taylor expanded in x around inf 5.7%
mul-1-neg5.7%
Simplified5.7%
Taylor expanded in x around inf 17.1%
neg-mul-117.1%
Simplified17.1%
Final simplification18.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (sqrt (+ 1.0 y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((1.0 + y));
}
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 = sqrt((1.0d0 + y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((1.0 + y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((1.0 + y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return sqrt(Float64(1.0 + y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((1.0 + y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{1 + y}
\end{array}
Initial program 91.2%
+-commutative91.2%
associate-+r+91.2%
associate-+r-72.4%
associate-+l-63.0%
associate-+r-55.6%
Simplified44.4%
Taylor expanded in t around inf 10.4%
associate--l+19.4%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around inf 14.0%
mul-1-neg14.0%
Simplified14.0%
Taylor expanded in x around inf 17.0%
Final simplification17.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 91.2%
+-commutative91.2%
associate-+r+91.2%
associate-+r-72.4%
associate-+l-63.0%
associate-+r-55.6%
Simplified44.4%
Taylor expanded in t around inf 10.4%
associate--l+19.4%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around 0 8.9%
associate--l+24.1%
associate--l+26.6%
associate-+r+26.6%
+-commutative26.6%
associate-+r+18.6%
associate--r+16.8%
Simplified16.8%
Taylor expanded in z around inf 12.6%
+-commutative12.6%
Simplified12.6%
Taylor expanded in y around inf 12.3%
Final simplification12.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (sqrt y))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt(y);
}
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 = sqrt(y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return sqrt(y) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt(y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[Sqrt[y], $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{y}
\end{array}
Initial program 91.2%
+-commutative91.2%
associate-+r+91.2%
associate-+r-72.4%
associate-+l-63.0%
associate-+r-55.6%
Simplified44.4%
Taylor expanded in t around inf 10.4%
associate--l+19.4%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around inf 14.0%
mul-1-neg14.0%
Simplified14.0%
Taylor expanded in y around inf 6.9%
Final simplification6.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* x 0.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x * 0.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 = x * 0.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x * 0.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x * 0.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x * 0.0) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x * 0.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x * 0.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
x \cdot 0
\end{array}
Initial program 91.2%
+-commutative91.2%
associate-+r+91.2%
associate-+r-72.4%
associate-+l-63.0%
associate-+r-55.6%
Simplified44.4%
Taylor expanded in t around inf 10.4%
associate--l+19.4%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in y around inf 20.0%
Taylor expanded in x around inf 3.1%
distribute-rgt1-in3.1%
metadata-eval3.1%
mul0-lft3.1%
Simplified3.1%
Final simplification3.1%
(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 2024066
(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))))