
(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 16 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 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 14.2)
(+
(+ 1.0 (* y 0.5))
(-
(+ t_1 (- (- t_2 (sqrt x)) (sqrt z)))
(+ (sqrt y) (/ -1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))))
(+
(+ (/ 1.0 (+ t_2 (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(/ 1.0 (+ t_1 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 14.2) {
tmp = (1.0 + (y * 0.5)) + ((t_1 + ((t_2 - sqrt(x)) - sqrt(z))) - (sqrt(y) + (-1.0 / (sqrt(t) + sqrt((1.0 + t))))));
} else {
tmp = ((1.0 / (t_2 + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (z <= 14.2d0) then
tmp = (1.0d0 + (y * 0.5d0)) + ((t_1 + ((t_2 - sqrt(x)) - sqrt(z))) - (sqrt(y) + ((-1.0d0) / (sqrt(t) + sqrt((1.0d0 + t))))))
else
tmp = ((1.0d0 / (t_2 + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (1.0d0 / (t_1 + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 14.2) {
tmp = (1.0 + (y * 0.5)) + ((t_1 + ((t_2 - Math.sqrt(x)) - Math.sqrt(z))) - (Math.sqrt(y) + (-1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t))))));
} else {
tmp = ((1.0 / (t_2 + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (1.0 / (t_1 + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 14.2: tmp = (1.0 + (y * 0.5)) + ((t_1 + ((t_2 - math.sqrt(x)) - math.sqrt(z))) - (math.sqrt(y) + (-1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))))) else: tmp = ((1.0 / (t_2 + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (1.0 / (t_1 + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 14.2) tmp = Float64(Float64(1.0 + Float64(y * 0.5)) + Float64(Float64(t_1 + Float64(Float64(t_2 - sqrt(x)) - sqrt(z))) - Float64(sqrt(y) + Float64(-1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t))))))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(1.0 / Float64(t_1 + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 14.2)
tmp = (1.0 + (y * 0.5)) + ((t_1 + ((t_2 - sqrt(x)) - sqrt(z))) - (sqrt(y) + (-1.0 / (sqrt(t) + sqrt((1.0 + t))))));
else
tmp = ((1.0 / (t_2 + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 14.2], N[(N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(-1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[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 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 14.2:\\
\;\;\;\;\left(1 + y \cdot 0.5\right) + \left(\left(t\_1 + \left(\left(t\_2 - \sqrt{x}\right) - \sqrt{z}\right)\right) - \left(\sqrt{y} + \frac{-1}{\sqrt{t} + \sqrt{1 + t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t\_2 + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{t\_1 + \sqrt{z}}\\
\end{array}
\end{array}
if z < 14.199999999999999Initial program 97.4%
+-commutative97.4%
associate-+r+97.4%
associate-+r-82.4%
associate-+l-71.0%
associate-+r-55.7%
Simplified55.7%
flip--55.9%
add-sqr-sqrt44.5%
add-sqr-sqrt56.0%
+-commutative56.0%
+-commutative56.0%
Applied egg-rr56.0%
associate--r+56.6%
+-inverses56.6%
metadata-eval56.6%
+-commutative56.6%
Simplified56.6%
Taylor expanded in y around 0 54.0%
if 14.199999999999999 < z Initial program 89.8%
associate-+l+89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
flip--90.1%
add-sqr-sqrt70.6%
+-commutative70.6%
add-sqr-sqrt90.4%
+-commutative90.4%
Applied egg-rr90.4%
associate--l+92.3%
+-inverses92.3%
metadata-eval92.3%
Simplified92.3%
flip--92.7%
add-sqr-sqrt77.4%
add-sqr-sqrt93.1%
Applied egg-rr93.1%
associate--l+93.1%
+-inverses93.1%
metadata-eval93.1%
Simplified93.1%
flip--93.5%
add-sqr-sqrt51.5%
add-sqr-sqrt93.7%
Applied egg-rr93.7%
associate--l+96.4%
+-inverses96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in t around inf 52.6%
Final simplification53.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)
\end{array}
Initial program 93.4%
associate-+l+93.4%
+-commutative93.4%
+-commutative93.4%
+-commutative93.4%
Simplified93.4%
flip--93.5%
add-sqr-sqrt72.9%
+-commutative72.9%
add-sqr-sqrt93.7%
+-commutative93.7%
Applied egg-rr93.7%
associate--l+95.0%
+-inverses95.0%
metadata-eval95.0%
Simplified95.0%
flip--95.2%
add-sqr-sqrt75.9%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
associate--l+95.7%
+-inverses95.7%
metadata-eval95.7%
Simplified95.7%
flip--95.9%
add-sqr-sqrt73.8%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
associate--l+97.4%
+-inverses97.4%
metadata-eval97.4%
Simplified97.4%
flip--97.5%
add-sqr-sqrt78.9%
+-commutative78.9%
add-sqr-sqrt98.3%
+-commutative98.3%
Applied egg-rr98.3%
+-commutative98.3%
+-commutative98.3%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (/ 1.0 (+ (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((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (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((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((1.0d0 / (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((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((1.0 / (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((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((1.0 / (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(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(1.0 / 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((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 93.4%
associate-+l+93.4%
+-commutative93.4%
+-commutative93.4%
+-commutative93.4%
Simplified93.4%
flip--93.5%
add-sqr-sqrt72.9%
+-commutative72.9%
add-sqr-sqrt93.7%
+-commutative93.7%
Applied egg-rr93.7%
associate--l+95.0%
+-inverses95.0%
metadata-eval95.0%
Simplified95.0%
flip--95.2%
add-sqr-sqrt75.9%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
associate--l+95.7%
+-inverses95.7%
metadata-eval95.7%
Simplified95.7%
flip--95.9%
add-sqr-sqrt73.8%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
associate--l+97.4%
+-inverses97.4%
metadata-eval97.4%
Simplified97.4%
Final simplification97.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))) (t_2 (sqrt (+ 1.0 z))))
(if (<= t 3.2e+21)
(+
1.0
(-
(+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) (+ t_1 t_2))
(+ (sqrt y) (sqrt z))))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_1 (sqrt y))))
(/ 1.0 (+ t_2 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z));
double tmp;
if (t <= 3.2e+21) {
tmp = 1.0 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_1 + t_2)) - (sqrt(y) + sqrt(z)));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
if (t <= 3.2d+21) then
tmp = 1.0d0 + (((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + (t_1 + t_2)) - (sqrt(y) + sqrt(z)))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_1 + sqrt(y)))) + (1.0d0 / (t_2 + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 3.2e+21) {
tmp = 1.0 + (((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + (t_1 + t_2)) - (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_1 + Math.sqrt(y)))) + (1.0 / (t_2 + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if t <= 3.2e+21: tmp = 1.0 + (((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + (t_1 + t_2)) - (math.sqrt(y) + math.sqrt(z))) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_1 + math.sqrt(y)))) + (1.0 / (t_2 + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 3.2e+21) tmp = Float64(1.0 + Float64(Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + Float64(t_1 + t_2)) - Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + Float64(1.0 / Float64(t_2 + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 3.2e+21)
tmp = 1.0 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_1 + t_2)) - (sqrt(y) + sqrt(z)));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.2e+21], N[(1.0 + N[(N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[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}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 3.2 \cdot 10^{+21}:\\
\;\;\;\;1 + \left(\left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + \left(t\_1 + t\_2\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t\_1 + \sqrt{y}}\right) + \frac{1}{t\_2 + \sqrt{z}}\\
\end{array}
\end{array}
if t < 3.2e21Initial program 95.4%
+-commutative95.4%
associate-+r+95.4%
associate-+r-79.6%
associate-+l-58.7%
associate-+r-55.3%
Simplified43.0%
flip--43.2%
add-sqr-sqrt43.4%
add-sqr-sqrt43.6%
+-commutative43.6%
+-commutative43.6%
Applied egg-rr43.6%
associate--r+44.0%
+-inverses44.0%
metadata-eval44.0%
+-commutative44.0%
Simplified44.0%
Taylor expanded in x around 0 19.1%
associate--l+36.4%
associate-+r+36.4%
+-commutative36.4%
+-commutative36.4%
+-commutative36.4%
Simplified36.4%
if 3.2e21 < t Initial program 90.9%
associate-+l+90.9%
+-commutative90.9%
+-commutative90.9%
+-commutative90.9%
Simplified90.9%
flip--90.9%
add-sqr-sqrt75.7%
+-commutative75.7%
add-sqr-sqrt91.2%
+-commutative91.2%
Applied egg-rr91.2%
associate--l+93.6%
+-inverses93.6%
metadata-eval93.6%
Simplified93.6%
flip--94.1%
add-sqr-sqrt76.6%
add-sqr-sqrt94.3%
Applied egg-rr94.3%
associate--l+94.3%
+-inverses94.3%
metadata-eval94.3%
Simplified94.3%
flip--94.3%
add-sqr-sqrt71.1%
add-sqr-sqrt94.3%
Applied egg-rr94.3%
associate--l+96.8%
+-inverses96.8%
metadata-eval96.8%
Simplified96.8%
Taylor expanded in t around inf 96.8%
Final simplification63.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ 1.0 z))))
(if (<= t 3.2e+21)
(+
1.0
(-
(+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) (+ t_1 t_2))
(+ (sqrt y) (sqrt z))))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- t_1 (sqrt y)))
(- t_2 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z));
double tmp;
if (t <= 3.2e+21) {
tmp = 1.0 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_1 + t_2)) - (sqrt(y) + sqrt(z)));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 - sqrt(y))) + (t_2 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
if (t <= 3.2d+21) then
tmp = 1.0d0 + (((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + (t_1 + t_2)) - (sqrt(y) + sqrt(z)))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_1 - sqrt(y))) + (t_2 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 3.2e+21) {
tmp = 1.0 + (((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + (t_1 + t_2)) - (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_1 - Math.sqrt(y))) + (t_2 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if t <= 3.2e+21: tmp = 1.0 + (((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + (t_1 + t_2)) - (math.sqrt(y) + math.sqrt(z))) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_1 - math.sqrt(y))) + (t_2 - 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)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 3.2e+21) tmp = Float64(1.0 + Float64(Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + Float64(t_1 + t_2)) - Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_1 - sqrt(y))) + Float64(t_2 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 3.2e+21)
tmp = 1.0 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_1 + t_2)) - (sqrt(y) + sqrt(z)));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 - sqrt(y))) + (t_2 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.2e+21], N[(1.0 + N[(N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - 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}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 3.2 \cdot 10^{+21}:\\
\;\;\;\;1 + \left(\left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + \left(t\_1 + t\_2\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t\_1 - \sqrt{y}\right)\right) + \left(t\_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 3.2e21Initial program 95.4%
+-commutative95.4%
associate-+r+95.4%
associate-+r-79.6%
associate-+l-58.7%
associate-+r-55.3%
Simplified43.0%
flip--43.2%
add-sqr-sqrt43.4%
add-sqr-sqrt43.6%
+-commutative43.6%
+-commutative43.6%
Applied egg-rr43.6%
associate--r+44.0%
+-inverses44.0%
metadata-eval44.0%
+-commutative44.0%
Simplified44.0%
Taylor expanded in x around 0 19.1%
associate--l+36.4%
associate-+r+36.4%
+-commutative36.4%
+-commutative36.4%
+-commutative36.4%
Simplified36.4%
if 3.2e21 < t Initial program 90.9%
associate-+l+90.9%
+-commutative90.9%
+-commutative90.9%
+-commutative90.9%
Simplified90.9%
flip--90.9%
add-sqr-sqrt75.7%
+-commutative75.7%
add-sqr-sqrt91.2%
+-commutative91.2%
Applied egg-rr91.2%
associate--l+93.6%
+-inverses93.6%
metadata-eval93.6%
Simplified93.6%
Taylor expanded in t around inf 93.6%
Final simplification62.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 2e+16)
(+
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2e+16) {
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2d+16) then
tmp = (1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2e+16) {
tmp = (1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2e+16: tmp = (1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2e+16) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2e+16)
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2e+16], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $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 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 2e16Initial program 95.9%
associate-+l+95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in x around 0 56.5%
if 2e16 < y Initial program 90.0%
+-commutative90.0%
associate-+r+90.0%
associate-+r-49.4%
associate-+l-22.6%
associate-+r-5.7%
Simplified4.9%
Taylor expanded in t around inf 3.3%
associate--l+22.0%
+-commutative22.0%
associate--l+21.5%
+-commutative21.5%
associate-+r+21.5%
Simplified21.5%
Taylor expanded in y around inf 29.4%
+-commutative29.4%
Simplified29.4%
Taylor expanded in z around inf 22.5%
flip--22.5%
add-sqr-sqrt22.8%
add-sqr-sqrt22.5%
Applied egg-rr22.5%
associate--l+25.9%
+-inverses25.9%
metadata-eval25.9%
Simplified25.9%
Final simplification43.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t 28500000000000.0)
(+
1.0
(- (+ (sqrt (+ 1.0 t)) (+ t_2 t_1)) (+ (sqrt t) (+ (sqrt y) (sqrt z)))))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- t_2 (sqrt y)))
(- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y));
double tmp;
if (t <= 28500000000000.0) {
tmp = 1.0 + ((sqrt((1.0 + t)) + (t_2 + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_2 - sqrt(y))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
if (t <= 28500000000000.0d0) then
tmp = 1.0d0 + ((sqrt((1.0d0 + t)) + (t_2 + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_2 - sqrt(y))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 28500000000000.0) {
tmp = 1.0 + ((Math.sqrt((1.0 + t)) + (t_2 + t_1)) - (Math.sqrt(t) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_2 - Math.sqrt(y))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t <= 28500000000000.0: tmp = 1.0 + ((math.sqrt((1.0 + t)) + (t_2 + t_1)) - (math.sqrt(t) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_2 - math.sqrt(y))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 28500000000000.0) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(t_2 + t_1)) - Float64(sqrt(t) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_2 - sqrt(y))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 28500000000000.0)
tmp = 1.0 + ((sqrt((1.0 + t)) + (t_2 + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_2 - sqrt(y))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 28500000000000.0], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$2 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $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}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 28500000000000:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + t} + \left(t\_2 + t\_1\right)\right) - \left(\sqrt{t} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t\_2 - \sqrt{y}\right)\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 2.85e13Initial program 96.4%
+-commutative96.4%
associate-+r+96.4%
associate-+r-80.4%
associate-+l-58.7%
associate-+r-55.3%
Simplified42.6%
Taylor expanded in x around 0 18.1%
associate--l+35.5%
+-commutative35.5%
+-commutative35.5%
+-commutative35.5%
Simplified35.5%
if 2.85e13 < t Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
flip--89.9%
add-sqr-sqrt74.9%
+-commutative74.9%
add-sqr-sqrt90.2%
+-commutative90.2%
Applied egg-rr90.2%
associate--l+92.5%
+-inverses92.5%
metadata-eval92.5%
Simplified92.5%
Taylor expanded in t around inf 92.4%
Final simplification62.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 y))))
(if (<= z 1.85e-27)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 1.9e+26)
(+ 1.0 (+ t_1 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(+ (sqrt (+ 1.0 x)) (- t_1 (+ (sqrt x) (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 1.85e-27) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 1.9e+26) {
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else {
tmp = sqrt((1.0 + x)) + (t_1 - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 1.85d-27) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 1.9d+26) then
tmp = 1.0d0 + (t_1 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else
tmp = sqrt((1.0d0 + x)) + (t_1 - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.85e-27) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 1.9e+26) {
tmp = 1.0 + (t_1 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((1.0 + x)) + (t_1 - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.85e-27: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 1.9e+26: tmp = 1.0 + (t_1 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) else: tmp = math.sqrt((1.0 + x)) + (t_1 - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.85e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 1.9e+26) tmp = Float64(1.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(t_1 - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.85e-27)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 1.9e+26)
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
else
tmp = sqrt((1.0 + x)) + (t_1 - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.85e-27], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 1.9e+26], N[(1.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.85 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+26}:\\
\;\;\;\;1 + \left(t\_1 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(t\_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 1.85000000000000014e-27Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-81.5%
associate-+l-70.2%
associate-+r-54.3%
Simplified54.3%
Taylor expanded in x around 0 19.4%
associate--l+39.3%
+-commutative39.3%
+-commutative39.3%
+-commutative39.3%
Simplified39.3%
Taylor expanded in y around 0 22.3%
associate--l+44.3%
associate--l+44.3%
Simplified44.3%
Taylor expanded in z around 0 22.3%
associate--l+38.8%
Simplified38.8%
if 1.85000000000000014e-27 < z < 1.9000000000000001e26Initial program 84.8%
+-commutative84.8%
associate-+r+84.8%
associate-+r-73.6%
associate-+l-59.3%
associate-+r-53.4%
Simplified53.4%
Taylor expanded in t around inf 14.3%
associate--l+19.2%
+-commutative19.2%
associate--l+16.8%
+-commutative16.8%
associate-+r+16.8%
Simplified16.8%
Taylor expanded in x around 0 29.8%
associate--l+41.3%
associate--l+41.3%
+-commutative41.3%
Simplified41.3%
if 1.9000000000000001e26 < z Initial program 91.4%
+-commutative91.4%
associate-+r+91.4%
associate-+r-71.6%
associate-+l-60.3%
associate-+r-60.3%
Simplified36.0%
Taylor expanded in t around inf 4.3%
associate--l+22.0%
+-commutative22.0%
associate--l+16.3%
+-commutative16.3%
associate-+r+16.3%
Simplified16.3%
Taylor expanded in z around inf 21.9%
associate--l+34.1%
+-commutative34.1%
Simplified34.1%
Final simplification36.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 3.2e-27)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 7.5e+25)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(+ (sqrt (+ 1.0 x)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.2e-27) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 7.5e+25) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 3.2d-27) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 7.5d+25) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = sqrt((1.0d0 + x)) + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.2e-27) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 7.5e+25) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.2e-27: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 7.5e+25: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3.2e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 7.5e+25) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 3.2e-27)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 7.5e+25)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 3.2e-27], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 7.5e+25], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.2 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 3.19999999999999991e-27Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-81.6%
associate-+l-70.5%
associate-+r-54.7%
Simplified54.7%
Taylor expanded in x around 0 19.3%
associate--l+39.1%
+-commutative39.1%
+-commutative39.1%
+-commutative39.1%
Simplified39.1%
Taylor expanded in y around 0 22.1%
associate--l+44.7%
associate--l+44.7%
Simplified44.7%
Taylor expanded in z around 0 22.1%
associate--l+38.7%
Simplified38.7%
if 3.19999999999999991e-27 < z < 7.49999999999999993e25Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-72.5%
associate-+l-57.6%
associate-+r-51.4%
Simplified51.4%
Taylor expanded in x around 0 22.2%
associate--l+36.2%
+-commutative36.2%
+-commutative36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in y around 0 26.9%
associate--l+35.5%
associate--l+35.5%
Simplified35.5%
Taylor expanded in t around inf 42.2%
associate--l+42.2%
Simplified42.2%
if 7.49999999999999993e25 < z Initial program 91.4%
+-commutative91.4%
associate-+r+91.4%
associate-+r-71.6%
associate-+l-60.3%
associate-+r-60.3%
Simplified36.0%
Taylor expanded in t around inf 4.3%
associate--l+22.0%
+-commutative22.0%
associate--l+16.3%
+-commutative16.3%
associate-+r+16.3%
Simplified16.3%
Taylor expanded in z around inf 21.9%
associate--l+34.1%
+-commutative34.1%
Simplified34.1%
Final simplification36.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 4.8e-27)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 7.5e+25)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.8e-27) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 7.5e+25) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 4.8d-27) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 7.5d+25) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.8e-27) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 7.5e+25) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4.8e-27: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 7.5e+25: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4.8e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 7.5e+25) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 4.8e-27)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 7.5e+25)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.8e-27], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 7.5e+25], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.8 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 4.80000000000000004e-27Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-81.6%
associate-+l-70.5%
associate-+r-54.7%
Simplified54.7%
Taylor expanded in x around 0 19.3%
associate--l+39.1%
+-commutative39.1%
+-commutative39.1%
+-commutative39.1%
Simplified39.1%
Taylor expanded in y around 0 22.1%
associate--l+44.7%
associate--l+44.7%
Simplified44.7%
Taylor expanded in z around 0 22.1%
associate--l+38.7%
Simplified38.7%
if 4.80000000000000004e-27 < z < 7.49999999999999993e25Initial program 84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+r-72.5%
associate-+l-57.6%
associate-+r-51.4%
Simplified51.4%
Taylor expanded in x around 0 22.2%
associate--l+36.2%
+-commutative36.2%
+-commutative36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in y around 0 26.9%
associate--l+35.5%
associate--l+35.5%
Simplified35.5%
Taylor expanded in t around inf 42.2%
associate--l+42.2%
Simplified42.2%
if 7.49999999999999993e25 < z Initial program 91.4%
+-commutative91.4%
associate-+r+91.4%
associate-+r-71.6%
associate-+l-60.3%
associate-+r-60.3%
Simplified36.0%
Taylor expanded in t around inf 4.3%
associate--l+22.0%
+-commutative22.0%
associate--l+16.3%
+-commutative16.3%
associate-+r+16.3%
Simplified16.3%
Taylor expanded in z around inf 21.9%
Taylor expanded in x around 0 34.2%
associate--l+54.3%
Simplified54.3%
Final simplification46.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 x)) (sqrt x)))) (if (<= y 0.7) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 0.7) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 0.7d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 0.7) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 0.7: tmp = 1.0 + t_1 else: tmp = 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 + x)) - sqrt(x)) tmp = 0.0 if (y <= 0.7) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 0.7)
tmp = 1.0 + t_1;
else
tmp = 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 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.7], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 0.7:\\
\;\;\;\;1 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < 0.69999999999999996Initial program 96.8%
+-commutative96.8%
associate-+r+96.8%
associate-+r-96.8%
associate-+l-96.8%
associate-+r-96.8%
Simplified76.3%
Taylor expanded in t around inf 17.2%
associate--l+21.6%
+-commutative21.6%
associate--l+21.7%
+-commutative21.7%
associate-+r+21.7%
Simplified21.7%
Taylor expanded in y around inf 11.7%
+-commutative11.7%
Simplified11.7%
Taylor expanded in z around 0 22.5%
associate--l+38.0%
Simplified38.0%
if 0.69999999999999996 < y Initial program 89.2%
+-commutative89.2%
associate-+r+89.2%
associate-+r-50.8%
associate-+l-25.3%
associate-+r-9.3%
Simplified8.0%
Taylor expanded in t around inf 4.0%
associate--l+22.1%
+-commutative22.1%
associate--l+21.7%
+-commutative21.7%
associate-+r+21.7%
Simplified21.7%
Taylor expanded in y around inf 29.1%
+-commutative29.1%
Simplified29.1%
Taylor expanded in z around inf 22.5%
Final simplification31.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 6e+15) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 6e15Initial program 95.9%
+-commutative95.9%
associate-+r+95.9%
associate-+r-95.9%
associate-+l-95.9%
associate-+r-95.9%
Simplified75.8%
Taylor expanded in t around inf 17.2%
associate--l+21.7%
+-commutative21.7%
associate--l+21.8%
+-commutative21.8%
associate-+r+21.8%
Simplified21.8%
Taylor expanded in z around inf 23.4%
Taylor expanded in x around 0 48.0%
associate--l+48.0%
Simplified48.0%
if 6e15 < y Initial program 90.0%
+-commutative90.0%
associate-+r+90.0%
associate-+r-49.4%
associate-+l-22.6%
associate-+r-5.7%
Simplified4.9%
Taylor expanded in t around inf 3.3%
associate--l+22.0%
+-commutative22.0%
associate--l+21.5%
+-commutative21.5%
associate-+r+21.5%
Simplified21.5%
Taylor expanded in y around inf 29.4%
+-commutative29.4%
Simplified29.4%
Taylor expanded in z around inf 22.5%
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 (if (<= z 7.5e+25) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 7.5e+25) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 7.5d+25) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 7.5e+25) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 7.5e+25: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 7.5e+25) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 7.5e+25)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 7.5e+25], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.5 \cdot 10^{+25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 7.49999999999999993e25Initial program 95.2%
+-commutative95.2%
associate-+r+95.2%
associate-+r-80.1%
associate-+l-68.2%
associate-+r-54.1%
Simplified54.1%
Taylor expanded in x around 0 19.8%
associate--l+38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
Simplified38.6%
Taylor expanded in y around 0 23.0%
associate--l+43.1%
associate--l+43.1%
Simplified43.1%
Taylor expanded in t around inf 45.5%
associate--l+45.5%
Simplified45.5%
if 7.49999999999999993e25 < z Initial program 91.4%
+-commutative91.4%
associate-+r+91.4%
associate-+r-71.6%
associate-+l-60.3%
associate-+r-60.3%
Simplified36.0%
Taylor expanded in t around inf 4.3%
associate--l+22.0%
+-commutative22.0%
associate--l+16.3%
+-commutative16.3%
associate-+r+16.3%
Simplified16.3%
Taylor expanded in z around inf 21.9%
Taylor expanded in x around 0 34.2%
associate--l+54.3%
Simplified54.3%
Final simplification49.8%
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 x)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((1.0 + x)) - 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 + x)) - 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 + x)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((1.0 + x)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((1.0 + x)) - 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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{1 + x} - \sqrt{x}
\end{array}
Initial program 93.4%
+-commutative93.4%
associate-+r+93.4%
associate-+r-75.9%
associate-+l-64.4%
associate-+r-57.1%
Simplified45.3%
Taylor expanded in t around inf 11.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.7%
+-commutative21.7%
associate-+r+21.7%
Simplified21.7%
Taylor expanded in y around inf 19.6%
+-commutative19.6%
Simplified19.6%
Taylor expanded in z around inf 16.0%
Final simplification16.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 (* x 0.5)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (x * 0.5)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (x * 0.5)) - 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[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
Initial program 93.4%
+-commutative93.4%
associate-+r+93.4%
associate-+r-75.9%
associate-+l-64.4%
associate-+r-57.1%
Simplified45.3%
Taylor expanded in t around inf 11.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.7%
+-commutative21.7%
associate-+r+21.7%
Simplified21.7%
Taylor expanded in y around inf 19.6%
+-commutative19.6%
Simplified19.6%
Taylor expanded in z around inf 16.0%
Taylor expanded in x around 0 16.7%
Final simplification16.7%
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)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 93.4%
+-commutative93.4%
associate-+r+93.4%
associate-+r-75.9%
associate-+l-64.4%
associate-+r-57.1%
Simplified45.3%
Taylor expanded in t around inf 11.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.7%
+-commutative21.7%
associate-+r+21.7%
Simplified21.7%
Taylor expanded in y around inf 19.6%
+-commutative19.6%
Simplified19.6%
Taylor expanded in z around inf 16.0%
Taylor expanded in x around 0 35.1%
Final simplification35.1%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024031
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 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))))