
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (+ (- t_3 (sqrt x)) (- t_1 (sqrt y)))))
(if (<= (+ t_2 t_4) 2.0005)
(+
(+ (/ 1.0 (+ (sqrt x) t_3)) (/ 1.0 (+ (sqrt y) t_1)))
(* 0.5 (sqrt (/ 1.0 z))))
(+ t_4 (+ t_2 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double t_3 = sqrt((1.0 + x));
double t_4 = (t_3 - sqrt(x)) + (t_1 - sqrt(y));
double tmp;
if ((t_2 + t_4) <= 2.0005) {
tmp = ((1.0 / (sqrt(x) + t_3)) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = t_4 + (t_2 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = sqrt((1.0d0 + x))
t_4 = (t_3 - sqrt(x)) + (t_1 - sqrt(y))
if ((t_2 + t_4) <= 2.0005d0) then
tmp = ((1.0d0 / (sqrt(x) + t_3)) + (1.0d0 / (sqrt(y) + t_1))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = t_4 + (t_2 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + x));
double t_4 = (t_3 - Math.sqrt(x)) + (t_1 - Math.sqrt(y));
double tmp;
if ((t_2 + t_4) <= 2.0005) {
tmp = ((1.0 / (Math.sqrt(x) + t_3)) + (1.0 / (Math.sqrt(y) + t_1))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = t_4 + (t_2 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) t_3 = math.sqrt((1.0 + x)) t_4 = (t_3 - math.sqrt(x)) + (t_1 - math.sqrt(y)) tmp = 0 if (t_2 + t_4) <= 2.0005: tmp = ((1.0 / (math.sqrt(x) + t_3)) + (1.0 / (math.sqrt(y) + t_1))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = t_4 + (t_2 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(Float64(t_3 - sqrt(x)) + Float64(t_1 - sqrt(y))) tmp = 0.0 if (Float64(t_2 + t_4) <= 2.0005) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(t_4 + Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z)) - sqrt(z);
t_3 = sqrt((1.0 + x));
t_4 = (t_3 - sqrt(x)) + (t_1 - sqrt(y));
tmp = 0.0;
if ((t_2 + t_4) <= 2.0005)
tmp = ((1.0 / (sqrt(x) + t_3)) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
else
tmp = t_4 + (t_2 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 + t$95$4), $MachinePrecision], 2.0005], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
t_3 := \sqrt{1 + x}\\
t_4 := \left(t\_3 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\\
\mathbf{if}\;t\_2 + t\_4 \leq 2.0005:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t\_3} + \frac{1}{\sqrt{y} + t\_1}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_4 + \left(t\_2 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.00050000000000017Initial program 90.6%
associate-+l+90.6%
sub-neg90.6%
sub-neg90.6%
+-commutative90.6%
+-commutative90.6%
+-commutative90.6%
Simplified90.6%
flip--90.6%
div-inv90.6%
add-sqr-sqrt64.6%
+-commutative64.6%
add-sqr-sqrt90.8%
+-commutative90.8%
Applied egg-rr90.8%
associate--l+91.6%
+-inverses91.6%
metadata-eval91.6%
*-lft-identity91.6%
+-commutative91.6%
Simplified91.6%
flip--91.9%
div-inv91.9%
add-sqr-sqrt69.7%
add-sqr-sqrt92.2%
associate--l+94.4%
Applied egg-rr94.4%
+-inverses94.4%
metadata-eval94.4%
*-lft-identity94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in t around inf 53.4%
Taylor expanded in z around inf 33.3%
if 2.00050000000000017 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 99.1%
associate-+l+99.1%
sub-neg99.1%
sub-neg99.1%
+-commutative99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
flip--99.1%
div-inv99.1%
add-sqr-sqrt80.9%
+-commutative80.9%
add-sqr-sqrt99.1%
associate--l+99.1%
Applied egg-rr99.1%
associate-*r/99.1%
*-rgt-identity99.1%
associate-+r-99.1%
+-commutative99.1%
associate-+r-99.6%
+-inverses99.6%
metadata-eval99.6%
+-commutative99.6%
Simplified99.6%
Final simplification42.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 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t_1 4e-5)
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_2)))
(* 0.5 (sqrt (/ 1.0 z))))
(+
(+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))
(+ (- t_2 (sqrt y)) (- 1.0 (sqrt 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);
double t_2 = sqrt((1.0 + y));
double tmp;
if (t_1 <= 4e-5) {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) + ((t_2 - 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y))
if (t_1 <= 4d-5) then
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_2))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))) + ((t_2 - 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 t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t_1 <= 4e-5) {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_2))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))) + ((t_2 - 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): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t_1 <= 4e-5: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_2))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) + ((t_2 - 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) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_1 <= 4e-5) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_2))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))) + Float64(Float64(t_2 - sqrt(y)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t_1 <= 4e-5)
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + (0.5 * sqrt((1.0 / z)));
else
tmp = (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) + ((t_2 - 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_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 4e-5], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_2}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) + \left(\left(t\_2 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) < 4.00000000000000033e-5Initial program 85.9%
associate-+l+85.9%
sub-neg85.9%
sub-neg85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.0%
div-inv86.0%
add-sqr-sqrt67.0%
+-commutative67.0%
add-sqr-sqrt86.0%
+-commutative86.0%
Applied egg-rr86.0%
associate--l+87.2%
+-inverses87.2%
metadata-eval87.2%
*-lft-identity87.2%
+-commutative87.2%
Simplified87.2%
flip--87.7%
div-inv87.7%
add-sqr-sqrt69.0%
add-sqr-sqrt88.2%
associate--l+91.5%
Applied egg-rr91.5%
+-inverses91.5%
metadata-eval91.5%
*-lft-identity91.5%
+-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 48.3%
Taylor expanded in z around inf 51.1%
if 4.00000000000000033e-5 < (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) Initial 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 49.5%
flip--98.2%
div-inv98.2%
add-sqr-sqrt74.2%
+-commutative74.2%
add-sqr-sqrt98.2%
associate--l+98.2%
Applied egg-rr49.5%
associate-*r/98.2%
*-rgt-identity98.2%
associate-+r-98.2%
+-commutative98.2%
associate-+r-99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified49.7%
Final simplification50.4%
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)))) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 91.8%
associate-+l+91.8%
sub-neg91.8%
sub-neg91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
flip--91.8%
div-inv91.8%
add-sqr-sqrt69.5%
+-commutative69.5%
add-sqr-sqrt92.0%
+-commutative92.0%
Applied egg-rr92.0%
associate--l+92.7%
+-inverses92.7%
metadata-eval92.7%
*-lft-identity92.7%
+-commutative92.7%
Simplified92.7%
flip--93.0%
div-inv93.0%
add-sqr-sqrt74.0%
add-sqr-sqrt93.2%
associate--l+95.1%
Applied egg-rr95.1%
+-inverses95.1%
metadata-eval95.1%
*-lft-identity95.1%
+-commutative95.1%
Simplified95.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 y))))
(if (<= z 64000000.0)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))
(* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 64000000.0) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 64000000.0d0) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_1))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 64000000.0) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 64000000.0: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 64000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 64000000.0)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 64000000.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[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 64000000:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 6.4e7Initial 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 49.5%
if 6.4e7 < z Initial program 85.9%
associate-+l+85.9%
sub-neg85.9%
sub-neg85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.0%
div-inv86.0%
add-sqr-sqrt67.0%
+-commutative67.0%
add-sqr-sqrt86.0%
+-commutative86.0%
Applied egg-rr86.0%
associate--l+87.2%
+-inverses87.2%
metadata-eval87.2%
*-lft-identity87.2%
+-commutative87.2%
Simplified87.2%
flip--87.7%
div-inv87.7%
add-sqr-sqrt69.0%
add-sqr-sqrt88.2%
associate--l+91.5%
Applied egg-rr91.5%
+-inverses91.5%
metadata-eval91.5%
*-lft-identity91.5%
+-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 48.3%
Taylor expanded in z around inf 51.1%
Final simplification50.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 y))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= (- (sqrt (+ 1.0 x)) (sqrt x)) 2e-7)
(+ t_2 (+ (- t_1 (sqrt y)) (* 0.5 (sqrt (/ 1.0 x)))))
(+ t_2 (+ (/ 1.0 (+ (sqrt y) t_1)) (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 2e-7) {
tmp = t_2 + ((t_1 - sqrt(y)) + (0.5 * sqrt((1.0 / x))));
} else {
tmp = t_2 + ((1.0 / (sqrt(y) + t_1)) + (1.0 - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if ((sqrt((1.0d0 + x)) - sqrt(x)) <= 2d-7) then
tmp = t_2 + ((t_1 - sqrt(y)) + (0.5d0 * sqrt((1.0d0 / x))))
else
tmp = t_2 + ((1.0d0 / (sqrt(y) + t_1)) + (1.0d0 - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) <= 2e-7) {
tmp = t_2 + ((t_1 - Math.sqrt(y)) + (0.5 * Math.sqrt((1.0 / x))));
} else {
tmp = t_2 + ((1.0 / (Math.sqrt(y) + t_1)) + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if (math.sqrt((1.0 + x)) - math.sqrt(x)) <= 2e-7: tmp = t_2 + ((t_1 - math.sqrt(y)) + (0.5 * math.sqrt((1.0 / x)))) else: tmp = t_2 + ((1.0 / (math.sqrt(y) + t_1)) + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) <= 2e-7) tmp = Float64(t_2 + Float64(Float64(t_1 - sqrt(y)) + Float64(0.5 * sqrt(Float64(1.0 / x))))); else tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(y) + t_1)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if ((sqrt((1.0 + x)) - sqrt(x)) <= 2e-7)
tmp = t_2 + ((t_1 - sqrt(y)) + (0.5 * sqrt((1.0 / x))));
else
tmp = t_2 + ((1.0 / (sqrt(y) + t_1)) + (1.0 - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 2e-7], N[(t$95$2 + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;\sqrt{1 + x} - \sqrt{x} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;t\_2 + \left(\left(t\_1 - \sqrt{y}\right) + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\frac{1}{\sqrt{y} + t\_1} + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.9999999999999999e-7Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
flip--84.4%
div-inv84.4%
add-sqr-sqrt35.6%
+-commutative35.6%
add-sqr-sqrt84.5%
+-commutative84.5%
Applied egg-rr84.5%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
*-lft-identity86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in t around inf 44.7%
Taylor expanded in x around inf 44.7%
if 1.9999999999999999e-7 < (-.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 92.7%
flip--98.3%
div-inv98.3%
add-sqr-sqrt78.3%
add-sqr-sqrt98.7%
associate--l+99.2%
Applied egg-rr93.7%
+-inverses99.2%
metadata-eval99.2%
*-lft-identity99.2%
+-commutative99.2%
Simplified93.7%
Taylor expanded in t around inf 56.4%
Final simplification51.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 y))))
(if (<= z 1.6e-12)
(+
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (+ 1.0 (* z 0.5)) (sqrt z))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))
(- (sqrt (+ 1.0 z)) (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 + y));
double tmp;
if (z <= 1.6e-12) {
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + ((1.0 + (z * 0.5)) - sqrt(z)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (sqrt((1.0 + z)) - 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) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 1.6d-12) then
tmp = ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + ((1.0d0 + (z * 0.5d0)) - sqrt(z)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_1))) + (sqrt((1.0d0 + z)) - 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 + y));
double tmp;
if (z <= 1.6e-12) {
tmp = ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((1.0 + (z * 0.5)) - Math.sqrt(z)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1))) + (Math.sqrt((1.0 + z)) - 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 + y)) tmp = 0 if z <= 1.6e-12: tmp = ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + ((1.0 + (z * 0.5)) - math.sqrt(z))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) + (math.sqrt((1.0 + z)) - 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 + y)) tmp = 0.0 if (z <= 1.6e-12) tmp = Float64(Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(1.0 + Float64(z * 0.5)) - sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(sqrt(Float64(1.0 + z)) - 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 + y));
tmp = 0.0;
if (z <= 1.6e-12)
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + ((1.0 + (z * 0.5)) - sqrt(z)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (sqrt((1.0 + z)) - 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.6e-12], N[(N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.6 \cdot 10^{-12}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(1 + z \cdot 0.5\right) - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 1.6e-12Initial 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 48.3%
Taylor expanded in z around 0 48.3%
if 1.6e-12 < z Initial program 86.6%
associate-+l+86.6%
sub-neg86.6%
sub-neg86.6%
+-commutative86.6%
+-commutative86.6%
+-commutative86.6%
Simplified86.6%
flip--86.6%
div-inv86.6%
add-sqr-sqrt68.7%
+-commutative68.7%
add-sqr-sqrt86.7%
+-commutative86.7%
Applied egg-rr86.7%
associate--l+87.8%
+-inverses87.8%
metadata-eval87.8%
*-lft-identity87.8%
+-commutative87.8%
Simplified87.8%
flip--88.3%
div-inv88.3%
add-sqr-sqrt69.1%
add-sqr-sqrt88.8%
associate--l+91.9%
Applied egg-rr91.9%
+-inverses91.9%
metadata-eval91.9%
*-lft-identity91.9%
+-commutative91.9%
Simplified91.9%
Taylor expanded in t around inf 48.0%
Final simplification48.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 y))))
(if (<= t 4.3e+27)
(+
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x)))
(- (+ (sqrt (+ 1.0 t)) (- 1.0 (sqrt t))) (sqrt z)))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))
(- (sqrt (+ 1.0 z)) (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 + y));
double tmp;
if (t <= 4.3e+27) {
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (sqrt((1.0 + z)) - 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) :: tmp
t_1 = sqrt((1.0d0 + y))
if (t <= 4.3d+27) then
tmp = ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x))) + ((sqrt((1.0d0 + t)) + (1.0d0 - sqrt(t))) - sqrt(z))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_1))) + (sqrt((1.0d0 + z)) - 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 + y));
double tmp;
if (t <= 4.3e+27) {
tmp = ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + ((Math.sqrt((1.0 + t)) + (1.0 - Math.sqrt(t))) - Math.sqrt(z));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1))) + (Math.sqrt((1.0 + z)) - 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 + y)) tmp = 0 if t <= 4.3e+27: tmp = ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) + ((math.sqrt((1.0 + t)) + (1.0 - math.sqrt(t))) - math.sqrt(z)) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) + (math.sqrt((1.0 + z)) - 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 + y)) tmp = 0.0 if (t <= 4.3e+27) tmp = Float64(Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(1.0 - sqrt(t))) - sqrt(z))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(sqrt(Float64(1.0 + z)) - 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 + y));
tmp = 0.0;
if (t <= 4.3e+27)
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (sqrt((1.0 + z)) - 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 4.3e+27], N[(N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 4.3 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \left(\left(\sqrt{1 + t} + \left(1 - \sqrt{t}\right)\right) - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 4.30000000000000008e27Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 49.6%
Taylor expanded in z around 0 22.1%
associate--r+22.1%
+-commutative22.1%
associate--l+22.1%
Simplified22.1%
if 4.30000000000000008e27 < t Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
div-inv85.6%
add-sqr-sqrt67.6%
+-commutative67.6%
add-sqr-sqrt85.9%
+-commutative85.9%
Applied egg-rr85.9%
associate--l+87.4%
+-inverses87.4%
metadata-eval87.4%
*-lft-identity87.4%
+-commutative87.4%
Simplified87.4%
flip--87.9%
div-inv87.9%
add-sqr-sqrt70.7%
add-sqr-sqrt88.2%
associate--l+91.7%
Applied egg-rr91.7%
+-inverses91.7%
metadata-eval91.7%
*-lft-identity91.7%
+-commutative91.7%
Simplified91.7%
Taylor expanded in t around inf 91.7%
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
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= t 4.3e+27)
(+
(+ t_1 (- 1.0 (sqrt x)))
(- (+ (sqrt (+ 1.0 t)) (- 1.0 (sqrt t))) (sqrt z)))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 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 + y)) - sqrt(y);
double tmp;
if (t <= 4.3e+27) {
tmp = (t_1 + (1.0 - sqrt(x))) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + 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 + y)) - sqrt(y)
if (t <= 4.3d+27) then
tmp = (t_1 + (1.0d0 - sqrt(x))) + ((sqrt((1.0d0 + t)) + (1.0d0 - sqrt(t))) - sqrt(z))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 + y)) - Math.sqrt(y);
double tmp;
if (t <= 4.3e+27) {
tmp = (t_1 + (1.0 - Math.sqrt(x))) + ((Math.sqrt((1.0 + t)) + (1.0 - Math.sqrt(t))) - Math.sqrt(z));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + 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 + y)) - math.sqrt(y) tmp = 0 if t <= 4.3e+27: tmp = (t_1 + (1.0 - math.sqrt(x))) + ((math.sqrt((1.0 + t)) + (1.0 - math.sqrt(t))) - math.sqrt(z)) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t <= 4.3e+27) tmp = Float64(Float64(t_1 + Float64(1.0 - sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(1.0 - sqrt(t))) - sqrt(z))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 + y)) - sqrt(y);
tmp = 0.0;
if (t <= 4.3e+27)
tmp = (t_1 + (1.0 - sqrt(x))) + ((sqrt((1.0 + t)) + (1.0 - sqrt(t))) - sqrt(z));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 4.3e+27], N[(N[(t$95$1 + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $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{1 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 4.3 \cdot 10^{+27}:\\
\;\;\;\;\left(t\_1 + \left(1 - \sqrt{x}\right)\right) + \left(\left(\sqrt{1 + t} + \left(1 - \sqrt{t}\right)\right) - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\right)\\
\end{array}
\end{array}
if t < 4.30000000000000008e27Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 49.6%
Taylor expanded in z around 0 22.1%
associate--r+22.1%
+-commutative22.1%
associate--l+22.1%
Simplified22.1%
if 4.30000000000000008e27 < t Initial program 85.6%
associate-+l+85.6%
sub-neg85.6%
sub-neg85.6%
+-commutative85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
flip--85.6%
div-inv85.6%
add-sqr-sqrt67.6%
+-commutative67.6%
add-sqr-sqrt85.9%
+-commutative85.9%
Applied egg-rr85.9%
associate--l+87.4%
+-inverses87.4%
metadata-eval87.4%
*-lft-identity87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t around inf 87.4%
Final simplification52.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= y 8e-9)
(+
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))
(* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (y <= 8e-9) {
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (y <= 8d-9) then
tmp = ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_1))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 8e-9) {
tmp = ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if y <= 8e-9: tmp = ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (y <= 8e-9) tmp = Float64(Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (y <= 8e-9)
tmp = ((t_1 - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 8e-9], N[(N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 8 \cdot 10^{-9}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if y < 8.0000000000000005e-9Initial 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 53.5%
Taylor expanded in t around inf 32.4%
flip--32.6%
div-inv32.6%
add-sqr-sqrt25.0%
add-sqr-sqrt32.6%
associate--l+32.6%
Applied egg-rr32.6%
+-inverses32.6%
metadata-eval32.6%
*-lft-identity32.6%
+-commutative32.6%
Simplified32.6%
if 8.0000000000000005e-9 < y Initial program 84.5%
associate-+l+84.5%
sub-neg84.5%
sub-neg84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
flip--84.4%
div-inv84.4%
add-sqr-sqrt62.8%
+-commutative62.8%
add-sqr-sqrt84.6%
+-commutative84.6%
Applied egg-rr84.6%
associate--l+85.6%
+-inverses85.6%
metadata-eval85.6%
*-lft-identity85.6%
+-commutative85.6%
Simplified85.6%
flip--86.2%
div-inv86.2%
add-sqr-sqrt45.6%
add-sqr-sqrt86.7%
associate--l+90.7%
Applied egg-rr90.7%
+-inverses90.7%
metadata-eval90.7%
*-lft-identity90.7%
+-commutative90.7%
Simplified90.7%
Taylor expanded in t around inf 48.5%
Taylor expanded in z around inf 27.3%
Final simplification30.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))))
(if (<= y 24500000.0)
(+
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ t_1 (sqrt z))))
(+
(- t_1 (sqrt z))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (pow y -0.5)))))))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 (y <= 24500000.0) {
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (t_1 + sqrt(z)));
} else {
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * pow(y, -0.5)));
}
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 (y <= 24500000.0d0) then
tmp = ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (t_1 + sqrt(z)))
else
tmp = (t_1 - sqrt(z)) + ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * (y ** (-0.5d0))))
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 (y <= 24500000.0) {
tmp = ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (t_1 + Math.sqrt(z)));
} else {
tmp = (t_1 - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.pow(y, -0.5)));
}
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 y <= 24500000.0: tmp = ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (t_1 + math.sqrt(z))) else: tmp = (t_1 - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.pow(y, -0.5))) 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 (y <= 24500000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(t_1 + sqrt(z)))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * (y ^ -0.5)))); 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 (y <= 24500000.0)
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (t_1 + sqrt(z)));
else
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * (y ^ -0.5)));
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[y, 24500000.0], N[(N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Power[y, -0.5], $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}\;y \leq 24500000:\\
\;\;\;\;\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{t\_1 + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot {y}^{-0.5}\right)\\
\end{array}
\end{array}
if y < 2.45e7Initial 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 53.7%
Taylor expanded in t around inf 33.3%
flip--33.5%
div-inv33.5%
add-sqr-sqrt25.5%
add-sqr-sqrt33.5%
associate--l+33.5%
Applied egg-rr33.5%
+-inverses33.5%
metadata-eval33.5%
*-lft-identity33.5%
+-commutative33.5%
Simplified33.5%
if 2.45e7 < y Initial program 84.3%
associate-+l+84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
flip--84.3%
div-inv84.3%
add-sqr-sqrt61.7%
+-commutative61.7%
add-sqr-sqrt84.4%
+-commutative84.4%
Applied egg-rr84.4%
associate--l+85.5%
+-inverses85.5%
metadata-eval85.5%
*-lft-identity85.5%
+-commutative85.5%
Simplified85.5%
flip--86.0%
div-inv86.0%
add-sqr-sqrt43.6%
add-sqr-sqrt86.5%
associate--l+90.6%
Applied egg-rr90.6%
+-inverses90.6%
metadata-eval90.6%
*-lft-identity90.6%
+-commutative90.6%
Simplified90.6%
Taylor expanded in t around inf 47.7%
Taylor expanded in y around inf 47.6%
rem-exp-log47.5%
exp-neg47.5%
unpow1/247.5%
exp-prod47.5%
distribute-lft-neg-out47.5%
distribute-rgt-neg-in47.5%
metadata-eval47.5%
exp-to-pow47.7%
Simplified47.7%
Final simplification39.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 z))))
(if (<= y 26000000000000.0)
(+
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x)))
(/ 1.0 (+ t_1 (sqrt z))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- 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 tmp;
if (y <= 26000000000000.0) {
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (t_1 + sqrt(z)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (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) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 26000000000000.0d0) then
tmp = ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x))) + (1.0d0 / (t_1 + sqrt(z)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (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 tmp;
if (y <= 26000000000000.0) {
tmp = ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (1.0 / (t_1 + Math.sqrt(z)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (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)) tmp = 0 if y <= 26000000000000.0: tmp = ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (1.0 / (t_1 + math.sqrt(z))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (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)) tmp = 0.0 if (y <= 26000000000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(1.0 / Float64(t_1 + sqrt(z)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + 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));
tmp = 0.0;
if (y <= 26000000000000.0)
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (1.0 / (t_1 + sqrt(z)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (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]}, If[LessEqual[y, 26000000000000.0], N[(N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $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}\;y \leq 26000000000000:\\
\;\;\;\;\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \frac{1}{t\_1 + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 2.6e13Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 53.6%
Taylor expanded in t around inf 33.2%
flip--33.4%
div-inv33.4%
add-sqr-sqrt25.0%
add-sqr-sqrt33.4%
associate--l+33.4%
Applied egg-rr33.4%
+-inverses33.4%
metadata-eval33.4%
*-lft-identity33.4%
+-commutative33.4%
Simplified33.4%
if 2.6e13 < y Initial program 84.9%
associate-+l+84.9%
sub-neg84.9%
sub-neg84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
flip--84.9%
div-inv84.9%
add-sqr-sqrt61.7%
+-commutative61.7%
add-sqr-sqrt85.0%
+-commutative85.0%
Applied egg-rr85.0%
associate--l+86.1%
+-inverses86.1%
metadata-eval86.1%
*-lft-identity86.1%
+-commutative86.1%
Simplified86.1%
flip--86.1%
div-inv86.1%
add-sqr-sqrt42.4%
add-sqr-sqrt86.1%
associate--l+90.4%
Applied egg-rr90.4%
+-inverses90.4%
metadata-eval90.4%
*-lft-identity90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 47.1%
Taylor expanded in y around inf 43.3%
Final simplification37.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 26000000000000.0)
(+ t_1 (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 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 + z)) - sqrt(z);
double tmp;
if (y <= 26000000000000.0) {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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 + z)) - sqrt(z)
if (y <= 26000000000000.0d0) then
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 + z)) - Math.sqrt(z);
double tmp;
if (y <= 26000000000000.0) {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + 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 + z)) - math.sqrt(z) tmp = 0 if y <= 26000000000000.0: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 26000000000000.0) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 26000000000000.0)
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 26000000000000.0], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 26000000000000:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if y < 2.6e13Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 53.6%
Taylor expanded in t around inf 33.2%
if 2.6e13 < y Initial program 84.9%
associate-+l+84.9%
sub-neg84.9%
sub-neg84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
flip--84.9%
div-inv84.9%
add-sqr-sqrt61.7%
+-commutative61.7%
add-sqr-sqrt85.0%
+-commutative85.0%
Applied egg-rr85.0%
associate--l+86.1%
+-inverses86.1%
metadata-eval86.1%
*-lft-identity86.1%
+-commutative86.1%
Simplified86.1%
flip--86.1%
div-inv86.1%
add-sqr-sqrt42.4%
add-sqr-sqrt86.1%
associate--l+90.4%
Applied egg-rr90.4%
+-inverses90.4%
metadata-eval90.4%
*-lft-identity90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 47.1%
Taylor expanded in y around inf 43.3%
Final simplification37.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))))
(if (<= y 9e-9)
(+ t_1 (+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))
(if (<= y 1.75e+29)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- 1.0 (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 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 + z)) - sqrt(z);
double tmp;
if (y <= 9e-9) {
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
} else if (y <= 1.75e+29) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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 + z)) - sqrt(z)
if (y <= 9d-9) then
tmp = t_1 + (2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y))))
else if (y <= 1.75d+29) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 + z)) - Math.sqrt(z);
double tmp;
if (y <= 9e-9) {
tmp = t_1 + (2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y))));
} else if (y <= 1.75e+29) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + 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 + z)) - math.sqrt(z) tmp = 0 if y <= 9e-9: tmp = t_1 + (2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y)))) elif y <= 1.75e+29: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 9e-9) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y))))); elseif (y <= 1.75e+29) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 9e-9)
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
elseif (y <= 1.75e+29)
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9e-9], N[(t$95$1 + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+29], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 9 \cdot 10^{-9}:\\
\;\;\;\;t\_1 + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+29}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if y < 8.99999999999999953e-9Initial 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 53.5%
Taylor expanded in t around inf 32.4%
Taylor expanded in y around 0 32.4%
associate--l+32.4%
*-commutative32.4%
+-commutative32.4%
Simplified32.4%
if 8.99999999999999953e-9 < y < 1.74999999999999989e29Initial program 71.7%
associate-+l+71.7%
sub-neg71.7%
sub-neg71.7%
+-commutative71.7%
+-commutative71.7%
+-commutative71.7%
Simplified71.7%
Taylor expanded in x around 0 48.3%
flip--77.3%
div-inv77.3%
add-sqr-sqrt76.3%
add-sqr-sqrt81.9%
associate--l+96.4%
Applied egg-rr57.5%
+-inverses96.4%
metadata-eval96.4%
*-lft-identity96.4%
+-commutative96.4%
Simplified57.5%
Taylor expanded in t around inf 34.5%
Taylor expanded in z around inf 34.5%
if 1.74999999999999989e29 < y Initial program 86.2%
associate-+l+86.2%
sub-neg86.2%
sub-neg86.2%
+-commutative86.2%
+-commutative86.2%
+-commutative86.2%
Simplified86.2%
flip--86.1%
div-inv86.1%
add-sqr-sqrt62.2%
+-commutative62.2%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr86.2%
associate--l+87.4%
+-inverses87.4%
metadata-eval87.4%
*-lft-identity87.4%
+-commutative87.4%
Simplified87.4%
flip--87.4%
div-inv87.4%
add-sqr-sqrt41.6%
add-sqr-sqrt87.4%
associate--l+90.0%
Applied egg-rr90.0%
+-inverses90.0%
metadata-eval90.0%
*-lft-identity90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in t around inf 46.5%
Taylor expanded in y around inf 43.7%
Final simplification37.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 9.5e-10)
(+ t_1 (+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))
(if (<= y 4100000000000.0)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 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 + z)) - sqrt(z);
double tmp;
if (y <= 9.5e-10) {
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
} else if (y <= 4100000000000.0) {
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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 + z)) - sqrt(z)
if (y <= 9.5d-10) then
tmp = t_1 + (2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y))))
else if (y <= 4100000000000.0d0) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 + z)) - Math.sqrt(z);
double tmp;
if (y <= 9.5e-10) {
tmp = t_1 + (2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y))));
} else if (y <= 4100000000000.0) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + 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 + z)) - math.sqrt(z) tmp = 0 if y <= 9.5e-10: tmp = t_1 + (2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y)))) elif y <= 4100000000000.0: tmp = (0.5 * math.sqrt((1.0 / z))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 9.5e-10) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y))))); elseif (y <= 4100000000000.0) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 9.5e-10)
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
elseif (y <= 4100000000000.0)
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9.5e-10], N[(t$95$1 + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4100000000000.0], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 9.5 \cdot 10^{-10}:\\
\;\;\;\;t\_1 + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4100000000000:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if y < 9.50000000000000028e-10Initial 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 53.5%
Taylor expanded in t around inf 32.4%
Taylor expanded in y around 0 32.4%
associate--l+32.4%
*-commutative32.4%
+-commutative32.4%
Simplified32.4%
if 9.50000000000000028e-10 < y < 4.1e12Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
Taylor expanded in x around 0 63.1%
Taylor expanded in z around inf 63.1%
Taylor expanded in z around 0 54.5%
if 4.1e12 < y Initial program 84.5%
associate-+l+84.5%
sub-neg84.5%
sub-neg84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
flip--84.4%
div-inv84.4%
add-sqr-sqrt61.5%
+-commutative61.5%
add-sqr-sqrt84.6%
+-commutative84.6%
Applied egg-rr84.6%
associate--l+85.7%
+-inverses85.7%
metadata-eval85.7%
*-lft-identity85.7%
+-commutative85.7%
Simplified85.7%
flip--86.2%
div-inv86.2%
add-sqr-sqrt42.9%
add-sqr-sqrt86.2%
associate--l+90.5%
Applied egg-rr90.5%
+-inverses90.5%
metadata-eval90.5%
*-lft-identity90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 47.5%
Taylor expanded in y around inf 43.0%
Final simplification37.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 2.3)
(+ t_1 (+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))
(if (<= y 1.75e+29)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x)))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 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 + z)) - sqrt(z);
double tmp;
if (y <= 2.3) {
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
} else if (y <= 1.75e+29) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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 + z)) - sqrt(z)
if (y <= 2.3d0) then
tmp = t_1 + (2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y))))
else if (y <= 1.75d+29) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 + z)) - Math.sqrt(z);
double tmp;
if (y <= 2.3) {
tmp = t_1 + (2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y))));
} else if (y <= 1.75e+29) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + 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 + z)) - math.sqrt(z) tmp = 0 if y <= 2.3: tmp = t_1 + (2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y)))) elif y <= 1.75e+29: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 2.3) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y))))); elseif (y <= 1.75e+29) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 2.3)
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
elseif (y <= 1.75e+29)
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.3], N[(t$95$1 + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+29], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 2.3:\\
\;\;\;\;t\_1 + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+29}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if y < 2.2999999999999998Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 54.2%
Taylor expanded in t around inf 33.4%
Taylor expanded in y around 0 33.3%
associate--l+33.3%
*-commutative33.3%
+-commutative33.3%
Simplified33.3%
if 2.2999999999999998 < y < 1.74999999999999989e29Initial program 67.0%
associate-+l+67.0%
sub-neg67.0%
sub-neg67.0%
+-commutative67.0%
+-commutative67.0%
+-commutative67.0%
Simplified67.0%
Taylor expanded in x around 0 39.7%
Taylor expanded in t around inf 20.3%
Taylor expanded in y around inf 20.2%
Taylor expanded in z around inf 20.2%
if 1.74999999999999989e29 < y Initial program 86.2%
associate-+l+86.2%
sub-neg86.2%
sub-neg86.2%
+-commutative86.2%
+-commutative86.2%
+-commutative86.2%
Simplified86.2%
flip--86.1%
div-inv86.1%
add-sqr-sqrt62.2%
+-commutative62.2%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr86.2%
associate--l+87.4%
+-inverses87.4%
metadata-eval87.4%
*-lft-identity87.4%
+-commutative87.4%
Simplified87.4%
flip--87.4%
div-inv87.4%
add-sqr-sqrt41.6%
add-sqr-sqrt87.4%
associate--l+90.0%
Applied egg-rr90.0%
+-inverses90.0%
metadata-eval90.0%
*-lft-identity90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in t around inf 46.5%
Taylor expanded in y around inf 43.7%
Final simplification37.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 z)) (sqrt z))))
(if (<= y 0.98)
(+ t_1 (- 2.0 (+ (sqrt x) (sqrt y))))
(if (<= y 1.75e+29)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x)))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 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 + z)) - sqrt(z);
double tmp;
if (y <= 0.98) {
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
} else if (y <= 1.75e+29) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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 + z)) - sqrt(z)
if (y <= 0.98d0) then
tmp = t_1 + (2.0d0 - (sqrt(x) + sqrt(y)))
else if (y <= 1.75d+29) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 + z)) - Math.sqrt(z);
double tmp;
if (y <= 0.98) {
tmp = t_1 + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (y <= 1.75e+29) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + 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 + z)) - math.sqrt(z) tmp = 0 if y <= 0.98: tmp = t_1 + (2.0 - (math.sqrt(x) + math.sqrt(y))) elif y <= 1.75e+29: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 0.98) tmp = Float64(t_1 + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); elseif (y <= 1.75e+29) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 0.98)
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
elseif (y <= 1.75e+29)
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.98], N[(t$95$1 + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+29], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 0.98:\\
\;\;\;\;t\_1 + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+29}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if y < 0.97999999999999998Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 54.2%
Taylor expanded in t around inf 33.4%
Taylor expanded in y around 0 32.6%
+-commutative32.6%
Simplified32.6%
if 0.97999999999999998 < y < 1.74999999999999989e29Initial program 67.0%
associate-+l+67.0%
sub-neg67.0%
sub-neg67.0%
+-commutative67.0%
+-commutative67.0%
+-commutative67.0%
Simplified67.0%
Taylor expanded in x around 0 39.7%
Taylor expanded in t around inf 20.3%
Taylor expanded in y around inf 20.2%
Taylor expanded in z around inf 20.2%
if 1.74999999999999989e29 < y Initial program 86.2%
associate-+l+86.2%
sub-neg86.2%
sub-neg86.2%
+-commutative86.2%
+-commutative86.2%
+-commutative86.2%
Simplified86.2%
flip--86.1%
div-inv86.1%
add-sqr-sqrt62.2%
+-commutative62.2%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr86.2%
associate--l+87.4%
+-inverses87.4%
metadata-eval87.4%
*-lft-identity87.4%
+-commutative87.4%
Simplified87.4%
flip--87.4%
div-inv87.4%
add-sqr-sqrt41.6%
add-sqr-sqrt87.4%
associate--l+90.0%
Applied egg-rr90.0%
+-inverses90.0%
metadata-eval90.0%
*-lft-identity90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in t around inf 46.5%
Taylor expanded in y around inf 43.7%
Final simplification36.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 2.0) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- 2.0 (+ (sqrt x) (sqrt y)))) (+ (* 0.5 (sqrt (/ 1.0 z))) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.0) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.0d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (2.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.0) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.0: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (2.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.0)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 - (sqrt(x) + sqrt(y)));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 2Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 54.2%
Taylor expanded in t around inf 33.4%
Taylor expanded in y around 0 32.6%
+-commutative32.6%
Simplified32.6%
if 2 < y Initial program 84.2%
associate-+l+84.2%
sub-neg84.2%
sub-neg84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in x around 0 47.1%
Taylor expanded in t around inf 28.4%
Taylor expanded in y around inf 28.4%
Taylor expanded in z around inf 15.7%
Final simplification24.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.7) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- 1.0 (sqrt x))) (+ (* 0.5 (sqrt (/ 1.0 z))) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.7) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 - sqrt(x));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.7d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 - sqrt(x))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.7) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 - Math.sqrt(x));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.7: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 - math.sqrt(x)) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.7) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 - sqrt(x))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.7)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 - sqrt(x));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.7], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1.69999999999999996Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 54.2%
Taylor expanded in t around inf 33.4%
Taylor expanded in y around inf 11.1%
if 1.69999999999999996 < y Initial program 84.2%
associate-+l+84.2%
sub-neg84.2%
sub-neg84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in x around 0 47.1%
Taylor expanded in t around inf 28.4%
Taylor expanded in y around inf 28.4%
Taylor expanded in z around inf 15.7%
Final simplification13.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 2.1)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- 1.0 (sqrt x)))
(+
(- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x))
(* (sqrt (/ 1.0 z)) -0.5))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.1) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 - sqrt(x));
} else {
tmp = ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x)) + (sqrt((1.0 / z)) * -0.5);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.1d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 - sqrt(x))
else
tmp = ((1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x)) + (sqrt((1.0d0 / z)) * (-0.5d0))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.1) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 - Math.sqrt(x));
} else {
tmp = ((1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x)) + (Math.sqrt((1.0 / z)) * -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.1: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 - math.sqrt(x)) else: tmp = ((1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x)) + (math.sqrt((1.0 / z)) * -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.1) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 - sqrt(x))); else tmp = Float64(Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x)) + Float64(sqrt(Float64(1.0 / z)) * -0.5)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.1)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 - sqrt(x));
else
tmp = ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x)) + (sqrt((1.0 / z)) * -0.5);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.1], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right) + \sqrt{\frac{1}{z}} \cdot -0.5\\
\end{array}
\end{array}
if y < 2.10000000000000009Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 54.2%
Taylor expanded in t around inf 33.4%
Taylor expanded in y around inf 11.1%
if 2.10000000000000009 < y Initial program 84.2%
associate-+l+84.2%
sub-neg84.2%
sub-neg84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in x around 0 47.1%
Taylor expanded in t around inf 28.4%
Taylor expanded in y around inf 28.4%
Taylor expanded in z around -inf 14.1%
Final simplification12.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (sqrt((1.0 + z)) - sqrt(z)) + (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 = (sqrt((1.0d0 + z)) - sqrt(z)) + (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 (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 - Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 - math.sqrt(x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 - sqrt(x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (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[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 - \sqrt{x}\right)
\end{array}
Initial program 91.8%
associate-+l+91.8%
sub-neg91.8%
sub-neg91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in x around 0 50.9%
Taylor expanded in t around inf 31.1%
Taylor expanded in y around inf 18.8%
Final simplification18.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.0037) (- (- 1.0 (sqrt x)) (sqrt z)) (- (* 0.5 (sqrt (/ 1.0 z))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.0037) {
tmp = (1.0 - sqrt(x)) - sqrt(z);
} else {
tmp = (0.5 * sqrt((1.0 / z))) - 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.0037d0) then
tmp = (1.0d0 - sqrt(x)) - sqrt(z)
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) - 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.0037) {
tmp = (1.0 - Math.sqrt(x)) - Math.sqrt(z);
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) - 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.0037: tmp = (1.0 - math.sqrt(x)) - math.sqrt(z) else: tmp = (0.5 * math.sqrt((1.0 / z))) - 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.0037) tmp = Float64(Float64(1.0 - sqrt(x)) - sqrt(z)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - 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.0037)
tmp = (1.0 - sqrt(x)) - sqrt(z);
else
tmp = (0.5 * sqrt((1.0 / z))) - 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.0037], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $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.0037:\\
\;\;\;\;\left(1 - \sqrt{x}\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} - \sqrt{x}\\
\end{array}
\end{array}
if z < 0.0037000000000000002Initial 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 49.2%
Taylor expanded in t around inf 31.2%
Taylor expanded in x around inf 9.6%
mul-1-neg9.6%
Simplified9.6%
Taylor expanded in z around 0 9.6%
associate--r+9.6%
Simplified9.6%
if 0.0037000000000000002 < z Initial 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.6%
Taylor expanded in t around inf 31.0%
Taylor expanded in x around inf 1.8%
mul-1-neg1.8%
Simplified1.8%
Taylor expanded in z around inf 3.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ 1.0 (* z 0.5)) (+ (sqrt x) (sqrt z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (z * 0.5)) - (sqrt(x) + sqrt(z));
}
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 + (z * 0.5d0)) - (sqrt(x) + sqrt(z))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (z * 0.5)) - (Math.sqrt(x) + Math.sqrt(z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (z * 0.5)) - (math.sqrt(x) + math.sqrt(z))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(z * 0.5)) - Float64(sqrt(x) + sqrt(z))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (z * 0.5)) - (sqrt(x) + sqrt(z));
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[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + z \cdot 0.5\right) - \left(\sqrt{x} + \sqrt{z}\right)
\end{array}
Initial program 91.8%
associate-+l+91.8%
sub-neg91.8%
sub-neg91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in x around 0 50.9%
Taylor expanded in t around inf 31.1%
Taylor expanded in x around inf 5.6%
mul-1-neg5.6%
Simplified5.6%
Taylor expanded in z around 0 7.0%
Final simplification7.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (- 1.0 (sqrt x)) (sqrt z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 - sqrt(x)) - sqrt(z);
}
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(z)
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(z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 - math.sqrt(x)) - math.sqrt(z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 - sqrt(x)) - sqrt(z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 - sqrt(x)) - sqrt(z);
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[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 - \sqrt{x}\right) - \sqrt{z}
\end{array}
Initial program 91.8%
associate-+l+91.8%
sub-neg91.8%
sub-neg91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in x around 0 50.9%
Taylor expanded in t around inf 31.1%
Taylor expanded in x around inf 5.6%
mul-1-neg5.6%
Simplified5.6%
Taylor expanded in z around 0 5.3%
associate--r+5.3%
Simplified5.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt 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.8%
associate-+l+91.8%
sub-neg91.8%
sub-neg91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in x around 0 50.9%
Taylor expanded in t around inf 31.1%
Taylor expanded in x around inf 5.6%
mul-1-neg5.6%
Simplified5.6%
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 2024100
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))