
(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 20 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 (+ y 1.0)) (sqrt y)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_1 1e-6)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(+ (- t_2 (sqrt z)) t_3))
(+ (+ (- 1.0 (sqrt x)) t_1) (+ t_3 (/ 1.0 (+ t_2 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_1 <= 1e-6) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((t_2 - sqrt(z)) + t_3);
} else {
tmp = ((1.0 - sqrt(x)) + t_1) + (t_3 + (1.0 / (t_2 + 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) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_1 <= 1d-6) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + ((t_2 - sqrt(z)) + t_3)
else
tmp = ((1.0d0 - sqrt(x)) + t_1) + (t_3 + (1.0d0 / (t_2 + 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((y + 1.0)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_1 <= 1e-6) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + ((t_2 - Math.sqrt(z)) + t_3);
} else {
tmp = ((1.0 - Math.sqrt(x)) + t_1) + (t_3 + (1.0 / (t_2 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_1 <= 1e-6: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + ((t_2 - math.sqrt(z)) + t_3) else: tmp = ((1.0 - math.sqrt(x)) + t_1) + (t_3 + (1.0 / (t_2 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_1 <= 1e-6) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + Float64(Float64(t_2 - sqrt(z)) + t_3)); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_1) + Float64(t_3 + Float64(1.0 / Float64(t_2 + 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((y + 1.0)) - sqrt(y);
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_1 <= 1e-6)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((t_2 - sqrt(z)) + t_3);
else
tmp = ((1.0 - sqrt(x)) + t_1) + (t_3 + (1.0 / (t_2 + 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[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-6], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(t$95$3 + N[(1.0 / N[(t$95$2 + 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{y + 1} - \sqrt{y}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 \leq 10^{-6}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(\left(t\_2 - \sqrt{z}\right) + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_1\right) + \left(t\_3 + \frac{1}{t\_2 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 9.99999999999999955e-7Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
flip--85.7%
flip--86.5%
frac-add86.5%
Applied egg-rr87.1%
+-commutative87.1%
*-commutative87.1%
*-commutative87.1%
fma-define87.1%
associate--l+90.3%
+-commutative90.3%
+-commutative90.3%
associate--l+90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in y around inf 94.1%
if 9.99999999999999955e-7 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial 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 49.8%
flip--49.8%
div-inv49.8%
add-sqr-sqrt39.4%
add-sqr-sqrt49.8%
Applied egg-rr49.8%
associate-*r/49.8%
*-rgt-identity49.8%
associate--l+49.9%
+-inverses49.9%
metadata-eval49.9%
Simplified49.9%
Final simplification72.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (- (sqrt (+ 1.0 x)) (sqrt x)) 0.005)
(+
(+ (- t_1 (sqrt z)) t_2)
(+ (* 0.5 (sqrt (/ 1.0 y))) (* 0.5 (sqrt (/ 1.0 x)))))
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
(+ 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 tmp;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 0.005) {
tmp = ((t_1 - sqrt(z)) + t_2) + ((0.5 * sqrt((1.0 / y))) + (0.5 * sqrt((1.0 / x))));
} else {
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (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) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
if ((sqrt((1.0d0 + x)) - sqrt(x)) <= 0.005d0) then
tmp = ((t_1 - sqrt(z)) + t_2) + ((0.5d0 * sqrt((1.0d0 / y))) + (0.5d0 * sqrt((1.0d0 / x))))
else
tmp = ((1.0d0 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (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 tmp;
if ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) <= 0.005) {
tmp = ((t_1 - Math.sqrt(z)) + t_2) + ((0.5 * Math.sqrt((1.0 / y))) + (0.5 * Math.sqrt((1.0 / x))));
} else {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (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) tmp = 0 if (math.sqrt((1.0 + x)) - math.sqrt(x)) <= 0.005: tmp = ((t_1 - math.sqrt(z)) + t_2) + ((0.5 * math.sqrt((1.0 / y))) + (0.5 * math.sqrt((1.0 / x)))) else: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (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)) tmp = 0.0 if (Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) <= 0.005) tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + t_2) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(0.5 * sqrt(Float64(1.0 / x))))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + 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);
tmp = 0.0;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 0.005)
tmp = ((t_1 - sqrt(z)) + t_2) + ((0.5 * sqrt((1.0 / y))) + (0.5 * sqrt((1.0 / x))));
else
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (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]}, If[LessEqual[N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.005], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $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}\\
\mathbf{if}\;\sqrt{1 + x} - \sqrt{x} \leq 0.005:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{z}\right) + t\_2\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(t\_2 + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.0050000000000000001Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
Taylor expanded in y around inf 44.7%
Taylor expanded in x around inf 49.2%
if 0.0050000000000000001 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 96.7%
flip--96.9%
div-inv96.9%
add-sqr-sqrt70.1%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate-*r/97.3%
*-rgt-identity97.3%
associate--l+97.3%
+-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Final simplification73.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 (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= x 3.3)
(+ t_1 (+ (- 1.0 (sqrt x)) (- (pow (+ y 1.0) 0.5) (sqrt y))))
(+ t_1 (+ (* 0.5 (sqrt (/ 1.0 y))) (* 0.5 (sqrt (/ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
double tmp;
if (x <= 3.3) {
tmp = t_1 + ((1.0 - sqrt(x)) + (pow((y + 1.0), 0.5) - sqrt(y)));
} else {
tmp = t_1 + ((0.5 * sqrt((1.0 / y))) + (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) :: t_1
real(8) :: tmp
t_1 = (sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))
if (x <= 3.3d0) then
tmp = t_1 + ((1.0d0 - sqrt(x)) + (((y + 1.0d0) ** 0.5d0) - sqrt(y)))
else
tmp = t_1 + ((0.5d0 * sqrt((1.0d0 / y))) + (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 t_1 = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double tmp;
if (x <= 3.3) {
tmp = t_1 + ((1.0 - Math.sqrt(x)) + (Math.pow((y + 1.0), 0.5) - Math.sqrt(y)));
} else {
tmp = t_1 + ((0.5 * Math.sqrt((1.0 / y))) + (0.5 * Math.sqrt((1.0 / x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)) tmp = 0 if x <= 3.3: tmp = t_1 + ((1.0 - math.sqrt(x)) + (math.pow((y + 1.0), 0.5) - math.sqrt(y))) else: tmp = t_1 + ((0.5 * math.sqrt((1.0 / y))) + (0.5 * math.sqrt((1.0 / x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) tmp = 0.0 if (x <= 3.3) tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(x)) + Float64((Float64(y + 1.0) ^ 0.5) - sqrt(y)))); else tmp = Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + 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)
t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
tmp = 0.0;
if (x <= 3.3)
tmp = t_1 + ((1.0 - sqrt(x)) + (((y + 1.0) ^ 0.5) - sqrt(y)));
else
tmp = t_1 + ((0.5 * sqrt((1.0 / y))) + (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_] := Block[{t$95$1 = 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]}, If[LessEqual[x, 3.3], N[(t$95$1 + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(y + 1.0), $MachinePrecision], 0.5], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{if}\;x \leq 3.3:\\
\;\;\;\;t\_1 + \left(\left(1 - \sqrt{x}\right) + \left({\left(y + 1\right)}^{0.5} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 3.2999999999999998Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 96.7%
add-sqr-sqrt74.4%
fma-neg50.1%
pow1/250.1%
sqrt-pow150.0%
metadata-eval50.0%
pow1/250.0%
sqrt-pow150.0%
metadata-eval50.0%
Applied egg-rr50.0%
fma-undefine74.3%
unsub-neg74.3%
pow-sqr96.7%
metadata-eval96.7%
Simplified96.7%
if 3.2999999999999998 < x Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
Taylor expanded in y around inf 44.7%
Taylor expanded in x around inf 49.2%
Final simplification73.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= x 2.5)
(+ t_1 (+ (- 1.0 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))))
(+ t_1 (+ (* 0.5 (sqrt (/ 1.0 y))) (* 0.5 (sqrt (/ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
double tmp;
if (x <= 2.5) {
tmp = t_1 + ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y)));
} else {
tmp = t_1 + ((0.5 * sqrt((1.0 / y))) + (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) :: t_1
real(8) :: tmp
t_1 = (sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))
if (x <= 2.5d0) then
tmp = t_1 + ((1.0d0 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y)))
else
tmp = t_1 + ((0.5d0 * sqrt((1.0d0 / y))) + (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 t_1 = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double tmp;
if (x <= 2.5) {
tmp = t_1 + ((1.0 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
} else {
tmp = t_1 + ((0.5 * Math.sqrt((1.0 / y))) + (0.5 * Math.sqrt((1.0 / x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)) tmp = 0 if x <= 2.5: tmp = t_1 + ((1.0 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) else: tmp = t_1 + ((0.5 * math.sqrt((1.0 / y))) + (0.5 * math.sqrt((1.0 / x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) tmp = 0.0 if (x <= 2.5) tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y)))); else tmp = Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + 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)
t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
tmp = 0.0;
if (x <= 2.5)
tmp = t_1 + ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y)));
else
tmp = t_1 + ((0.5 * sqrt((1.0 / y))) + (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_] := Block[{t$95$1 = 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]}, If[LessEqual[x, 2.5], N[(t$95$1 + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{if}\;x \leq 2.5:\\
\;\;\;\;t\_1 + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 2.5Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 96.7%
if 2.5 < x Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
Taylor expanded in y around inf 44.7%
Taylor expanded in x around inf 49.2%
Final simplification73.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 80000000000000.0)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x)))))
(/ (+ 1.0 (- x x)) (+ (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 <= 80000000000000.0) {
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 + (x - x)) / (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 <= 80000000000000.0d0) 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 + (x - x)) / (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 <= 80000000000000.0) {
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 + (x - x)) / (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 <= 80000000000000.0: 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 + (x - x)) / (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 <= 80000000000000.0) 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(Float64(1.0 + Float64(x - x)) / 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 <= 80000000000000.0)
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 + (x - x)) / (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, 80000000000000.0], 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[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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 80000000000000:\\
\;\;\;\;\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 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 8e13Initial 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 49.0%
associate--l+49.1%
Simplified49.1%
if 8e13 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 3.3%
associate--l+23.9%
Simplified23.9%
Taylor expanded in x around inf 23.8%
neg-mul-123.8%
Simplified23.8%
flip-+23.7%
add-sqr-sqrt23.9%
pow223.9%
Applied egg-rr23.9%
associate--l+27.2%
unpow227.2%
sqr-neg27.2%
rem-square-sqrt28.5%
sub-neg28.5%
remove-double-neg28.5%
Simplified28.5%
Final simplification38.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 t)) (sqrt t))))
(if (<= y 2.05e-7)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) t_1)
(- (+ 2.0 (* y (+ 0.5 (* y -0.125)))) (+ (sqrt y) (sqrt x))))
(if (<= y 2.9e+29)
(+ t_1 (+ (- 1.0 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 2.05e-7) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((2.0 + (y * (0.5 + (y * -0.125)))) - (sqrt(y) + sqrt(x)));
} else if (y <= 2.9e+29) {
tmp = t_1 + ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0)))));
} else {
tmp = (1.0 + (x - x)) / (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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 2.05d-7) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + t_1) + ((2.0d0 + (y * (0.5d0 + (y * (-0.125d0))))) - (sqrt(y) + sqrt(x)))
else if (y <= 2.9d+29) then
tmp = t_1 + ((1.0d0 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))))
else
tmp = (1.0d0 + (x - x)) / (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 t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 2.05e-7) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + t_1) + ((2.0 + (y * (0.5 + (y * -0.125)))) - (Math.sqrt(y) + Math.sqrt(x)));
} else if (y <= 2.9e+29) {
tmp = t_1 + ((1.0 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))));
} else {
tmp = (1.0 + (x - x)) / (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): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 2.05e-7: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + t_1) + ((2.0 + (y * (0.5 + (y * -0.125)))) - (math.sqrt(y) + math.sqrt(x))) elif y <= 2.9e+29: tmp = t_1 + ((1.0 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) else: tmp = (1.0 + (x - x)) / (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) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 2.05e-7) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + t_1) + Float64(Float64(2.0 + Float64(y * Float64(0.5 + Float64(y * -0.125)))) - Float64(sqrt(y) + sqrt(x)))); elseif (y <= 2.9e+29) tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / 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)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 2.05e-7)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + t_1) + ((2.0 + (y * (0.5 + (y * -0.125)))) - (sqrt(y) + sqrt(x)));
elseif (y <= 2.9e+29)
tmp = t_1 + ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0)))));
else
tmp = (1.0 + (x - x)) / (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_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.05e-7], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(2.0 + N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+29], N[(t$95$1 + N[(N[(1.0 - 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[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 2.05 \cdot 10^{-7}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + t\_1\right) + \left(\left(2 + y \cdot \left(0.5 + y \cdot -0.125\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+29}:\\
\;\;\;\;t\_1 + \left(\left(1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.05e-7Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 46.9%
Taylor expanded in y around 0 46.9%
if 2.05e-7 < y < 2.8999999999999999e29Initial program 80.0%
associate-+l+80.0%
sub-neg80.0%
sub-neg80.0%
+-commutative80.0%
+-commutative80.0%
+-commutative80.0%
Simplified80.0%
Taylor expanded in x around 0 51.6%
flip--53.1%
div-inv53.1%
add-sqr-sqrt51.1%
add-sqr-sqrt55.1%
Applied egg-rr55.1%
associate-*r/55.1%
*-rgt-identity55.1%
associate--l+56.1%
+-inverses56.1%
metadata-eval56.1%
Simplified56.1%
Taylor expanded in z around inf 37.1%
if 2.8999999999999999e29 < y Initial program 87.0%
associate-+l+87.0%
sub-neg87.0%
sub-neg87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
Simplified87.0%
Taylor expanded in t around inf 3.3%
associate--l+23.9%
Simplified23.9%
Taylor expanded in x around inf 23.8%
neg-mul-123.8%
Simplified23.8%
flip-+23.8%
add-sqr-sqrt23.9%
pow223.9%
Applied egg-rr23.9%
associate--l+27.3%
unpow227.3%
sqr-neg27.3%
rem-square-sqrt28.7%
sub-neg28.7%
remove-double-neg28.7%
Simplified28.7%
Final simplification37.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= x 3.4)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
(/ 1.0 (+ t_1 (sqrt z))))
(+
(+ (- t_1 (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (* 0.5 (sqrt (/ 1.0 x))))))))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 tmp;
if (x <= 3.4) {
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (t_1 + sqrt(z)));
} else {
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((0.5 * sqrt((1.0 / y))) + (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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (x <= 3.4d0) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (1.0d0 / (t_1 + sqrt(z)))
else
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((0.5d0 * sqrt((1.0d0 / y))) + (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 t_1 = Math.sqrt((1.0 + z));
double tmp;
if (x <= 3.4) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (1.0 / (t_1 + Math.sqrt(z)));
} else {
tmp = ((t_1 - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((0.5 * Math.sqrt((1.0 / y))) + (0.5 * Math.sqrt((1.0 / x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if x <= 3.4: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (1.0 / (t_1 + math.sqrt(z))) else: tmp = ((t_1 - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((0.5 * math.sqrt((1.0 / y))) + (0.5 * math.sqrt((1.0 / x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (x <= 3.4) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(1.0 / Float64(t_1 + sqrt(z)))); else tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + 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)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (x <= 3.4)
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (t_1 + sqrt(z)));
else
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((0.5 * sqrt((1.0 / y))) + (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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 3.4], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $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}\\
\mathbf{if}\;x \leq 3.4:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \frac{1}{t\_1 + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\end{array}
\end{array}
if x < 3.39999999999999991Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 96.7%
flip--96.9%
div-inv96.9%
add-sqr-sqrt70.1%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate-*r/97.3%
*-rgt-identity97.3%
associate--l+97.3%
+-inverses97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in t around inf 59.4%
if 3.39999999999999991 < x Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
Taylor expanded in y around inf 44.7%
Taylor expanded in x around inf 49.2%
Final simplification54.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 1.6e-14)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(/ (+ 1.0 (- x x)) (+ (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 (x <= 1.6e-14) {
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
} else {
tmp = (1.0 + (x - x)) / (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 (x <= 1.6d-14) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
else
tmp = (1.0d0 + (x - x)) / (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 (x <= 1.6e-14) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
} else {
tmp = (1.0 + (x - x)) / (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 x <= 1.6e-14: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) else: tmp = (1.0 + (x - x)) / (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 (x <= 1.6e-14) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / 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 (x <= 1.6e-14)
tmp = ((1.0 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
else
tmp = (1.0 + (x - x)) / (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[x, 1.6e-14], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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}\;x \leq 1.6 \cdot 10^{-14}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if x < 1.6000000000000001e-14Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 98.3%
flip--98.5%
div-inv98.5%
add-sqr-sqrt70.6%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
associate--l+98.9%
+-inverses98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in t around inf 60.4%
if 1.6000000000000001e-14 < x Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in t around inf 4.8%
associate--l+7.0%
Simplified7.0%
Taylor expanded in x around inf 4.6%
neg-mul-14.6%
Simplified4.6%
flip-+4.6%
add-sqr-sqrt4.8%
pow24.8%
Applied egg-rr4.8%
associate--l+8.8%
unpow28.8%
sqr-neg8.8%
rem-square-sqrt10.8%
sub-neg10.8%
remove-double-neg10.8%
Simplified10.8%
Final simplification35.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 y) (sqrt x))) (t_2 (sqrt (+ y 1.0))))
(if (<= z 38000000.0)
(- (+ 1.0 (+ (sqrt (+ 1.0 z)) t_2)) (+ (sqrt z) t_1))
(+ (sqrt (+ 1.0 x)) (- (+ t_2 (* 0.5 (sqrt (/ 1.0 z)))) 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 t_2 = sqrt((y + 1.0));
double tmp;
if (z <= 38000000.0) {
tmp = (1.0 + (sqrt((1.0 + z)) + t_2)) - (sqrt(z) + t_1);
} else {
tmp = sqrt((1.0 + x)) + ((t_2 + (0.5 * sqrt((1.0 / z)))) - 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(y) + sqrt(x)
t_2 = sqrt((y + 1.0d0))
if (z <= 38000000.0d0) then
tmp = (1.0d0 + (sqrt((1.0d0 + z)) + t_2)) - (sqrt(z) + t_1)
else
tmp = sqrt((1.0d0 + x)) + ((t_2 + (0.5d0 * sqrt((1.0d0 / z)))) - 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 t_2 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 38000000.0) {
tmp = (1.0 + (Math.sqrt((1.0 + z)) + t_2)) - (Math.sqrt(z) + t_1);
} else {
tmp = Math.sqrt((1.0 + x)) + ((t_2 + (0.5 * Math.sqrt((1.0 / z)))) - 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) t_2 = math.sqrt((y + 1.0)) tmp = 0 if z <= 38000000.0: tmp = (1.0 + (math.sqrt((1.0 + z)) + t_2)) - (math.sqrt(z) + t_1) else: tmp = math.sqrt((1.0 + x)) + ((t_2 + (0.5 * math.sqrt((1.0 / z)))) - 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)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 38000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + t_2)) - Float64(sqrt(z) + t_1)); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / z)))) - 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);
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 38000000.0)
tmp = (1.0 + (sqrt((1.0 + z)) + t_2)) - (sqrt(z) + t_1);
else
tmp = sqrt((1.0 + x)) + ((t_2 + (0.5 * sqrt((1.0 / z)))) - 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]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 38000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 38000000:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + z} + t\_2\right)\right) - \left(\sqrt{z} + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 3.8e7Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around inf 20.2%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around 0 17.7%
+-commutative17.7%
associate-+r+17.7%
Simplified17.7%
if 3.8e7 < z Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 3.3%
associate--l+24.4%
Simplified24.4%
Taylor expanded in z around inf 32.9%
Final simplification25.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 y) (sqrt x))))
(if (<= z 38000000.0)
(- (+ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt (+ y 1.0)))) (+ (sqrt z) t_1))
(+ 1.0 (- (+ (* 0.5 (sqrt (/ 1.0 z))) (hypot 1.0 (sqrt y))) 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 (z <= 38000000.0) {
tmp = (1.0 + (sqrt((1.0 + z)) + sqrt((y + 1.0)))) - (sqrt(z) + t_1);
} else {
tmp = 1.0 + (((0.5 * sqrt((1.0 / z))) + hypot(1.0, sqrt(y))) - t_1);
}
return tmp;
}
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 (z <= 38000000.0) {
tmp = (1.0 + (Math.sqrt((1.0 + z)) + Math.sqrt((y + 1.0)))) - (Math.sqrt(z) + t_1);
} else {
tmp = 1.0 + (((0.5 * Math.sqrt((1.0 / z))) + Math.hypot(1.0, Math.sqrt(y))) - 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 z <= 38000000.0: tmp = (1.0 + (math.sqrt((1.0 + z)) + math.sqrt((y + 1.0)))) - (math.sqrt(z) + t_1) else: tmp = 1.0 + (((0.5 * math.sqrt((1.0 / z))) + math.hypot(1.0, math.sqrt(y))) - 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 (z <= 38000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + sqrt(Float64(y + 1.0)))) - Float64(sqrt(z) + t_1)); else tmp = Float64(1.0 + Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + hypot(1.0, sqrt(y))) - t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
tmp = 0.0;
if (z <= 38000000.0)
tmp = (1.0 + (sqrt((1.0 + z)) + sqrt((y + 1.0)))) - (sqrt(z) + t_1);
else
tmp = 1.0 + (((0.5 * sqrt((1.0 / z))) + hypot(1.0, sqrt(y))) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 38000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
\mathbf{if}\;z \leq 38000000:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + z} + \sqrt{y + 1}\right)\right) - \left(\sqrt{z} + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(0.5 \cdot \sqrt{\frac{1}{z}} + \mathsf{hypot}\left(1, \sqrt{y}\right)\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 3.8e7Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around inf 20.2%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around 0 17.7%
+-commutative17.7%
associate-+r+17.7%
Simplified17.7%
if 3.8e7 < z Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 3.3%
associate--l+24.4%
Simplified24.4%
Taylor expanded in z around inf 32.9%
Taylor expanded in x around 0 16.0%
associate--l+34.5%
rem-square-sqrt34.5%
metadata-eval34.5%
hypot-undefine34.5%
Simplified34.5%
Final simplification26.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 60000000.0)
(+
1.0
(-
(+ (sqrt (+ 1.0 z)) (sqrt (+ y 1.0)))
(+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+
1.0
(-
(+ (* 0.5 (sqrt (/ 1.0 z))) (hypot 1.0 (sqrt y)))
(+ (sqrt y) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 60000000.0) {
tmp = 1.0 + ((sqrt((1.0 + z)) + sqrt((y + 1.0))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = 1.0 + (((0.5 * sqrt((1.0 / z))) + hypot(1.0, sqrt(y))) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 60000000.0) {
tmp = 1.0 + ((Math.sqrt((1.0 + z)) + Math.sqrt((y + 1.0))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = 1.0 + (((0.5 * Math.sqrt((1.0 / z))) + Math.hypot(1.0, Math.sqrt(y))) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 60000000.0: tmp = 1.0 + ((math.sqrt((1.0 + z)) + math.sqrt((y + 1.0))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = 1.0 + (((0.5 * math.sqrt((1.0 / z))) + math.hypot(1.0, math.sqrt(y))) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 60000000.0) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + z)) + sqrt(Float64(y + 1.0))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(1.0 + Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + hypot(1.0, sqrt(y))) - 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)
tmp = 0.0;
if (z <= 60000000.0)
tmp = 1.0 + ((sqrt((1.0 + z)) + sqrt((y + 1.0))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = 1.0 + (((0.5 * sqrt((1.0 / z))) + hypot(1.0, sqrt(y))) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 60000000.0], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision]), $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}
\mathbf{if}\;z \leq 60000000:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + z} + \sqrt{y + 1}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(0.5 \cdot \sqrt{\frac{1}{z}} + \mathsf{hypot}\left(1, \sqrt{y}\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 6e7Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around inf 20.2%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around 0 24.7%
if 6e7 < z Initial program 85.4%
associate-+l+85.4%
sub-neg85.4%
sub-neg85.4%
+-commutative85.4%
+-commutative85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 3.3%
associate--l+24.4%
Simplified24.4%
Taylor expanded in z around inf 32.9%
Taylor expanded in x around 0 16.0%
associate--l+34.5%
rem-square-sqrt34.5%
metadata-eval34.5%
hypot-undefine34.5%
Simplified34.5%
Final simplification29.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 8e+22)
(- (+ t_1 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x)))
(/ (+ 1.0 (- x x)) (+ (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 <= 8e+22) {
tmp = (t_1 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 + (x - x)) / (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 <= 8d+22) then
tmp = (t_1 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 + (x - x)) / (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 <= 8e+22) {
tmp = (t_1 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (1.0 + (x - x)) / (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 <= 8e+22: tmp = (t_1 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (1.0 + (x - x)) / (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 <= 8e+22) tmp = Float64(Float64(t_1 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / 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 <= 8e+22)
tmp = (t_1 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
else
tmp = (1.0 + (x - x)) / (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, 8e+22], N[(N[(t$95$1 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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 8 \cdot 10^{+22}:\\
\;\;\;\;\left(t\_1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 8e22Initial program 95.8%
associate-+l+95.8%
sub-neg95.8%
sub-neg95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in t around inf 20.1%
associate--l+24.7%
Simplified24.7%
Taylor expanded in z around inf 20.8%
if 8e22 < y Initial program 86.3%
associate-+l+86.3%
sub-neg86.3%
sub-neg86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in t around inf 3.3%
associate--l+23.7%
Simplified23.7%
Taylor expanded in x around inf 23.6%
neg-mul-123.6%
Simplified23.6%
flip-+23.6%
add-sqr-sqrt23.7%
pow223.7%
Applied egg-rr23.7%
associate--l+27.1%
unpow227.1%
sqr-neg27.1%
rem-square-sqrt28.4%
sub-neg28.4%
remove-double-neg28.4%
Simplified28.4%
Final simplification24.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 4.6e+15)
(+ t_1 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))
(/ (+ 1.0 (- x x)) (+ (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+15) {
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 + (x - x)) / (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+15) then
tmp = t_1 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 + (x - x)) / (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+15) {
tmp = t_1 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 + (x - x)) / (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+15: tmp = t_1 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 + (x - x)) / (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+15) tmp = Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / 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+15)
tmp = t_1 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 + (x - x)) / (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+15], N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 4.6e15Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in t around inf 20.3%
associate--l+24.4%
Simplified24.4%
Taylor expanded in z around inf 20.5%
associate--l+20.5%
Simplified20.5%
if 4.6e15 < y Initial program 86.1%
associate-+l+86.1%
sub-neg86.1%
sub-neg86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
Taylor expanded in t around inf 3.3%
associate--l+24.1%
Simplified24.1%
Taylor expanded in x around inf 23.9%
neg-mul-123.9%
Simplified23.9%
flip-+23.9%
add-sqr-sqrt24.1%
pow224.1%
Applied egg-rr24.1%
associate--l+27.4%
unpow227.4%
sqr-neg27.4%
rem-square-sqrt28.7%
sub-neg28.7%
remove-double-neg28.7%
Simplified28.7%
Final simplification24.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 505000000.0) (- (pow (+ 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 <= 505000000.0) {
tmp = pow((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 <= 505000000.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 <= 505000000.0) {
tmp = Math.pow((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 <= 505000000.0: tmp = math.pow((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 <= 505000000.0) tmp = Float64((Float64(1.0 + 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 <= 505000000.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, 505000000.0], N[(N[Power[N[(1.0 + x), $MachinePrecision], 0.5], $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 505000000:\\
\;\;\;\;{\left(1 + x\right)}^{0.5} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 5.05e8Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in t around inf 18.3%
associate--l+40.7%
Simplified40.7%
Taylor expanded in x around inf 29.8%
neg-mul-129.8%
Simplified29.8%
pow1/229.8%
Applied egg-rr29.8%
if 5.05e8 < x Initial program 84.3%
associate-+l+84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
Taylor expanded in t around inf 4.9%
associate--l+6.4%
Simplified6.4%
Taylor expanded in x around inf 3.7%
neg-mul-13.7%
Simplified3.7%
Taylor expanded in x around inf 10.4%
*-commutative10.4%
Simplified10.4%
Final simplification20.5%
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 (- x x)) (+ (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 + (x - x)) / (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 + (x - x)) / (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 + (x - x)) / (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 + (x - x)) / (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(Float64(1.0 + Float64(x - x)) / 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 + (x - x)) / (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[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / 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 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}}
\end{array}
Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
Simplified24.2%
Taylor expanded in x around inf 17.3%
neg-mul-117.3%
Simplified17.3%
flip-+17.3%
add-sqr-sqrt17.4%
pow217.4%
Applied egg-rr17.4%
associate--l+19.5%
unpow219.5%
sqr-neg19.5%
rem-square-sqrt20.5%
sub-neg20.5%
remove-double-neg20.5%
Simplified20.5%
Final simplification20.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 42000000.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 <= 42000000.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 <= 42000000.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 <= 42000000.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 <= 42000000.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 <= 42000000.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 <= 42000000.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, 42000000.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 42000000:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 4.2e7Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in t around inf 18.5%
associate--l+41.2%
Simplified41.2%
Taylor expanded in x around inf 30.0%
neg-mul-130.0%
Simplified30.0%
unsub-neg30.0%
Applied egg-rr30.0%
if 4.2e7 < x Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
Taylor expanded in t around inf 4.9%
associate--l+6.5%
Simplified6.5%
Taylor expanded in x around inf 4.0%
neg-mul-14.0%
Simplified4.0%
Taylor expanded in x around inf 10.5%
*-commutative10.5%
Simplified10.5%
Final simplification20.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 7.2) (+ 1.0 (- (* 0.5 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 <= 7.2) {
tmp = 1.0 + ((0.5 * 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 <= 7.2d0) then
tmp = 1.0d0 + ((0.5d0 * 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 <= 7.2) {
tmp = 1.0 + ((0.5 * 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 <= 7.2: tmp = 1.0 + ((0.5 * 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 <= 7.2) tmp = Float64(1.0 + Float64(Float64(0.5 * 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 <= 7.2)
tmp = 1.0 + ((0.5 * 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, 7.2], N[(1.0 + N[(N[(0.5 * x), $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 7.2:\\
\;\;\;\;1 + \left(0.5 \cdot x - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 7.20000000000000018Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 18.6%
associate--l+41.4%
Simplified41.4%
Taylor expanded in x around inf 30.1%
neg-mul-130.1%
Simplified30.1%
Taylor expanded in x around 0 30.1%
associate--l+30.1%
*-commutative30.1%
Simplified30.1%
if 7.20000000000000018 < x Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
Taylor expanded in t around inf 4.9%
associate--l+6.5%
Simplified6.5%
Taylor expanded in x around inf 4.0%
neg-mul-14.0%
Simplified4.0%
Taylor expanded in x around inf 10.6%
*-commutative10.6%
Simplified10.6%
Final simplification20.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 0.0265) (- 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.0265) {
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.0265d0) 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.0265) {
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.0265: 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.0265) 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.0265)
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.0265], 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.0265:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.0264999999999999993Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 18.6%
associate--l+41.4%
Simplified41.4%
Taylor expanded in x around inf 30.1%
neg-mul-130.1%
Simplified30.1%
Taylor expanded in x around 0 30.1%
if 0.0264999999999999993 < x Initial program 84.0%
associate-+l+84.0%
sub-neg84.0%
sub-neg84.0%
+-commutative84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
Taylor expanded in t around inf 4.9%
associate--l+6.5%
Simplified6.5%
Taylor expanded in x around inf 4.0%
neg-mul-14.0%
Simplified4.0%
Taylor expanded in x around inf 10.6%
*-commutative10.6%
Simplified10.6%
Final simplification20.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
Simplified24.2%
Taylor expanded in x around inf 17.3%
neg-mul-117.3%
Simplified17.3%
Taylor expanded in x around 0 15.9%
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 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in x around 0 49.8%
flip--49.9%
div-inv49.9%
add-sqr-sqrt36.4%
add-sqr-sqrt50.0%
Applied egg-rr50.0%
associate-*r/50.0%
*-rgt-identity50.0%
associate--l+50.1%
+-inverses50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in x around inf 1.6%
neg-mul-11.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 2024137
(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))))