
(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 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (+ (sqrt x) t_1))
(t_3 (sqrt (+ y 1.0)))
(t_4 (+ (sqrt y) t_3))
(t_5 (sqrt (+ 1.0 z)))
(t_6 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (- t_3 (sqrt y)) 0.9998)
(+ (/ (/ (+ t_4 t_2) t_2) t_4) (+ (- t_5 (sqrt z)) t_6))
(+
(- (+ 1.0 (+ t_1 (* y 0.5))) (+ (sqrt y) (sqrt x)))
(+ t_6 (/ 1.0 (+ t_5 (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 + x));
double t_2 = sqrt(x) + t_1;
double t_3 = sqrt((y + 1.0));
double t_4 = sqrt(y) + t_3;
double t_5 = sqrt((1.0 + z));
double t_6 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if ((t_3 - sqrt(y)) <= 0.9998) {
tmp = (((t_4 + t_2) / t_2) / t_4) + ((t_5 - sqrt(z)) + t_6);
} else {
tmp = ((1.0 + (t_1 + (y * 0.5))) - (sqrt(y) + sqrt(x))) + (t_6 + (1.0 / (t_5 + 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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt(x) + t_1
t_3 = sqrt((y + 1.0d0))
t_4 = sqrt(y) + t_3
t_5 = sqrt((1.0d0 + z))
t_6 = sqrt((1.0d0 + t)) - sqrt(t)
if ((t_3 - sqrt(y)) <= 0.9998d0) then
tmp = (((t_4 + t_2) / t_2) / t_4) + ((t_5 - sqrt(z)) + t_6)
else
tmp = ((1.0d0 + (t_1 + (y * 0.5d0))) - (sqrt(y) + sqrt(x))) + (t_6 + (1.0d0 / (t_5 + 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 + x));
double t_2 = Math.sqrt(x) + t_1;
double t_3 = Math.sqrt((y + 1.0));
double t_4 = Math.sqrt(y) + t_3;
double t_5 = Math.sqrt((1.0 + z));
double t_6 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if ((t_3 - Math.sqrt(y)) <= 0.9998) {
tmp = (((t_4 + t_2) / t_2) / t_4) + ((t_5 - Math.sqrt(z)) + t_6);
} else {
tmp = ((1.0 + (t_1 + (y * 0.5))) - (Math.sqrt(y) + Math.sqrt(x))) + (t_6 + (1.0 / (t_5 + 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 + x)) t_2 = math.sqrt(x) + t_1 t_3 = math.sqrt((y + 1.0)) t_4 = math.sqrt(y) + t_3 t_5 = math.sqrt((1.0 + z)) t_6 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if (t_3 - math.sqrt(y)) <= 0.9998: tmp = (((t_4 + t_2) / t_2) / t_4) + ((t_5 - math.sqrt(z)) + t_6) else: tmp = ((1.0 + (t_1 + (y * 0.5))) - (math.sqrt(y) + math.sqrt(x))) + (t_6 + (1.0 / (t_5 + 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 + x)) t_2 = Float64(sqrt(x) + t_1) t_3 = sqrt(Float64(y + 1.0)) t_4 = Float64(sqrt(y) + t_3) t_5 = sqrt(Float64(1.0 + z)) t_6 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (Float64(t_3 - sqrt(y)) <= 0.9998) tmp = Float64(Float64(Float64(Float64(t_4 + t_2) / t_2) / t_4) + Float64(Float64(t_5 - sqrt(z)) + t_6)); else tmp = Float64(Float64(Float64(1.0 + Float64(t_1 + Float64(y * 0.5))) - Float64(sqrt(y) + sqrt(x))) + Float64(t_6 + Float64(1.0 / Float64(t_5 + 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 + x));
t_2 = sqrt(x) + t_1;
t_3 = sqrt((y + 1.0));
t_4 = sqrt(y) + t_3;
t_5 = sqrt((1.0 + z));
t_6 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if ((t_3 - sqrt(y)) <= 0.9998)
tmp = (((t_4 + t_2) / t_2) / t_4) + ((t_5 - sqrt(z)) + t_6);
else
tmp = ((1.0 + (t_1 + (y * 0.5))) - (sqrt(y) + sqrt(x))) + (t_6 + (1.0 / (t_5 + 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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 0.9998], N[(N[(N[(N[(t$95$4 + t$95$2), $MachinePrecision] / t$95$2), $MachinePrecision] / t$95$4), $MachinePrecision] + N[(N[(t$95$5 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(t$95$1 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 + N[(1.0 / N[(t$95$5 + N[Sqrt[z], $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 + x}\\
t_2 := \sqrt{x} + t\_1\\
t_3 := \sqrt{y + 1}\\
t_4 := \sqrt{y} + t\_3\\
t_5 := \sqrt{1 + z}\\
t_6 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_3 - \sqrt{y} \leq 0.9998:\\
\;\;\;\;\frac{\frac{t\_4 + t\_2}{t\_2}}{t\_4} + \left(\left(t\_5 - \sqrt{z}\right) + t\_6\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \left(t\_1 + y \cdot 0.5\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(t\_6 + \frac{1}{t\_5 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.99980000000000002Initial program 92.4%
associate-+l+92.4%
sub-neg92.4%
sub-neg92.4%
+-commutative92.4%
+-commutative92.4%
+-commutative92.4%
Simplified92.4%
+-commutative92.4%
flip--92.4%
flip--92.3%
frac-add92.3%
Applied egg-rr94.3%
*-commutative94.3%
*-commutative94.3%
+-commutative94.3%
*-commutative94.3%
associate-/r*94.3%
Simplified96.4%
if 0.99980000000000002 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
flip--97.9%
div-inv97.9%
add-sqr-sqrt78.9%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in y around 0 67.3%
Final simplification81.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_3 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_4 (sqrt (+ 1.0 x))))
(if (<= t_3 0.9998)
(+ (+ (- t_1 (sqrt z)) t_2) (+ (/ 1.0 (+ (sqrt x) t_4)) t_3))
(+
(- (+ 1.0 (+ t_4 (* y 0.5))) (+ (sqrt y) (sqrt x)))
(+ t_2 (/ 1.0 (+ t_1 (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 + z));
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double t_3 = sqrt((y + 1.0)) - sqrt(y);
double t_4 = sqrt((1.0 + x));
double tmp;
if (t_3 <= 0.9998) {
tmp = ((t_1 - sqrt(z)) + t_2) + ((1.0 / (sqrt(x) + t_4)) + t_3);
} else {
tmp = ((1.0 + (t_4 + (y * 0.5))) - (sqrt(y) + sqrt(x))) + (t_2 + (1.0 / (t_1 + 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
t_3 = sqrt((y + 1.0d0)) - sqrt(y)
t_4 = sqrt((1.0d0 + x))
if (t_3 <= 0.9998d0) then
tmp = ((t_1 - sqrt(z)) + t_2) + ((1.0d0 / (sqrt(x) + t_4)) + t_3)
else
tmp = ((1.0d0 + (t_4 + (y * 0.5d0))) - (sqrt(y) + sqrt(x))) + (t_2 + (1.0d0 / (t_1 + 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 + z));
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_3 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_4 = Math.sqrt((1.0 + x));
double tmp;
if (t_3 <= 0.9998) {
tmp = ((t_1 - Math.sqrt(z)) + t_2) + ((1.0 / (Math.sqrt(x) + t_4)) + t_3);
} else {
tmp = ((1.0 + (t_4 + (y * 0.5))) - (Math.sqrt(y) + Math.sqrt(x))) + (t_2 + (1.0 / (t_1 + 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 + z)) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) t_3 = math.sqrt((y + 1.0)) - math.sqrt(y) t_4 = math.sqrt((1.0 + x)) tmp = 0 if t_3 <= 0.9998: tmp = ((t_1 - math.sqrt(z)) + t_2) + ((1.0 / (math.sqrt(x) + t_4)) + t_3) else: tmp = ((1.0 + (t_4 + (y * 0.5))) - (math.sqrt(y) + math.sqrt(x))) + (t_2 + (1.0 / (t_1 + 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 + z)) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_3 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_4 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t_3 <= 0.9998) tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + t_2) + Float64(Float64(1.0 / Float64(sqrt(x) + t_4)) + t_3)); else tmp = Float64(Float64(Float64(1.0 + Float64(t_4 + Float64(y * 0.5))) - Float64(sqrt(y) + sqrt(x))) + Float64(t_2 + Float64(1.0 / Float64(t_1 + 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 + z));
t_2 = sqrt((1.0 + t)) - sqrt(t);
t_3 = sqrt((y + 1.0)) - sqrt(y);
t_4 = sqrt((1.0 + x));
tmp = 0.0;
if (t_3 <= 0.9998)
tmp = ((t_1 - sqrt(z)) + t_2) + ((1.0 / (sqrt(x) + t_4)) + t_3);
else
tmp = ((1.0 + (t_4 + (y * 0.5))) - (sqrt(y) + sqrt(x))) + (t_2 + (1.0 / (t_1 + 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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.9998], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(t$95$4 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $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 + z}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
t_3 := \sqrt{y + 1} - \sqrt{y}\\
t_4 := \sqrt{1 + x}\\
\mathbf{if}\;t\_3 \leq 0.9998:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{z}\right) + t\_2\right) + \left(\frac{1}{\sqrt{x} + t\_4} + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \left(t\_4 + y \cdot 0.5\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(t\_2 + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.99980000000000002Initial program 92.4%
associate-+l+92.4%
sub-neg92.4%
sub-neg92.4%
+-commutative92.4%
+-commutative92.4%
+-commutative92.4%
Simplified92.4%
flip--92.3%
div-inv92.3%
add-sqr-sqrt73.6%
+-commutative73.6%
add-sqr-sqrt94.3%
+-commutative94.3%
Applied egg-rr94.3%
associate-*r/94.3%
*-rgt-identity94.3%
associate--l+95.4%
+-inverses95.4%
metadata-eval95.4%
+-commutative95.4%
Simplified95.4%
if 0.99980000000000002 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
flip--97.9%
div-inv97.9%
add-sqr-sqrt78.9%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in y around 0 67.3%
Final simplification80.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))))
(if (<= (- t_1 (sqrt y)) 0.0)
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(- (+ 1.0 t_1) (+ (sqrt y) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if ((t_1 - sqrt(y)) <= 0.0) {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
} else {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 + t_1) - (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) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if ((t_1 - sqrt(y)) <= 0.0d0) then
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
else
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))) + ((1.0d0 + t_1) - (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 t_1 = Math.sqrt((y + 1.0));
double tmp;
if ((t_1 - Math.sqrt(y)) <= 0.0) {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
} else {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + ((1.0 + t_1) - (Math.sqrt(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((y + 1.0)) tmp = 0 if (t_1 - math.sqrt(y)) <= 0.0: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) else: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + ((1.0 + t_1) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (Float64(t_1 - sqrt(y)) <= 0.0) tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + Float64(Float64(1.0 + t_1) - Float64(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)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if ((t_1 - sqrt(y)) <= 0.0)
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
else
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 + t_1) - (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_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 0.0], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$1), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + 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 := \sqrt{y + 1}\\
\mathbf{if}\;t\_1 - \sqrt{y} \leq 0:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\left(1 + t\_1\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.0Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 3.4%
associate--l+26.1%
+-commutative26.1%
Simplified26.1%
Taylor expanded in x around inf 28.7%
neg-mul-128.7%
Simplified28.7%
unsub-neg28.7%
+-commutative28.7%
flip--28.6%
add-sqr-sqrt29.5%
+-commutative29.5%
add-sqr-sqrt29.6%
+-commutative29.6%
Applied egg-rr29.6%
associate--l+31.9%
+-inverses31.9%
metadata-eval31.9%
+-commutative31.9%
Simplified31.9%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
flip--97.9%
div-inv97.9%
add-sqr-sqrt76.7%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 56.4%
Final simplification45.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 7.5e+22)
(+
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.5e+22) {
tmp = (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 7.5d+22) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.5e+22) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 7.5e+22: tmp = (1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x)))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 7.5e+22) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 7.5e+22)
tmp = (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 7.5e+22], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{+22}:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 7.5000000000000002e22Initial program 97.3%
associate-+l+97.3%
sub-neg97.3%
sub-neg97.3%
+-commutative97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in x around 0 55.4%
associate--l+55.4%
+-commutative55.4%
Simplified55.4%
flip--55.4%
div-inv55.4%
add-sqr-sqrt42.8%
add-sqr-sqrt55.4%
Applied egg-rr55.4%
associate-*r/55.4%
*-rgt-identity55.4%
associate--l+55.4%
+-inverses55.4%
metadata-eval55.4%
+-commutative55.4%
Simplified55.4%
if 7.5000000000000002e22 < y Initial program 92.7%
associate-+l+92.7%
sub-neg92.7%
sub-neg92.7%
+-commutative92.7%
+-commutative92.7%
+-commutative92.7%
Simplified92.7%
Taylor expanded in t around inf 3.3%
associate--l+26.5%
+-commutative26.5%
Simplified26.5%
Taylor expanded in x around inf 29.2%
neg-mul-129.2%
Simplified29.2%
unsub-neg29.2%
+-commutative29.2%
flip--29.1%
add-sqr-sqrt30.0%
+-commutative30.0%
add-sqr-sqrt30.2%
+-commutative30.2%
Applied egg-rr30.2%
associate--l+32.5%
+-inverses32.5%
metadata-eval32.5%
+-commutative32.5%
Simplified32.5%
Final simplification45.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 1.45e+26)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45e+26) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.45d+26) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45e+26) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.45e+26: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.45e+26) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.45e+26)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.45e+26], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45 \cdot 10^{+26}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.45e26Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 54.6%
if 1.45e26 < y Initial program 92.9%
associate-+l+92.9%
sub-neg92.9%
sub-neg92.9%
+-commutative92.9%
+-commutative92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in t around inf 3.3%
associate--l+26.9%
+-commutative26.9%
Simplified26.9%
Taylor expanded in x around inf 29.7%
neg-mul-129.7%
Simplified29.7%
unsub-neg29.7%
+-commutative29.7%
flip--29.6%
add-sqr-sqrt30.5%
+-commutative30.5%
add-sqr-sqrt30.7%
+-commutative30.7%
Applied egg-rr30.7%
associate--l+32.9%
+-inverses32.9%
metadata-eval32.9%
+-commutative32.9%
Simplified32.9%
Final simplification45.1%
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.45e+26)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x)))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45e+26) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x))));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.45d+26) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x))))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45e+26) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x))));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.45e+26: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x)))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.45e+26) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x))))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.45e+26)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x))));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.45e+26], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45 \cdot 10^{+26}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.45e26Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 54.6%
associate--l+54.6%
+-commutative54.6%
Simplified54.6%
if 1.45e26 < y Initial program 92.9%
associate-+l+92.9%
sub-neg92.9%
sub-neg92.9%
+-commutative92.9%
+-commutative92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in t around inf 3.3%
associate--l+26.9%
+-commutative26.9%
Simplified26.9%
Taylor expanded in x around inf 29.7%
neg-mul-129.7%
Simplified29.7%
unsub-neg29.7%
+-commutative29.7%
flip--29.6%
add-sqr-sqrt30.5%
+-commutative30.5%
add-sqr-sqrt30.7%
+-commutative30.7%
Applied egg-rr30.7%
associate--l+32.9%
+-inverses32.9%
metadata-eval32.9%
+-commutative32.9%
Simplified32.9%
Final simplification45.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt y) (sqrt x)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (sqrt (+ 1.0 z))))
(if (<= z 1.3e-15)
(- (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) (+ t_2 2.0)) (+ (sqrt z) t_1))
(if (<= z 4.5e+29)
(+ (/ 1.0 (+ t_3 (sqrt z))) (+ 1.0 (- t_2 t_1)))
(+
(- t_3 (sqrt z))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (/ 1.0 (+ (sqrt y) t_2))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double t_2 = sqrt((y + 1.0));
double t_3 = sqrt((1.0 + z));
double tmp;
if (z <= 1.3e-15) {
tmp = ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_2 + 2.0)) - (sqrt(z) + t_1);
} else if (z <= 4.5e+29) {
tmp = (1.0 / (t_3 + sqrt(z))) + (1.0 + (t_2 - t_1));
} else {
tmp = (t_3 - sqrt(z)) + ((sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(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) :: t_3
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((y + 1.0d0))
t_3 = sqrt((1.0d0 + z))
if (z <= 1.3d-15) then
tmp = ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (t_2 + 2.0d0)) - (sqrt(z) + t_1)
else if (z <= 4.5d+29) then
tmp = (1.0d0 / (t_3 + sqrt(z))) + (1.0d0 + (t_2 - t_1))
else
tmp = (t_3 - sqrt(z)) + ((sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 / (sqrt(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(y) + Math.sqrt(x);
double t_2 = Math.sqrt((y + 1.0));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 1.3e-15) {
tmp = ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (t_2 + 2.0)) - (Math.sqrt(z) + t_1);
} else if (z <= 4.5e+29) {
tmp = (1.0 / (t_3 + Math.sqrt(z))) + (1.0 + (t_2 - t_1));
} else {
tmp = (t_3 - Math.sqrt(z)) + ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + t_2)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) t_2 = math.sqrt((y + 1.0)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if z <= 1.3e-15: tmp = ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (t_2 + 2.0)) - (math.sqrt(z) + t_1) elif z <= 4.5e+29: tmp = (1.0 / (t_3 + math.sqrt(z))) + (1.0 + (t_2 - t_1)) else: tmp = (t_3 - math.sqrt(z)) + ((math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = sqrt(Float64(y + 1.0)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 1.3e-15) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(t_2 + 2.0)) - Float64(sqrt(z) + t_1)); elseif (z <= 4.5e+29) tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + Float64(1.0 + Float64(t_2 - t_1))); else tmp = Float64(Float64(t_3 - sqrt(z)) + Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(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(y) + sqrt(x);
t_2 = sqrt((y + 1.0));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 1.3e-15)
tmp = ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_2 + 2.0)) - (sqrt(z) + t_1);
elseif (z <= 4.5e+29)
tmp = (1.0 / (t_3 + sqrt(z))) + (1.0 + (t_2 - t_1));
else
tmp = (t_3 - sqrt(z)) + ((sqrt((1.0 + x)) - sqrt(x)) + (1.0 / (sqrt(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[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.3e-15], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + 2.0), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+29], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{y + 1}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 1.3 \cdot 10^{-15}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(t\_2 + 2\right)\right) - \left(\sqrt{z} + t\_1\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{1}{t\_3 + \sqrt{z}} + \left(1 + \left(t\_2 - t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 - \sqrt{z}\right) + \left(\left(\sqrt{1 + x} - \sqrt{x}\right) + \frac{1}{\sqrt{y} + t\_2}\right)\\
\end{array}
\end{array}
if z < 1.30000000000000002e-15Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 40.6%
associate--l+44.0%
+-commutative44.0%
Simplified44.0%
flip--44.0%
div-inv44.0%
add-sqr-sqrt34.2%
add-sqr-sqrt44.1%
Applied egg-rr44.1%
associate-*r/44.1%
*-rgt-identity44.1%
associate--l+44.4%
+-inverses44.4%
metadata-eval44.4%
+-commutative44.4%
Simplified44.4%
Taylor expanded in z around 0 27.9%
associate-+r+27.9%
+-commutative27.9%
associate-+r+27.9%
+-commutative27.9%
Simplified27.9%
if 1.30000000000000002e-15 < z < 4.5000000000000002e29Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in x around 0 46.9%
associate--l+52.1%
+-commutative52.1%
Simplified52.1%
Taylor expanded in t around inf 40.6%
flip--93.8%
div-inv93.8%
add-sqr-sqrt88.6%
add-sqr-sqrt95.2%
Applied egg-rr42.8%
associate-*r/95.2%
*-rgt-identity95.2%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified44.5%
if 4.5000000000000002e29 < z Initial program 94.0%
associate-+l+94.0%
sub-neg94.0%
sub-neg94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
Simplified94.0%
flip--94.1%
div-inv94.1%
add-sqr-sqrt72.8%
add-sqr-sqrt94.1%
Applied egg-rr94.1%
associate-*r/94.1%
*-rgt-identity94.1%
associate--l+94.4%
+-inverses94.4%
metadata-eval94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in t around inf 55.6%
Final simplification40.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 4.2e-87)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 6.4e+43)
(+ t_2 (+ (- t_1 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 4.2e-87) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 6.4e+43) {
tmp = t_2 + ((t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0)))));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 4.2d-87) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 6.4d+43) then
tmp = t_2 + ((t_1 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 4.2e-87) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 6.4e+43) {
tmp = t_2 + ((t_1 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 4.2e-87: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 6.4e+43: tmp = t_2 + ((t_1 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 4.2e-87) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 6.4e+43) tmp = Float64(t_2 + Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 4.2e-87)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 6.4e+43)
tmp = t_2 + ((t_1 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0)))));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.2e-87], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+43], N[(t$95$2 + N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 4.2 \cdot 10^{-87}:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+43}:\\
\;\;\;\;t\_2 + \left(\left(t\_1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.20000000000000014e-87Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 55.6%
associate--l+55.6%
+-commutative55.6%
Simplified55.6%
Taylor expanded in y around 0 55.6%
associate--r+55.6%
Simplified55.6%
if 4.20000000000000014e-87 < y < 6.40000000000000029e43Initial program 95.5%
associate-+l+95.5%
sub-neg95.5%
sub-neg95.5%
+-commutative95.5%
+-commutative95.5%
+-commutative95.5%
Simplified95.5%
flip--95.5%
div-inv95.5%
add-sqr-sqrt85.0%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
associate-*r/95.6%
*-rgt-identity95.6%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in t around inf 47.6%
if 6.40000000000000029e43 < y Initial program 92.8%
associate-+l+92.8%
sub-neg92.8%
sub-neg92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in t around inf 3.1%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around inf 30.0%
neg-mul-130.0%
Simplified30.0%
unsub-neg30.0%
+-commutative30.0%
flip--29.9%
add-sqr-sqrt30.9%
+-commutative30.9%
add-sqr-sqrt31.1%
+-commutative31.1%
Applied egg-rr31.1%
associate--l+33.4%
+-inverses33.4%
metadata-eval33.4%
+-commutative33.4%
Simplified33.4%
Final simplification45.0%
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))))
(if (<= y 5.3e-17)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 5e+42)
(- (+ t_1 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))) (sqrt x))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 5.3e-17) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 5e+42) {
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 5.3d-17) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 5d+42) then
tmp = (t_1 + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0))))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 5.3e-17) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 5e+42) {
tmp = (t_1 + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 5.3e-17: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 5e+42: tmp = (t_1 + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 5.3e-17) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 5e+42) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 5.3e-17)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 5e+42)
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.3e-17], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+42], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 5.3 \cdot 10^{-17}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+42}:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 5.2999999999999998e-17Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 55.4%
associate--l+55.4%
+-commutative55.4%
Simplified55.4%
Taylor expanded in y around 0 55.4%
associate--r+55.4%
Simplified55.4%
if 5.2999999999999998e-17 < y < 5.00000000000000007e42Initial program 91.2%
associate-+l+91.3%
sub-neg91.3%
sub-neg91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
flip--91.3%
div-inv91.3%
add-sqr-sqrt68.3%
add-sqr-sqrt91.5%
Applied egg-rr91.5%
associate-*r/91.5%
*-rgt-identity91.5%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 45.4%
Taylor expanded in z around inf 23.0%
if 5.00000000000000007e42 < y Initial program 92.8%
associate-+l+92.8%
sub-neg92.8%
sub-neg92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in t around inf 3.1%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around inf 30.0%
neg-mul-130.0%
Simplified30.0%
unsub-neg30.0%
+-commutative30.0%
flip--29.9%
add-sqr-sqrt30.9%
+-commutative30.9%
add-sqr-sqrt31.1%
+-commutative31.1%
Applied egg-rr31.1%
associate--l+33.4%
+-inverses33.4%
metadata-eval33.4%
+-commutative33.4%
Simplified33.4%
Final simplification43.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 (+ y 1.0))))
(if (<= z 1.02e-16)
(+
(- (- 2.0 (sqrt x)) (sqrt y))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- 1.0 (sqrt z))))
(if (<= z 1.06e+29)
(+
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))
(+ 1.0 (- t_1 (+ (sqrt y) (sqrt x)))))
(- (+ (sqrt (+ 1.0 x)) (/ 1.0 (+ (sqrt y) t_1))) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 1.02e-16) {
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
} else if (z <= 1.06e+29) {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 + (t_1 - (sqrt(y) + sqrt(x))));
} else {
tmp = (sqrt((1.0 + x)) + (1.0 / (sqrt(y) + t_1))) - 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 = sqrt((y + 1.0d0))
if (z <= 1.02d-16) then
tmp = ((2.0d0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 - sqrt(z)))
else if (z <= 1.06d+29) then
tmp = (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (1.0d0 + (t_1 - (sqrt(y) + sqrt(x))))
else
tmp = (sqrt((1.0d0 + x)) + (1.0d0 / (sqrt(y) + t_1))) - 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((y + 1.0));
double tmp;
if (z <= 1.02e-16) {
tmp = ((2.0 - Math.sqrt(x)) - Math.sqrt(y)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 - Math.sqrt(z)));
} else if (z <= 1.06e+29) {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (1.0 + (t_1 - (Math.sqrt(y) + Math.sqrt(x))));
} else {
tmp = (Math.sqrt((1.0 + x)) + (1.0 / (Math.sqrt(y) + t_1))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 1.02e-16: tmp = ((2.0 - math.sqrt(x)) - math.sqrt(y)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 - math.sqrt(z))) elif z <= 1.06e+29: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (1.0 + (t_1 - (math.sqrt(y) + math.sqrt(x)))) else: tmp = (math.sqrt((1.0 + x)) + (1.0 / (math.sqrt(y) + t_1))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 1.02e-16) tmp = Float64(Float64(Float64(2.0 - sqrt(x)) - sqrt(y)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 - sqrt(z)))); elseif (z <= 1.06e+29) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(1.0 + Float64(t_1 - Float64(sqrt(y) + sqrt(x))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) + Float64(1.0 / Float64(sqrt(y) + t_1))) - 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((y + 1.0));
tmp = 0.0;
if (z <= 1.02e-16)
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
elseif (z <= 1.06e+29)
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 + (t_1 - (sqrt(y) + sqrt(x))));
else
tmp = (sqrt((1.0 + x)) + (1.0 / (sqrt(y) + t_1))) - 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[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.02e-16], N[(N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.06e+29], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $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{y + 1}\\
\mathbf{if}\;z \leq 1.02 \cdot 10^{-16}:\\
\;\;\;\;\left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 - \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{+29}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(1 + \left(t\_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} + \frac{1}{\sqrt{y} + t\_1}\right) - \sqrt{x}\\
\end{array}
\end{array}
if z < 1.0200000000000001e-16Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 40.6%
associate--l+44.0%
+-commutative44.0%
Simplified44.0%
Taylor expanded in y around 0 26.8%
associate--r+26.8%
Simplified26.8%
Taylor expanded in z around 0 26.8%
if 1.0200000000000001e-16 < z < 1.0600000000000001e29Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in x around 0 46.9%
associate--l+52.1%
+-commutative52.1%
Simplified52.1%
Taylor expanded in t around inf 40.6%
flip--93.8%
div-inv93.8%
add-sqr-sqrt88.6%
add-sqr-sqrt95.2%
Applied egg-rr42.8%
associate-*r/95.2%
*-rgt-identity95.2%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified44.5%
if 1.0600000000000001e29 < z Initial program 94.0%
associate-+l+94.0%
sub-neg94.0%
sub-neg94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
Simplified94.0%
flip--94.1%
div-inv94.1%
add-sqr-sqrt72.8%
add-sqr-sqrt94.1%
Applied egg-rr94.1%
associate-*r/94.1%
*-rgt-identity94.1%
associate--l+94.4%
+-inverses94.4%
metadata-eval94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in t around inf 55.6%
Taylor expanded in z around inf 47.1%
Final simplification36.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 (<= z 0.31)
(+
(- (- 2.0 (sqrt x)) (sqrt y))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- 1.0 (sqrt z))))
(if (<= z 3.4e+28)
(+ (- (+ (* y 0.5) 2.0) (+ (sqrt y) (sqrt x))) (* 0.5 (sqrt (/ 1.0 z))))
(- (+ (sqrt (+ 1.0 x)) (/ 1.0 (+ (sqrt y) (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 (z <= 0.31) {
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
} else if (z <= 3.4e+28) {
tmp = (((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = (sqrt((1.0 + x)) + (1.0 / (sqrt(y) + sqrt((y + 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 (z <= 0.31d0) then
tmp = ((2.0d0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 - sqrt(z)))
else if (z <= 3.4d+28) then
tmp = (((y * 0.5d0) + 2.0d0) - (sqrt(y) + sqrt(x))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = (sqrt((1.0d0 + x)) + (1.0d0 / (sqrt(y) + sqrt((y + 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 (z <= 0.31) {
tmp = ((2.0 - Math.sqrt(x)) - Math.sqrt(y)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 - Math.sqrt(z)));
} else if (z <= 3.4e+28) {
tmp = (((y * 0.5) + 2.0) - (Math.sqrt(y) + Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = (Math.sqrt((1.0 + x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 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 z <= 0.31: tmp = ((2.0 - math.sqrt(x)) - math.sqrt(y)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 - math.sqrt(z))) elif z <= 3.4e+28: tmp = (((y * 0.5) + 2.0) - (math.sqrt(y) + math.sqrt(x))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = (math.sqrt((1.0 + x)) + (1.0 / (math.sqrt(y) + math.sqrt((y + 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 (z <= 0.31) tmp = Float64(Float64(Float64(2.0 - sqrt(x)) - sqrt(y)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 - sqrt(z)))); elseif (z <= 3.4e+28) tmp = Float64(Float64(Float64(Float64(y * 0.5) + 2.0) - Float64(sqrt(y) + sqrt(x))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 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 (z <= 0.31)
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
elseif (z <= 3.4e+28)
tmp = (((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x))) + (0.5 * sqrt((1.0 / z)));
else
tmp = (sqrt((1.0 + x)) + (1.0 / (sqrt(y) + sqrt((y + 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[z, 0.31], N[(N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+28], N[(N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $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}
\mathbf{if}\;z \leq 0.31:\\
\;\;\;\;\left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 - \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+28}:\\
\;\;\;\;\left(\left(y \cdot 0.5 + 2\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) - \sqrt{x}\\
\end{array}
\end{array}
if z < 0.309999999999999998Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 40.6%
associate--l+43.8%
+-commutative43.8%
Simplified43.8%
Taylor expanded in y around 0 25.7%
associate--r+25.7%
Simplified25.7%
Taylor expanded in z around 0 25.7%
if 0.309999999999999998 < z < 3.4e28Initial program 86.0%
associate-+l+86.0%
sub-neg86.0%
sub-neg86.0%
+-commutative86.0%
+-commutative86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in x around 0 52.5%
associate--l+62.6%
+-commutative62.6%
Simplified62.6%
Taylor expanded in t around inf 41.1%
Taylor expanded in z around inf 46.9%
Taylor expanded in y around 0 45.2%
if 3.4e28 < z Initial program 94.0%
associate-+l+94.0%
sub-neg94.0%
sub-neg94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
Simplified94.0%
flip--94.1%
div-inv94.1%
add-sqr-sqrt72.8%
add-sqr-sqrt94.1%
Applied egg-rr94.1%
associate-*r/94.1%
*-rgt-identity94.1%
associate--l+94.4%
+-inverses94.4%
metadata-eval94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in t around inf 55.6%
Taylor expanded in z around inf 47.1%
Final simplification35.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 y) (sqrt x))))
(if (<= t 45000000.0)
(- (+ (sqrt (+ 1.0 t)) 3.0) (+ (sqrt t) (+ (sqrt z) t_1)))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ 1.0 (- (sqrt (+ y 1.0)) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double tmp;
if (t <= 45000000.0) {
tmp = (sqrt((1.0 + t)) + 3.0) - (sqrt(t) + (sqrt(z) + t_1));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (sqrt((y + 1.0)) - t_1));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
if (t <= 45000000.0d0) then
tmp = (sqrt((1.0d0 + t)) + 3.0d0) - (sqrt(t) + (sqrt(z) + t_1))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 + (sqrt((y + 1.0d0)) - t_1))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double tmp;
if (t <= 45000000.0) {
tmp = (Math.sqrt((1.0 + t)) + 3.0) - (Math.sqrt(t) + (Math.sqrt(z) + t_1));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 + (Math.sqrt((y + 1.0)) - t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) tmp = 0 if t <= 45000000.0: tmp = (math.sqrt((1.0 + t)) + 3.0) - (math.sqrt(t) + (math.sqrt(z) + t_1)) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 + (math.sqrt((y + 1.0)) - t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) tmp = 0.0 if (t <= 45000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) + 3.0) - Float64(sqrt(t) + Float64(sqrt(z) + t_1))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - t_1))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
tmp = 0.0;
if (t <= 45000000.0)
tmp = (sqrt((1.0 + t)) + 3.0) - (sqrt(t) + (sqrt(z) + t_1));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (sqrt((y + 1.0)) - t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 45000000.0], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + 3.0), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
\mathbf{if}\;t \leq 45000000:\\
\;\;\;\;\left(\sqrt{1 + t} + 3\right) - \left(\sqrt{t} + \left(\sqrt{z} + t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \left(\sqrt{y + 1} - t\_1\right)\right)\\
\end{array}
\end{array}
if t < 4.5e7Initial program 97.3%
associate-+l+97.3%
sub-neg97.3%
sub-neg97.3%
+-commutative97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in x around 0 47.6%
associate--l+49.6%
+-commutative49.6%
Simplified49.6%
Taylor expanded in y around 0 31.3%
associate--r+31.3%
Simplified31.3%
Taylor expanded in z around 0 17.5%
associate-+r+17.5%
+-commutative17.5%
Simplified17.5%
if 4.5e7 < t Initial program 93.1%
associate-+l+93.1%
sub-neg93.1%
sub-neg93.1%
+-commutative93.1%
+-commutative93.1%
+-commutative93.1%
Simplified93.1%
Taylor expanded in x around 0 36.7%
associate--l+55.7%
+-commutative55.7%
Simplified55.7%
Taylor expanded in t around inf 55.5%
Final simplification36.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 4.7e-8)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ 2.0 (- (* y 0.5) (+ (sqrt y) (sqrt x)))))
(if (<= y 4e+43)
(- (+ t_1 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))) (sqrt x))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 4.7e-8) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 + ((y * 0.5) - (sqrt(y) + sqrt(x))));
} else if (y <= 4e+43) {
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 4.7d-8) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (2.0d0 + ((y * 0.5d0) - (sqrt(y) + sqrt(x))))
else if (y <= 4d+43) then
tmp = (t_1 + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0))))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.7e-8) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (2.0 + ((y * 0.5) - (Math.sqrt(y) + Math.sqrt(x))));
} else if (y <= 4e+43) {
tmp = (t_1 + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.7e-8: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (2.0 + ((y * 0.5) - (math.sqrt(y) + math.sqrt(x)))) elif y <= 4e+43: tmp = (t_1 + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.7e-8) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(y) + sqrt(x))))); elseif (y <= 4e+43) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 4.7e-8)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 + ((y * 0.5) - (sqrt(y) + sqrt(x))));
elseif (y <= 4e+43)
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.7e-8], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+43], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.7 \cdot 10^{-8}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+43}:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.6999999999999997e-8Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 55.5%
associate--l+55.5%
+-commutative55.5%
Simplified55.5%
Taylor expanded in t around inf 32.5%
Taylor expanded in y around 0 32.5%
associate--l+32.5%
*-commutative32.5%
Simplified32.5%
if 4.6999999999999997e-8 < y < 4.00000000000000006e43Initial program 89.8%
associate-+l+89.8%
sub-neg89.8%
sub-neg89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
flip--89.8%
div-inv89.8%
add-sqr-sqrt56.8%
add-sqr-sqrt90.1%
Applied egg-rr90.1%
associate-*r/90.1%
*-rgt-identity90.1%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in t around inf 33.7%
Taylor expanded in z around inf 16.6%
if 4.00000000000000006e43 < y Initial program 92.8%
associate-+l+92.8%
sub-neg92.8%
sub-neg92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in t around inf 3.1%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around inf 30.0%
neg-mul-130.0%
Simplified30.0%
unsub-neg30.0%
+-commutative30.0%
flip--29.9%
add-sqr-sqrt30.9%
+-commutative30.9%
add-sqr-sqrt31.1%
+-commutative31.1%
Applied egg-rr31.1%
associate--l+33.4%
+-inverses33.4%
metadata-eval33.4%
+-commutative33.4%
Simplified33.4%
Final simplification31.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 4.6e-17)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 1.8e+43)
(- (+ t_1 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))) (sqrt x))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 4.6e-17) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 1.8e+43) {
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 4.6d-17) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 1.8d+43) then
tmp = (t_1 + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0))))) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.6e-17) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 1.8e+43) {
tmp = (t_1 + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.6e-17: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 1.8e+43: tmp = (t_1 + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.6e-17) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 1.8e+43) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 4.6e-17)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 1.8e+43)
tmp = (t_1 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.6e-17], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+43], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.6 \cdot 10^{-17}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+43}:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.60000000000000018e-17Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 55.4%
associate--l+55.4%
+-commutative55.4%
Simplified55.4%
Taylor expanded in t around inf 32.3%
Taylor expanded in y around 0 32.4%
associate--r+55.4%
Simplified32.4%
if 4.60000000000000018e-17 < y < 1.80000000000000005e43Initial program 91.2%
associate-+l+91.3%
sub-neg91.3%
sub-neg91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
flip--91.3%
div-inv91.3%
add-sqr-sqrt68.3%
add-sqr-sqrt91.5%
Applied egg-rr91.5%
associate-*r/91.5%
*-rgt-identity91.5%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 45.4%
Taylor expanded in z around inf 23.0%
if 1.80000000000000005e43 < y Initial program 92.8%
associate-+l+92.8%
sub-neg92.8%
sub-neg92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in t around inf 3.1%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around inf 30.0%
neg-mul-130.0%
Simplified30.0%
unsub-neg30.0%
+-commutative30.0%
flip--29.9%
add-sqr-sqrt30.9%
+-commutative30.9%
add-sqr-sqrt31.1%
+-commutative31.1%
Applied egg-rr31.1%
associate--l+33.4%
+-inverses33.4%
metadata-eval33.4%
+-commutative33.4%
Simplified33.4%
Final simplification32.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 1.18e-17)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (- 2.0 (sqrt x)) (sqrt y)))
(if (<= y 1.7e+16)
(+ (* 0.5 (sqrt (/ 1.0 z))) (+ 1.0 (- (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.18e-17) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
} else if (y <= 1.7e+16) {
tmp = (0.5 * sqrt((1.0 / z))) + (1.0 + (sqrt((y + 1.0)) - sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.18d-17) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((2.0d0 - sqrt(x)) - sqrt(y))
else if (y <= 1.7d+16) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 + (sqrt((y + 1.0d0)) - sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.18e-17) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else if (y <= 1.7e+16) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + (1.0 + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.18e-17: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) elif y <= 1.7e+16: tmp = (0.5 * math.sqrt((1.0 / z))) + (1.0 + (math.sqrt((y + 1.0)) - math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.18e-17) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); elseif (y <= 1.7e+16) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.18e-17)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
elseif (y <= 1.7e+16)
tmp = (0.5 * sqrt((1.0 / z))) + (1.0 + (sqrt((y + 1.0)) - sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.18e-17], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+16], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $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[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.18 \cdot 10^{-17}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+16}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.18000000000000004e-17Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 55.4%
associate--l+55.4%
+-commutative55.4%
Simplified55.4%
Taylor expanded in t around inf 32.3%
Taylor expanded in y around 0 32.4%
associate--r+55.4%
Simplified32.4%
if 1.18000000000000004e-17 < y < 1.7e16Initial program 95.8%
associate-+l+95.9%
sub-neg95.9%
sub-neg95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in x around 0 63.5%
associate--l+63.5%
+-commutative63.5%
Simplified63.5%
Taylor expanded in t around inf 27.5%
Taylor expanded in z around inf 26.9%
Taylor expanded in y around inf 36.3%
if 1.7e16 < y Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 3.4%
associate--l+26.1%
+-commutative26.1%
Simplified26.1%
Taylor expanded in x around inf 28.7%
neg-mul-128.7%
Simplified28.7%
unsub-neg28.7%
+-commutative28.7%
flip--28.6%
add-sqr-sqrt29.5%
+-commutative29.5%
add-sqr-sqrt29.6%
+-commutative29.6%
Applied egg-rr29.6%
associate--l+31.9%
+-inverses31.9%
metadata-eval31.9%
+-commutative31.9%
Simplified31.9%
Final simplification32.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 (<= z 4200000.0) (- (+ (+ (sqrt (+ 1.0 z)) 2.0) (* 0.5 (sqrt (/ 1.0 t)))) (sqrt z)) (+ (* 0.5 (sqrt (/ 1.0 z))) (+ 1.0 (- (sqrt (+ y 1.0)) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4200000.0) {
tmp = ((sqrt((1.0 + z)) + 2.0) + (0.5 * sqrt((1.0 / t)))) - sqrt(z);
} else {
tmp = (0.5 * sqrt((1.0 / z))) + (1.0 + (sqrt((y + 1.0)) - 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 <= 4200000.0d0) then
tmp = ((sqrt((1.0d0 + z)) + 2.0d0) + (0.5d0 * sqrt((1.0d0 / t)))) - sqrt(z)
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + (1.0d0 + (sqrt((y + 1.0d0)) - 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 <= 4200000.0) {
tmp = ((Math.sqrt((1.0 + z)) + 2.0) + (0.5 * Math.sqrt((1.0 / t)))) - Math.sqrt(z);
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + (1.0 + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4200000.0: tmp = ((math.sqrt((1.0 + z)) + 2.0) + (0.5 * math.sqrt((1.0 / t)))) - math.sqrt(z) else: tmp = (0.5 * math.sqrt((1.0 / z))) + (1.0 + (math.sqrt((y + 1.0)) - 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 <= 4200000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - sqrt(z)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - 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 <= 4200000.0)
tmp = ((sqrt((1.0 + z)) + 2.0) + (0.5 * sqrt((1.0 / t)))) - sqrt(z);
else
tmp = (0.5 * sqrt((1.0 / z))) + (1.0 + (sqrt((y + 1.0)) - 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, 4200000.0], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $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 4200000:\\
\;\;\;\;\left(\left(\sqrt{1 + z} + 2\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 4.2e6Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 40.8%
associate--l+44.5%
+-commutative44.5%
Simplified44.5%
Taylor expanded in y around 0 26.1%
associate--r+26.1%
Simplified26.1%
Taylor expanded in t around inf 12.4%
associate-+r+12.4%
associate-+r+12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in z around inf 20.1%
if 4.2e6 < z Initial program 93.6%
associate-+l+93.6%
sub-neg93.6%
sub-neg93.6%
+-commutative93.6%
+-commutative93.6%
+-commutative93.6%
Simplified93.6%
Taylor expanded in x around 0 44.0%
associate--l+62.3%
+-commutative62.3%
Simplified62.3%
Taylor expanded in t around inf 47.8%
Taylor expanded in z around inf 48.2%
Taylor expanded in y around inf 63.1%
Final simplification39.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2e+16) (- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2e+16) {
tmp = (1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2d+16) then
tmp = (1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2e+16) {
tmp = (1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2e+16: tmp = (1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2e+16) tmp = Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2e+16)
tmp = (1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2e+16], N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $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 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2e16Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 56.0%
associate--l+56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in t around inf 32.0%
Taylor expanded in z around inf 23.7%
if 2e16 < y Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 3.4%
associate--l+26.1%
+-commutative26.1%
Simplified26.1%
Taylor expanded in x around inf 28.7%
neg-mul-128.7%
Simplified28.7%
unsub-neg28.7%
+-commutative28.7%
flip--28.6%
add-sqr-sqrt29.5%
+-commutative29.5%
add-sqr-sqrt29.6%
+-commutative29.6%
Applied egg-rr29.6%
associate--l+31.9%
+-inverses31.9%
metadata-eval31.9%
+-commutative31.9%
Simplified31.9%
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 (if (<= x 62000000.0) (- (sqrt (+ 1.0 x)) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 62000000.0) {
tmp = sqrt((1.0 + x)) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 62000000.0d0) then
tmp = sqrt((1.0d0 + x)) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 62000000.0) {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 62000000.0: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 62000000.0) tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 62000000.0)
tmp = sqrt((1.0 + x)) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 62000000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 62000000:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 6.2e7Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in t around inf 17.5%
associate--l+39.6%
+-commutative39.6%
Simplified39.6%
Taylor expanded in x around inf 32.4%
neg-mul-132.4%
Simplified32.4%
if 6.2e7 < x Initial program 91.5%
associate-+l+91.5%
sub-neg91.5%
sub-neg91.5%
+-commutative91.5%
+-commutative91.5%
+-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 4.7%
associate--l+6.2%
+-commutative6.2%
Simplified6.2%
Taylor expanded in x around inf 3.7%
neg-mul-13.7%
Simplified3.7%
Taylor expanded in x around inf 8.3%
Final simplification21.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 x) (sqrt (+ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 / (sqrt(x) + sqrt((1.0 + 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) + sqrt((1.0d0 + 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) + Math.sqrt((1.0 + x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}}
\end{array}
Initial program 95.2%
associate-+l+95.2%
sub-neg95.2%
sub-neg95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in t around inf 11.8%
associate--l+24.6%
+-commutative24.6%
Simplified24.6%
Taylor expanded in x around inf 19.5%
neg-mul-119.5%
Simplified19.5%
unsub-neg19.5%
+-commutative19.5%
flip--19.5%
add-sqr-sqrt20.0%
+-commutative20.0%
add-sqr-sqrt20.0%
+-commutative20.0%
Applied egg-rr20.0%
associate--l+21.7%
+-inverses21.7%
metadata-eval21.7%
+-commutative21.7%
Simplified21.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 (<= x 4.5) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 4.5) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 4.5d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 4.5) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 4.5: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 4.5) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 4.5)
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 4.5], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 4.5Initial program 98.7%
associate-+l+98.7%
sub-neg98.7%
sub-neg98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in t around inf 17.1%
associate--l+39.7%
+-commutative39.7%
Simplified39.7%
Taylor expanded in x around inf 32.7%
neg-mul-132.7%
Simplified32.7%
Taylor expanded in x around 0 32.1%
if 4.5 < x Initial program 91.3%
associate-+l+91.3%
sub-neg91.3%
sub-neg91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
Taylor expanded in t around inf 5.7%
associate--l+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in x around inf 4.4%
neg-mul-14.4%
Simplified4.4%
Taylor expanded in x around inf 8.8%
Final simplification21.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.9) (- (+ 1.0 (* x (+ 0.5 (* x -0.125)))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.9) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.9d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * (-0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.9) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.9: tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.9) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * -0.125)))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.9)
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.9], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.9:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot -0.125\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.900000000000000022Initial program 98.7%
associate-+l+98.7%
sub-neg98.7%
sub-neg98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in t around inf 17.1%
associate--l+39.7%
+-commutative39.7%
Simplified39.7%
Taylor expanded in x around inf 32.7%
neg-mul-132.7%
Simplified32.7%
Taylor expanded in x around 0 32.0%
if 0.900000000000000022 < x Initial program 91.3%
associate-+l+91.3%
sub-neg91.3%
sub-neg91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
Taylor expanded in t around inf 5.7%
associate--l+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in x around inf 4.4%
neg-mul-14.4%
Simplified4.4%
Taylor expanded in x around inf 8.8%
Final simplification21.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 9.0) (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 9.0) {
tmp = 1.0 + ((x * 0.5) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 9.0d0) then
tmp = 1.0d0 + ((x * 0.5d0) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 9.0) {
tmp = 1.0 + ((x * 0.5) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 9.0: tmp = 1.0 + ((x * 0.5) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 9.0) tmp = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 9.0)
tmp = 1.0 + ((x * 0.5) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 9.0], N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 9Initial program 98.7%
associate-+l+98.7%
sub-neg98.7%
sub-neg98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in t around inf 17.1%
associate--l+39.7%
+-commutative39.7%
Simplified39.7%
Taylor expanded in x around inf 32.7%
neg-mul-132.7%
Simplified32.7%
Taylor expanded in x around 0 31.6%
associate--l+31.6%
Simplified31.6%
if 9 < x Initial program 91.3%
associate-+l+91.3%
sub-neg91.3%
sub-neg91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
Taylor expanded in t around inf 5.7%
associate--l+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in x around inf 4.4%
neg-mul-14.4%
Simplified4.4%
Taylor expanded in x around inf 8.8%
Final simplification21.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.25) (- 1.0 (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.25) {
tmp = 1.0 - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.25d0) then
tmp = 1.0d0 - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.25) {
tmp = 1.0 - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.25: tmp = 1.0 - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.25) tmp = Float64(1.0 - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.25)
tmp = 1.0 - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.25], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.25:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.25Initial program 98.7%
associate-+l+98.7%
sub-neg98.7%
sub-neg98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in t around inf 17.1%
associate--l+39.7%
+-commutative39.7%
Simplified39.7%
Taylor expanded in x around inf 32.7%
neg-mul-132.7%
Simplified32.7%
Taylor expanded in x around 0 30.9%
if 0.25 < x Initial program 91.3%
associate-+l+91.3%
sub-neg91.3%
sub-neg91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
Taylor expanded in t around inf 5.7%
associate--l+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in x around inf 4.4%
neg-mul-14.4%
Simplified4.4%
Taylor expanded in x around inf 8.8%
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 95.2%
associate-+l+95.2%
sub-neg95.2%
sub-neg95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in t around inf 11.8%
associate--l+24.6%
+-commutative24.6%
Simplified24.6%
Taylor expanded in x around inf 19.5%
neg-mul-119.5%
Simplified19.5%
Taylor expanded in x around 0 17.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -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 = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -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[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 95.2%
associate-+l+95.2%
sub-neg95.2%
sub-neg95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in x around 0 42.3%
associate--l+52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in y around 0 30.0%
associate--r+30.0%
Simplified30.0%
Taylor expanded in t around inf 9.0%
associate-+r+9.0%
associate-+r+9.0%
+-commutative9.0%
Simplified9.0%
Taylor expanded in x around inf 1.6%
mul-1-neg1.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024135
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (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))))