
(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 22 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 (+ (+ (/ 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 90.6%
associate-+l+90.6%
associate-+l-69.9%
associate-+l-90.6%
sub-neg90.6%
sub-neg90.6%
+-commutative90.6%
+-commutative90.6%
+-commutative90.6%
Simplified90.6%
flip--90.6%
add-sqr-sqrt69.2%
+-commutative69.2%
add-sqr-sqrt90.8%
+-commutative90.8%
Applied egg-rr90.8%
associate--l+92.6%
+-inverses92.6%
metadata-eval92.6%
Simplified92.6%
flip--92.8%
add-sqr-sqrt73.5%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
associate--l+94.9%
+-inverses94.9%
metadata-eval94.9%
Simplified94.9%
flip--95.0%
add-sqr-sqrt75.3%
add-sqr-sqrt95.2%
Applied egg-rr95.2%
associate--l+97.2%
+-inverses97.2%
metadata-eval97.2%
Simplified97.2%
flip--97.4%
add-sqr-sqrt74.4%
+-commutative74.4%
add-sqr-sqrt97.9%
+-commutative97.9%
Applied egg-rr97.9%
+-commutative97.9%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (sqrt (+ 1.0 x)))
(t_5 (/ 1.0 (+ t_4 (sqrt x))))
(t_6 (/ 1.0 (+ t_3 (sqrt z)))))
(if (<=
(+ t_1 (+ (- t_3 (sqrt z)) (+ (- t_4 (sqrt x)) (- t_2 (sqrt y)))))
1.9995)
(+ (+ t_5 (/ 1.0 (+ t_2 (sqrt y)))) t_6)
(+ (+ t_6 t_1) (+ t_5 (/ 1.0 (+ (sqrt y) (+ 1.0 (* 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 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + z));
double t_4 = sqrt((1.0 + x));
double t_5 = 1.0 / (t_4 + sqrt(x));
double t_6 = 1.0 / (t_3 + sqrt(z));
double tmp;
if ((t_1 + ((t_3 - sqrt(z)) + ((t_4 - sqrt(x)) + (t_2 - sqrt(y))))) <= 1.9995) {
tmp = (t_5 + (1.0 / (t_2 + sqrt(y)))) + t_6;
} else {
tmp = (t_6 + t_1) + (t_5 + (1.0 / (sqrt(y) + (1.0 + (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) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + z))
t_4 = sqrt((1.0d0 + x))
t_5 = 1.0d0 / (t_4 + sqrt(x))
t_6 = 1.0d0 / (t_3 + sqrt(z))
if ((t_1 + ((t_3 - sqrt(z)) + ((t_4 - sqrt(x)) + (t_2 - sqrt(y))))) <= 1.9995d0) then
tmp = (t_5 + (1.0d0 / (t_2 + sqrt(y)))) + t_6
else
tmp = (t_6 + t_1) + (t_5 + (1.0d0 / (sqrt(y) + (1.0d0 + (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 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + z));
double t_4 = Math.sqrt((1.0 + x));
double t_5 = 1.0 / (t_4 + Math.sqrt(x));
double t_6 = 1.0 / (t_3 + Math.sqrt(z));
double tmp;
if ((t_1 + ((t_3 - Math.sqrt(z)) + ((t_4 - Math.sqrt(x)) + (t_2 - Math.sqrt(y))))) <= 1.9995) {
tmp = (t_5 + (1.0 / (t_2 + Math.sqrt(y)))) + t_6;
} else {
tmp = (t_6 + t_1) + (t_5 + (1.0 / (Math.sqrt(y) + (1.0 + (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 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + z)) t_4 = math.sqrt((1.0 + x)) t_5 = 1.0 / (t_4 + math.sqrt(x)) t_6 = 1.0 / (t_3 + math.sqrt(z)) tmp = 0 if (t_1 + ((t_3 - math.sqrt(z)) + ((t_4 - math.sqrt(x)) + (t_2 - math.sqrt(y))))) <= 1.9995: tmp = (t_5 + (1.0 / (t_2 + math.sqrt(y)))) + t_6 else: tmp = (t_6 + t_1) + (t_5 + (1.0 / (math.sqrt(y) + (1.0 + (y * 0.5))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + z)) t_4 = sqrt(Float64(1.0 + x)) t_5 = Float64(1.0 / Float64(t_4 + sqrt(x))) t_6 = Float64(1.0 / Float64(t_3 + sqrt(z))) tmp = 0.0 if (Float64(t_1 + Float64(Float64(t_3 - sqrt(z)) + Float64(Float64(t_4 - sqrt(x)) + Float64(t_2 - sqrt(y))))) <= 1.9995) tmp = Float64(Float64(t_5 + Float64(1.0 / Float64(t_2 + sqrt(y)))) + t_6); else tmp = Float64(Float64(t_6 + t_1) + Float64(t_5 + Float64(1.0 / Float64(sqrt(y) + Float64(1.0 + Float64(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 + t)) - sqrt(t);
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + z));
t_4 = sqrt((1.0 + x));
t_5 = 1.0 / (t_4 + sqrt(x));
t_6 = 1.0 / (t_3 + sqrt(z));
tmp = 0.0;
if ((t_1 + ((t_3 - sqrt(z)) + ((t_4 - sqrt(x)) + (t_2 - sqrt(y))))) <= 1.9995)
tmp = (t_5 + (1.0 / (t_2 + sqrt(y)))) + t_6;
else
tmp = (t_6 + t_1) + (t_5 + (1.0 / (sqrt(y) + (1.0 + (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[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(1.0 / N[(t$95$4 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.9995], N[(N[(t$95$5 + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision], N[(N[(t$95$6 + t$95$1), $MachinePrecision] + N[(t$95$5 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + z}\\
t_4 := \sqrt{1 + x}\\
t_5 := \frac{1}{t_4 + \sqrt{x}}\\
t_6 := \frac{1}{t_3 + \sqrt{z}}\\
\mathbf{if}\;t_1 + \left(\left(t_3 - \sqrt{z}\right) + \left(\left(t_4 - \sqrt{x}\right) + \left(t_2 - \sqrt{y}\right)\right)\right) \leq 1.9995:\\
\;\;\;\;\left(t_5 + \frac{1}{t_2 + \sqrt{y}}\right) + t_6\\
\mathbf{else}:\\
\;\;\;\;\left(t_6 + t_1\right) + \left(t_5 + \frac{1}{\sqrt{y} + \left(1 + y \cdot 0.5\right)}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t 1)) (sqrt.f64 t))) < 1.99950000000000006Initial program 76.8%
associate-+l+76.8%
associate-+l-55.2%
associate-+l-76.8%
sub-neg76.8%
sub-neg76.8%
+-commutative76.8%
+-commutative76.8%
+-commutative76.8%
Simplified76.8%
flip--77.0%
add-sqr-sqrt47.4%
+-commutative47.4%
add-sqr-sqrt77.3%
+-commutative77.3%
Applied egg-rr77.3%
associate--l+82.3%
+-inverses82.3%
metadata-eval82.3%
Simplified82.3%
flip--82.5%
add-sqr-sqrt57.6%
add-sqr-sqrt83.1%
Applied egg-rr83.1%
associate--l+88.0%
+-inverses88.0%
metadata-eval88.0%
Simplified88.0%
flip--88.1%
add-sqr-sqrt59.2%
add-sqr-sqrt88.5%
Applied egg-rr88.5%
associate--l+93.4%
+-inverses93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in t around inf 73.4%
if 1.99950000000000006 < (+.f64 (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t 1)) (sqrt.f64 t))) Initial program 98.0%
associate-+l+98.0%
associate-+l-77.9%
associate-+l-98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
flip--98.0%
add-sqr-sqrt81.1%
+-commutative81.1%
add-sqr-sqrt98.1%
+-commutative98.1%
Applied egg-rr98.1%
associate--l+98.2%
+-inverses98.2%
metadata-eval98.2%
Simplified98.2%
flip--98.3%
add-sqr-sqrt82.1%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
associate--l+98.6%
+-inverses98.6%
metadata-eval98.6%
Simplified98.6%
flip--98.8%
add-sqr-sqrt84.0%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
associate--l+99.3%
+-inverses99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 97.1%
*-commutative97.1%
Simplified97.1%
Final simplification88.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 (+ (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 90.6%
associate-+l+90.6%
associate-+l-69.9%
associate-+l-90.6%
sub-neg90.6%
sub-neg90.6%
+-commutative90.6%
+-commutative90.6%
+-commutative90.6%
Simplified90.6%
flip--90.6%
add-sqr-sqrt69.2%
+-commutative69.2%
add-sqr-sqrt90.8%
+-commutative90.8%
Applied egg-rr90.8%
associate--l+92.6%
+-inverses92.6%
metadata-eval92.6%
Simplified92.6%
flip--92.8%
add-sqr-sqrt73.5%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
associate--l+94.9%
+-inverses94.9%
metadata-eval94.9%
Simplified94.9%
flip--95.0%
add-sqr-sqrt75.3%
add-sqr-sqrt95.2%
Applied egg-rr95.2%
associate--l+97.2%
+-inverses97.2%
metadata-eval97.2%
Simplified97.2%
Final simplification97.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))) (t_3 (sqrt (+ 1.0 z))))
(if (<= t 1.45e+28)
(+
t_2
(-
(-
(- t_1 (- (+ (sqrt x) (/ -1.0 (+ (sqrt t) (sqrt (+ 1.0 t))))) t_3))
(sqrt z))
(sqrt y)))
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_2 (sqrt y))))
(/ 1.0 (+ t_3 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + z));
double tmp;
if (t <= 1.45e+28) {
tmp = t_2 + (((t_1 - ((sqrt(x) + (-1.0 / (sqrt(t) + sqrt((1.0 + t))))) - t_3)) - sqrt(z)) - sqrt(y));
} else {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (1.0 / (t_3 + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + z))
if (t <= 1.45d+28) then
tmp = t_2 + (((t_1 - ((sqrt(x) + ((-1.0d0) / (sqrt(t) + sqrt((1.0d0 + t))))) - t_3)) - sqrt(z)) - sqrt(y))
else
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_2 + sqrt(y)))) + (1.0d0 / (t_3 + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 1.45e+28) {
tmp = t_2 + (((t_1 - ((Math.sqrt(x) + (-1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t))))) - t_3)) - Math.sqrt(z)) - Math.sqrt(y));
} else {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_2 + Math.sqrt(y)))) + (1.0 / (t_3 + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if t <= 1.45e+28: tmp = t_2 + (((t_1 - ((math.sqrt(x) + (-1.0 / (math.sqrt(t) + math.sqrt((1.0 + t))))) - t_3)) - math.sqrt(z)) - math.sqrt(y)) else: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_2 + math.sqrt(y)))) + (1.0 / (t_3 + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 1.45e+28) tmp = Float64(t_2 + Float64(Float64(Float64(t_1 - Float64(Float64(sqrt(x) + Float64(-1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t))))) - t_3)) - sqrt(z)) - sqrt(y))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_2 + sqrt(y)))) + Float64(1.0 / Float64(t_3 + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 1.45e+28)
tmp = t_2 + (((t_1 - ((sqrt(x) + (-1.0 / (sqrt(t) + sqrt((1.0 + t))))) - t_3)) - sqrt(z)) - sqrt(y));
else
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (1.0 / (t_3 + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.45e+28], N[(t$95$2 + N[(N[(N[(t$95$1 - N[(N[(N[Sqrt[x], $MachinePrecision] + N[(-1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + 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 + x}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 1.45 \cdot 10^{+28}:\\
\;\;\;\;t_2 + \left(\left(\left(t_1 - \left(\left(\sqrt{x} + \frac{-1}{\sqrt{t} + \sqrt{1 + t}}\right) - t_3\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + \frac{1}{t_3 + \sqrt{z}}\\
\end{array}
\end{array}
if t < 1.4500000000000001e28Initial program 95.4%
Simplified29.7%
flip--29.7%
add-sqr-sqrt29.5%
add-sqr-sqrt29.6%
+-commutative29.6%
+-commutative29.6%
Applied egg-rr29.6%
associate--r+29.7%
+-inverses29.7%
metadata-eval29.7%
+-commutative29.7%
Simplified29.7%
if 1.4500000000000001e28 < t Initial program 84.2%
associate-+l+84.2%
associate-+l-61.7%
associate-+l-84.2%
sub-neg84.2%
sub-neg84.2%
+-commutative84.2%
+-commutative84.2%
+-commutative84.2%
Simplified84.2%
flip--84.4%
add-sqr-sqrt60.6%
+-commutative60.6%
add-sqr-sqrt84.7%
+-commutative84.7%
Applied egg-rr84.7%
associate--l+88.0%
+-inverses88.0%
metadata-eval88.0%
Simplified88.0%
flip--88.2%
add-sqr-sqrt72.8%
add-sqr-sqrt88.7%
Applied egg-rr88.7%
associate--l+92.7%
+-inverses92.7%
metadata-eval92.7%
Simplified92.7%
flip--92.7%
add-sqr-sqrt76.6%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
associate--l+97.2%
+-inverses97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in t around inf 97.2%
Final simplification59.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 y))) (t_2 (sqrt (+ 1.0 x))) (t_3 (sqrt (+ 1.0 z))))
(if (<= t 2.6e+29)
(+
(+ (- t_2 (sqrt x)) (- t_1 (sqrt y)))
(+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) (- t_3 (sqrt z))))
(+
(+ (/ 1.0 (+ t_2 (sqrt x))) (/ 1.0 (+ t_1 (sqrt y))))
(/ 1.0 (+ t_3 (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 + x));
double t_3 = sqrt((1.0 + z));
double tmp;
if (t <= 2.6e+29) {
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_3 - sqrt(z)));
} else {
tmp = ((1.0 / (t_2 + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + (1.0 / (t_3 + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + z))
if (t <= 2.6d+29) then
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + (t_3 - sqrt(z)))
else
tmp = ((1.0d0 / (t_2 + sqrt(x))) + (1.0d0 / (t_1 + sqrt(y)))) + (1.0d0 / (t_3 + 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 + x));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 2.6e+29) {
tmp = ((t_2 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + ((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + (t_3 - Math.sqrt(z)));
} else {
tmp = ((1.0 / (t_2 + Math.sqrt(x))) + (1.0 / (t_1 + Math.sqrt(y)))) + (1.0 / (t_3 + 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 + x)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if t <= 2.6e+29: tmp = ((t_2 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + ((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + (t_3 - math.sqrt(z))) else: tmp = ((1.0 / (t_2 + math.sqrt(x))) + (1.0 / (t_1 + math.sqrt(y)))) + (1.0 / (t_3 + 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 + x)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 2.6e+29) tmp = Float64(Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + Float64(t_3 - sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + Float64(1.0 / Float64(t_3 + 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 + x));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 2.6e+29)
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + (t_3 - sqrt(z)));
else
tmp = ((1.0 / (t_2 + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + (1.0 / (t_3 + 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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.6e+29], N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$2 + 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$3 + 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 + x}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 2.6 \cdot 10^{+29}:\\
\;\;\;\;\left(\left(t_2 - \sqrt{x}\right) + \left(t_1 - \sqrt{y}\right)\right) + \left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + \left(t_3 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_2 + \sqrt{x}} + \frac{1}{t_1 + \sqrt{y}}\right) + \frac{1}{t_3 + \sqrt{z}}\\
\end{array}
\end{array}
if t < 2.6e29Initial program 95.4%
associate-+l+95.4%
associate-+l-75.8%
associate-+l-95.4%
sub-neg95.4%
sub-neg95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
Simplified95.4%
flip--97.6%
add-sqr-sqrt96.6%
+-commutative96.6%
add-sqr-sqrt98.4%
+-commutative98.4%
Applied egg-rr96.5%
+-commutative98.4%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
Simplified97.7%
if 2.6e29 < t Initial program 84.1%
associate-+l+84.1%
associate-+l-62.1%
associate-+l-84.1%
sub-neg84.1%
sub-neg84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
flip--84.3%
add-sqr-sqrt61.1%
+-commutative61.1%
add-sqr-sqrt84.6%
+-commutative84.6%
Applied egg-rr84.6%
associate--l+88.0%
+-inverses88.0%
metadata-eval88.0%
Simplified88.0%
flip--88.2%
add-sqr-sqrt72.6%
add-sqr-sqrt88.6%
Applied egg-rr88.6%
associate--l+92.7%
+-inverses92.7%
metadata-eval92.7%
Simplified92.7%
flip--92.7%
add-sqr-sqrt76.4%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
associate--l+97.2%
+-inverses97.2%
metadata-eval97.2%
Simplified97.2%
Taylor expanded in t around inf 97.2%
Final simplification97.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z)))))
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)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - 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((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - 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((1.0 + x)) + Math.sqrt(x))) + (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)));
}
[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)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z)))
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(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))) 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)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - 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[(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[(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]
\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(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)
\end{array}
Initial program 90.6%
associate-+l+90.6%
associate-+l-69.9%
associate-+l-90.6%
sub-neg90.6%
sub-neg90.6%
+-commutative90.6%
+-commutative90.6%
+-commutative90.6%
Simplified90.6%
flip--90.6%
add-sqr-sqrt69.2%
+-commutative69.2%
add-sqr-sqrt90.8%
+-commutative90.8%
Applied egg-rr90.8%
associate--l+92.6%
+-inverses92.6%
metadata-eval92.6%
Simplified92.6%
flip--92.8%
add-sqr-sqrt73.5%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
associate--l+94.9%
+-inverses94.9%
metadata-eval94.9%
Simplified94.9%
Final simplification94.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))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t 1100000000.0)
(+
t_2
(-
(-
(+ t_1 (+ 1.0 (sqrt (+ 1.0 t))))
(/ (+ (pow z 1.5) (pow t 1.5)) (- (+ z t) (sqrt (* z t)))))
(sqrt y)))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_2 (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 + y));
double tmp;
if (t <= 1100000000.0) {
tmp = t_2 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - ((pow(z, 1.5) + pow(t, 1.5)) / ((z + t) - sqrt((z * t))))) - sqrt(y));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + 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 + y))
if (t <= 1100000000.0d0) then
tmp = t_2 + (((t_1 + (1.0d0 + sqrt((1.0d0 + t)))) - (((z ** 1.5d0) + (t ** 1.5d0)) / ((z + t) - sqrt((z * t))))) - sqrt(y))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_2 + 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 + y));
double tmp;
if (t <= 1100000000.0) {
tmp = t_2 + (((t_1 + (1.0 + Math.sqrt((1.0 + t)))) - ((Math.pow(z, 1.5) + Math.pow(t, 1.5)) / ((z + t) - Math.sqrt((z * t))))) - Math.sqrt(y));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_2 + 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 + y)) tmp = 0 if t <= 1100000000.0: tmp = t_2 + (((t_1 + (1.0 + math.sqrt((1.0 + t)))) - ((math.pow(z, 1.5) + math.pow(t, 1.5)) / ((z + t) - math.sqrt((z * t))))) - math.sqrt(y)) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_2 + 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 + y)) tmp = 0.0 if (t <= 1100000000.0) tmp = Float64(t_2 + Float64(Float64(Float64(t_1 + Float64(1.0 + sqrt(Float64(1.0 + t)))) - Float64(Float64((z ^ 1.5) + (t ^ 1.5)) / Float64(Float64(z + t) - sqrt(Float64(z * t))))) - sqrt(y))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_2 + 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 + y));
tmp = 0.0;
if (t <= 1100000000.0)
tmp = t_2 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - (((z ^ 1.5) + (t ^ 1.5)) / ((z + t) - sqrt((z * t))))) - sqrt(y));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1100000000.0], N[(t$95$2 + N[(N[(N[(t$95$1 + N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[z, 1.5], $MachinePrecision] + N[Power[t, 1.5], $MachinePrecision]), $MachinePrecision] / N[(N[(z + t), $MachinePrecision] - N[Sqrt[N[(z * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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$2 + 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 + y}\\
\mathbf{if}\;t \leq 1100000000:\\
\;\;\;\;t_2 + \left(\left(\left(t_1 + \left(1 + \sqrt{1 + t}\right)\right) - \frac{{z}^{1.5} + {t}^{1.5}}{\left(z + t\right) - \sqrt{z \cdot t}}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + \frac{1}{t_1 + \sqrt{z}}\\
\end{array}
\end{array}
if t < 1.1e9Initial program 97.6%
Simplified29.3%
Taylor expanded in x around 0 27.3%
associate-+r+27.3%
Simplified27.3%
flip3-+25.2%
pow1/225.2%
pow-pow25.2%
metadata-eval25.2%
pow1/225.2%
pow-pow23.8%
metadata-eval23.8%
add-sqr-sqrt23.8%
add-sqr-sqrt25.6%
pow1/225.6%
pow1/225.6%
pow-prod-down25.6%
Applied egg-rr25.6%
+-commutative25.6%
associate-+r-25.6%
unpow1/225.6%
Simplified25.6%
if 1.1e9 < t Initial program 83.1%
associate-+l+83.1%
associate-+l-59.8%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
flip--83.2%
add-sqr-sqrt59.6%
+-commutative59.6%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
Simplified86.5%
flip--86.7%
add-sqr-sqrt71.0%
add-sqr-sqrt87.1%
Applied egg-rr87.1%
associate--l+90.6%
+-inverses90.6%
metadata-eval90.6%
Simplified90.6%
flip--90.7%
add-sqr-sqrt75.0%
add-sqr-sqrt91.0%
Applied egg-rr91.0%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 94.0%
Final simplification58.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))) (t_2 (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))
(if (<= t 1.8e+17)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- t_1 (sqrt z)))
(+ t_2 (/ 1.0 (+ 1.0 (sqrt y)))))
(+
(+ t_2 (/ 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 = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
double tmp;
if (t <= 1.8e+17) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (t_2 + (1.0 / (1.0 + sqrt(y))));
} else {
tmp = (t_2 + (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 = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
if (t <= 1.8d+17) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (t_2 + (1.0d0 / (1.0d0 + sqrt(y))))
else
tmp = (t_2 + (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 = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
double tmp;
if (t <= 1.8e+17) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_1 - Math.sqrt(z))) + (t_2 + (1.0 / (1.0 + Math.sqrt(y))));
} else {
tmp = (t_2 + (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 = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) tmp = 0 if t <= 1.8e+17: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_1 - math.sqrt(z))) + (t_2 + (1.0 / (1.0 + math.sqrt(y)))) else: tmp = (t_2 + (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 = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) tmp = 0.0 if (t <= 1.8e+17) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_1 - sqrt(z))) + Float64(t_2 + Float64(1.0 / Float64(1.0 + sqrt(y))))); else tmp = Float64(Float64(t_2 + 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 = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
tmp = 0.0;
if (t <= 1.8e+17)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (t_2 + (1.0 / (1.0 + sqrt(y))));
else
tmp = (t_2 + (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[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.8e+17], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(1.0 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + 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 := \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\mathbf{if}\;t \leq 1.8 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t_1 - \sqrt{z}\right)\right) + \left(t_2 + \frac{1}{1 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_2 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{t_1 + \sqrt{z}}\\
\end{array}
\end{array}
if t < 1.8e17Initial program 96.4%
associate-+l+96.4%
associate-+l-77.7%
associate-+l-96.4%
sub-neg96.4%
sub-neg96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.4%
add-sqr-sqrt76.7%
+-commutative76.7%
add-sqr-sqrt96.5%
+-commutative96.5%
Applied egg-rr96.5%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified97.1%
flip--97.3%
add-sqr-sqrt74.9%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in y around 0 94.7%
if 1.8e17 < t Initial program 83.9%
associate-+l+83.9%
associate-+l-61.1%
associate-+l-83.9%
sub-neg83.9%
sub-neg83.9%
+-commutative83.9%
+-commutative83.9%
+-commutative83.9%
Simplified83.9%
flip--84.0%
add-sqr-sqrt60.6%
+-commutative60.6%
add-sqr-sqrt84.3%
+-commutative84.3%
Applied egg-rr84.3%
associate--l+87.4%
+-inverses87.4%
metadata-eval87.4%
Simplified87.4%
flip--87.6%
add-sqr-sqrt71.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
associate--l+91.8%
+-inverses91.8%
metadata-eval91.8%
Simplified91.8%
flip--91.8%
add-sqr-sqrt76.2%
add-sqr-sqrt92.1%
Applied egg-rr92.1%
associate--l+96.0%
+-inverses96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in t around inf 96.0%
Final simplification95.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t 24000000000.0)
(+
t_2
(-
(- (+ t_1 (+ 1.0 (sqrt (+ 1.0 t)))) (/ (- t z) (- (sqrt t) (sqrt z))))
(sqrt y)))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ 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 <= 24000000000.0) {
tmp = t_2 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - ((t - z) / (sqrt(t) - sqrt(z)))) - sqrt(y));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (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 <= 24000000000.0d0) then
tmp = t_2 + (((t_1 + (1.0d0 + sqrt((1.0d0 + t)))) - ((t - z) / (sqrt(t) - sqrt(z)))) - sqrt(y))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (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 <= 24000000000.0) {
tmp = t_2 + (((t_1 + (1.0 + Math.sqrt((1.0 + t)))) - ((t - z) / (Math.sqrt(t) - Math.sqrt(z)))) - Math.sqrt(y));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (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 <= 24000000000.0: tmp = t_2 + (((t_1 + (1.0 + math.sqrt((1.0 + t)))) - ((t - z) / (math.sqrt(t) - math.sqrt(z)))) - math.sqrt(y)) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (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 <= 24000000000.0) tmp = Float64(t_2 + Float64(Float64(Float64(t_1 + Float64(1.0 + sqrt(Float64(1.0 + t)))) - Float64(Float64(t - z) / Float64(sqrt(t) - sqrt(z)))) - sqrt(y))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / 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 <= 24000000000.0)
tmp = t_2 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - ((t - z) / (sqrt(t) - sqrt(z)))) - sqrt(y));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (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, 24000000000.0], N[(t$95$2 + N[(N[(N[(t$95$1 + N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t - z), $MachinePrecision] / N[(N[Sqrt[t], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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$2 + N[Sqrt[y], $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}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 24000000000:\\
\;\;\;\;t_2 + \left(\left(\left(t_1 + \left(1 + \sqrt{1 + t}\right)\right) - \frac{t - z}{\sqrt{t} - \sqrt{z}}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + \left(t_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 2.4e10Initial program 97.6%
Simplified29.3%
Taylor expanded in x around 0 27.3%
associate-+r+27.3%
Simplified27.3%
flip-+27.3%
add-sqr-sqrt27.3%
add-sqr-sqrt25.0%
Applied egg-rr25.0%
if 2.4e10 < t Initial program 83.1%
associate-+l+83.1%
associate-+l-59.8%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
flip--83.2%
add-sqr-sqrt59.6%
+-commutative59.6%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
Simplified86.5%
flip--86.7%
add-sqr-sqrt71.0%
add-sqr-sqrt87.1%
Applied egg-rr87.1%
associate--l+90.6%
+-inverses90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in t around inf 89.9%
Final simplification56.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t 110000000.0)
(+
t_2
(-
(- (+ t_1 (+ 1.0 (sqrt (+ 1.0 t)))) (/ (- t z) (- (sqrt t) (sqrt z))))
(sqrt y)))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_2 (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 + y));
double tmp;
if (t <= 110000000.0) {
tmp = t_2 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - ((t - z) / (sqrt(t) - sqrt(z)))) - sqrt(y));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + 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 + y))
if (t <= 110000000.0d0) then
tmp = t_2 + (((t_1 + (1.0d0 + sqrt((1.0d0 + t)))) - ((t - z) / (sqrt(t) - sqrt(z)))) - sqrt(y))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_2 + 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 + y));
double tmp;
if (t <= 110000000.0) {
tmp = t_2 + (((t_1 + (1.0 + Math.sqrt((1.0 + t)))) - ((t - z) / (Math.sqrt(t) - Math.sqrt(z)))) - Math.sqrt(y));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_2 + 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 + y)) tmp = 0 if t <= 110000000.0: tmp = t_2 + (((t_1 + (1.0 + math.sqrt((1.0 + t)))) - ((t - z) / (math.sqrt(t) - math.sqrt(z)))) - math.sqrt(y)) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_2 + 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 + y)) tmp = 0.0 if (t <= 110000000.0) tmp = Float64(t_2 + Float64(Float64(Float64(t_1 + Float64(1.0 + sqrt(Float64(1.0 + t)))) - Float64(Float64(t - z) / Float64(sqrt(t) - sqrt(z)))) - sqrt(y))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_2 + 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 + y));
tmp = 0.0;
if (t <= 110000000.0)
tmp = t_2 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - ((t - z) / (sqrt(t) - sqrt(z)))) - sqrt(y));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_2 + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 110000000.0], N[(t$95$2 + N[(N[(N[(t$95$1 + N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(t - z), $MachinePrecision] / N[(N[Sqrt[t], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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$2 + 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 + y}\\
\mathbf{if}\;t \leq 110000000:\\
\;\;\;\;t_2 + \left(\left(\left(t_1 + \left(1 + \sqrt{1 + t}\right)\right) - \frac{t - z}{\sqrt{t} - \sqrt{z}}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + \frac{1}{t_1 + \sqrt{z}}\\
\end{array}
\end{array}
if t < 1.1e8Initial program 97.6%
Simplified29.3%
Taylor expanded in x around 0 27.3%
associate-+r+27.3%
Simplified27.3%
flip-+27.3%
add-sqr-sqrt27.3%
add-sqr-sqrt25.0%
Applied egg-rr25.0%
if 1.1e8 < t Initial program 83.1%
associate-+l+83.1%
associate-+l-59.8%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
flip--83.2%
add-sqr-sqrt59.6%
+-commutative59.6%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
Simplified86.5%
flip--86.7%
add-sqr-sqrt71.0%
add-sqr-sqrt87.1%
Applied egg-rr87.1%
associate--l+90.6%
+-inverses90.6%
metadata-eval90.6%
Simplified90.6%
flip--90.7%
add-sqr-sqrt75.0%
add-sqr-sqrt91.0%
Applied egg-rr91.0%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in t around inf 94.0%
Final simplification58.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))))
(if (<= t 95000000.0)
(+
1.0
(- (- (+ t_1 (+ 1.0 (sqrt (+ 1.0 t)))) (+ (sqrt z) (sqrt t))) (sqrt y)))
(+
(+
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (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 tmp;
if (t <= 95000000.0) {
tmp = 1.0 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - (sqrt(z) + sqrt(t))) - sqrt(y));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + 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) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 95000000.0d0) then
tmp = 1.0d0 + (((t_1 + (1.0d0 + sqrt((1.0d0 + t)))) - (sqrt(z) + sqrt(t))) - sqrt(y))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + 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 tmp;
if (t <= 95000000.0) {
tmp = 1.0 + (((t_1 + (1.0 + Math.sqrt((1.0 + t)))) - (Math.sqrt(z) + Math.sqrt(t))) - Math.sqrt(y));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + 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)) tmp = 0 if t <= 95000000.0: tmp = 1.0 + (((t_1 + (1.0 + math.sqrt((1.0 + t)))) - (math.sqrt(z) + math.sqrt(t))) - math.sqrt(y)) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + 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)) tmp = 0.0 if (t <= 95000000.0) tmp = Float64(1.0 + Float64(Float64(Float64(t_1 + Float64(1.0 + sqrt(Float64(1.0 + t)))) - Float64(sqrt(z) + sqrt(t))) - sqrt(y))); else tmp = 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(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 (t <= 95000000.0)
tmp = 1.0 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - (sqrt(z) + sqrt(t))) - sqrt(y));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + 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]}, If[LessEqual[t, 95000000.0], N[(1.0 + N[(N[(N[(t$95$1 + N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $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}\;t \leq 95000000:\\
\;\;\;\;1 + \left(\left(\left(t_1 + \left(1 + \sqrt{1 + t}\right)\right) - \left(\sqrt{z} + \sqrt{t}\right)\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(t_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 9.5e7Initial program 97.6%
Simplified29.3%
Taylor expanded in x around 0 27.3%
associate-+r+27.3%
Simplified27.3%
Taylor expanded in y around 0 26.1%
if 9.5e7 < t Initial program 83.1%
associate-+l+83.1%
associate-+l-59.8%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
flip--83.2%
add-sqr-sqrt59.6%
+-commutative59.6%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
Simplified86.5%
flip--86.7%
add-sqr-sqrt71.0%
add-sqr-sqrt87.1%
Applied egg-rr87.1%
associate--l+90.6%
+-inverses90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in t around inf 89.9%
Final simplification57.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 x) (sqrt y)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (sqrt (+ 1.0 x))))
(if (<= z 2.4e-28)
(+ t_2 (- (+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) 2.0) (sqrt y)))
(if (<= z 1.7e+15)
(+ t_3 (+ (sqrt (+ 1.0 z)) (- t_2 (+ (sqrt z) t_1))))
(if (<= z 3.9e+263) (+ t_3 (- t_2 t_1)) (/ 1.0 (+ t_3 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + x));
double tmp;
if (z <= 2.4e-28) {
tmp = t_2 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + 2.0) - sqrt(y));
} else if (z <= 1.7e+15) {
tmp = t_3 + (sqrt((1.0 + z)) + (t_2 - (sqrt(z) + t_1)));
} else if (z <= 3.9e+263) {
tmp = t_3 + (t_2 - t_1);
} else {
tmp = 1.0 / (t_3 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt(x) + sqrt(y)
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + x))
if (z <= 2.4d-28) then
tmp = t_2 + (((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + 2.0d0) - sqrt(y))
else if (z <= 1.7d+15) then
tmp = t_3 + (sqrt((1.0d0 + z)) + (t_2 - (sqrt(z) + t_1)))
else if (z <= 3.9d+263) then
tmp = t_3 + (t_2 - t_1)
else
tmp = 1.0d0 / (t_3 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(x) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 2.4e-28) {
tmp = t_2 + (((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + 2.0) - Math.sqrt(y));
} else if (z <= 1.7e+15) {
tmp = t_3 + (Math.sqrt((1.0 + z)) + (t_2 - (Math.sqrt(z) + t_1)));
} else if (z <= 3.9e+263) {
tmp = t_3 + (t_2 - t_1);
} else {
tmp = 1.0 / (t_3 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if z <= 2.4e-28: tmp = t_2 + (((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + 2.0) - math.sqrt(y)) elif z <= 1.7e+15: tmp = t_3 + (math.sqrt((1.0 + z)) + (t_2 - (math.sqrt(z) + t_1))) elif z <= 3.9e+263: tmp = t_3 + (t_2 - t_1) else: tmp = 1.0 / (t_3 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 2.4e-28) tmp = Float64(t_2 + Float64(Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + 2.0) - sqrt(y))); elseif (z <= 1.7e+15) tmp = Float64(t_3 + Float64(sqrt(Float64(1.0 + z)) + Float64(t_2 - Float64(sqrt(z) + t_1)))); elseif (z <= 3.9e+263) tmp = Float64(t_3 + Float64(t_2 - t_1)); else tmp = Float64(1.0 / Float64(t_3 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(x) + sqrt(y);
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 2.4e-28)
tmp = t_2 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + 2.0) - sqrt(y));
elseif (z <= 1.7e+15)
tmp = t_3 + (sqrt((1.0 + z)) + (t_2 - (sqrt(z) + t_1)));
elseif (z <= 3.9e+263)
tmp = t_3 + (t_2 - t_1);
else
tmp = 1.0 / (t_3 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.4e-28], N[(t$95$2 + N[(N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+15], N[(t$95$3 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(t$95$2 - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+263], N[(t$95$3 + N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 2.4 \cdot 10^{-28}:\\
\;\;\;\;t_2 + \left(\left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + 2\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+15}:\\
\;\;\;\;t_3 + \left(\sqrt{1 + z} + \left(t_2 - \left(\sqrt{z} + t_1\right)\right)\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+263}:\\
\;\;\;\;t_3 + \left(t_2 - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_3 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 2.4000000000000002e-28Initial program 98.1%
Simplified37.1%
Taylor expanded in x around 0 24.4%
associate-+r+24.4%
Simplified24.4%
Taylor expanded in z around 0 24.3%
associate--l+33.4%
Simplified33.4%
flip--99.4%
add-sqr-sqrt75.8%
+-commutative75.8%
add-sqr-sqrt99.4%
+-commutative99.4%
Applied egg-rr33.4%
+-commutative99.4%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
Simplified33.6%
if 2.4000000000000002e-28 < z < 1.7e15Initial program 91.7%
Simplified49.2%
Taylor expanded in t around inf 25.1%
associate--l+29.2%
+-commutative29.2%
associate--l+34.3%
associate-+r+34.3%
+-commutative34.3%
Simplified34.3%
if 1.7e15 < z < 3.90000000000000027e263Initial program 85.5%
Simplified21.6%
Taylor expanded in t around inf 4.6%
associate--l+21.6%
+-commutative21.6%
associate--l+14.4%
associate-+r+14.4%
+-commutative14.4%
Simplified14.4%
Taylor expanded in z around inf 25.7%
if 3.90000000000000027e263 < z Initial program 74.4%
Simplified20.5%
Taylor expanded in t around inf 3.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.2%
associate-+r+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 25.7%
Taylor expanded in y around inf 19.6%
flip--19.6%
add-sqr-sqrt20.1%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
associate--l+26.8%
+-inverses26.8%
metadata-eval26.8%
Simplified26.8%
Final simplification29.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))))
(if (<= t 110000000.0)
(+
1.0
(- (- (+ t_1 (+ 1.0 (sqrt (+ 1.0 t)))) (+ (sqrt z) (sqrt t))) (sqrt y)))
(+
(- t_1 (sqrt z))
(+
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
(- (sqrt (+ 1.0 y)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 110000000.0) {
tmp = 1.0 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - (sqrt(z) + sqrt(t))) - sqrt(y));
} else {
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (sqrt((1.0 + y)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 110000000.0d0) then
tmp = 1.0d0 + (((t_1 + (1.0d0 + sqrt((1.0d0 + t)))) - (sqrt(z) + sqrt(t))) - sqrt(y))
else
tmp = (t_1 - sqrt(z)) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (sqrt((1.0d0 + y)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 110000000.0) {
tmp = 1.0 + (((t_1 + (1.0 + Math.sqrt((1.0 + t)))) - (Math.sqrt(z) + Math.sqrt(t))) - Math.sqrt(y));
} else {
tmp = (t_1 - Math.sqrt(z)) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 110000000.0: tmp = 1.0 + (((t_1 + (1.0 + math.sqrt((1.0 + t)))) - (math.sqrt(z) + math.sqrt(t))) - math.sqrt(y)) else: tmp = (t_1 - math.sqrt(z)) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (math.sqrt((1.0 + y)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 110000000.0) tmp = Float64(1.0 + Float64(Float64(Float64(t_1 + Float64(1.0 + sqrt(Float64(1.0 + t)))) - Float64(sqrt(z) + sqrt(t))) - sqrt(y))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 110000000.0)
tmp = 1.0 + (((t_1 + (1.0 + sqrt((1.0 + t)))) - (sqrt(z) + sqrt(t))) - sqrt(y));
else
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (sqrt((1.0 + y)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 110000000.0], N[(1.0 + N[(N[(N[(t$95$1 + N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 110000000:\\
\;\;\;\;1 + \left(\left(\left(t_1 + \left(1 + \sqrt{1 + t}\right)\right) - \left(\sqrt{z} + \sqrt{t}\right)\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 1.1e8Initial program 97.6%
Simplified29.3%
Taylor expanded in x around 0 27.3%
associate-+r+27.3%
Simplified27.3%
Taylor expanded in y around 0 26.1%
if 1.1e8 < t Initial program 83.1%
associate-+l+83.1%
associate-+l-59.8%
associate-+l-83.1%
sub-neg83.1%
sub-neg83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
flip--83.2%
add-sqr-sqrt59.6%
+-commutative59.6%
add-sqr-sqrt83.4%
+-commutative83.4%
Applied egg-rr83.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
Simplified86.5%
Taylor expanded in t around inf 85.7%
Final simplification55.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.35e-27)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 6.5e+15)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= z 3.9e+263)
(+ t_1 (- t_2 (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ t_1 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 1.35e-27) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 6.5e+15) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (z <= 3.9e+263) {
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (z <= 1.35d-27) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 6.5d+15) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (z <= 3.9d+263) then
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.35e-27) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 6.5e+15) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (z <= 3.9e+263) {
tmp = t_1 + (t_2 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (t_1 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.35e-27: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 6.5e+15: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif z <= 3.9e+263: tmp = t_1 + (t_2 - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (t_1 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.35e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 6.5e+15) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (z <= 3.9e+263) tmp = Float64(t_1 + Float64(t_2 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.35e-27)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 6.5e+15)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (z <= 3.9e+263)
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (t_1 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.35e-27], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 6.5e+15], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+263], N[(t$95$1 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.35 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(t_2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+263}:\\
\;\;\;\;t_1 + \left(t_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 1.34999999999999994e-27Initial program 98.1%
Simplified37.1%
Taylor expanded in x around 0 24.4%
associate-+r+24.4%
Simplified24.4%
Taylor expanded in z around 0 24.3%
associate--l+33.4%
Simplified33.4%
Taylor expanded in y around 0 22.9%
associate--l+37.0%
Simplified37.0%
if 1.34999999999999994e-27 < z < 6.5e15Initial program 91.7%
Simplified49.2%
Taylor expanded in t around inf 25.1%
associate--l+29.2%
+-commutative29.2%
associate--l+34.3%
associate-+r+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in x around 0 27.4%
associate--l+33.2%
associate--l+33.2%
+-commutative33.2%
Simplified33.2%
if 6.5e15 < z < 3.90000000000000027e263Initial program 85.5%
Simplified21.6%
Taylor expanded in t around inf 4.6%
associate--l+21.6%
+-commutative21.6%
associate--l+14.4%
associate-+r+14.4%
+-commutative14.4%
Simplified14.4%
Taylor expanded in z around inf 25.7%
if 3.90000000000000027e263 < z Initial program 74.4%
Simplified20.5%
Taylor expanded in t around inf 3.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.2%
associate-+r+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 25.7%
Taylor expanded in y around inf 19.6%
flip--19.6%
add-sqr-sqrt20.1%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
associate--l+26.8%
+-inverses26.8%
metadata-eval26.8%
Simplified26.8%
Final simplification31.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.9e-27)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 1.3e+15)
(- (+ (sqrt (+ 1.0 z)) (+ 1.0 t_2)) (+ (sqrt y) (sqrt z)))
(if (<= z 3.9e+263)
(+ t_1 (- t_2 (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ t_1 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 1.9e-27) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 1.3e+15) {
tmp = (sqrt((1.0 + z)) + (1.0 + t_2)) - (sqrt(y) + sqrt(z));
} else if (z <= 3.9e+263) {
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (z <= 1.9d-27) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 1.3d+15) then
tmp = (sqrt((1.0d0 + z)) + (1.0d0 + t_2)) - (sqrt(y) + sqrt(z))
else if (z <= 3.9d+263) then
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.9e-27) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 1.3e+15) {
tmp = (Math.sqrt((1.0 + z)) + (1.0 + t_2)) - (Math.sqrt(y) + Math.sqrt(z));
} else if (z <= 3.9e+263) {
tmp = t_1 + (t_2 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (t_1 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.9e-27: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 1.3e+15: tmp = (math.sqrt((1.0 + z)) + (1.0 + t_2)) - (math.sqrt(y) + math.sqrt(z)) elif z <= 3.9e+263: tmp = t_1 + (t_2 - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (t_1 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.9e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 1.3e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(1.0 + t_2)) - Float64(sqrt(y) + sqrt(z))); elseif (z <= 3.9e+263) tmp = Float64(t_1 + Float64(t_2 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.9e-27)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 1.3e+15)
tmp = (sqrt((1.0 + z)) + (1.0 + t_2)) - (sqrt(y) + sqrt(z));
elseif (z <= 3.9e+263)
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (t_1 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.9e-27], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 1.3e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+263], N[(t$95$1 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.9 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} + \left(1 + t_2\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+263}:\\
\;\;\;\;t_1 + \left(t_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 1.9e-27Initial program 98.1%
Simplified37.1%
Taylor expanded in x around 0 24.4%
associate-+r+24.4%
Simplified24.4%
Taylor expanded in z around 0 24.3%
associate--l+33.4%
Simplified33.4%
Taylor expanded in y around 0 22.9%
associate--l+37.0%
Simplified37.0%
if 1.9e-27 < z < 1.3e15Initial program 91.7%
Simplified49.2%
Taylor expanded in t around inf 25.1%
associate--l+29.2%
+-commutative29.2%
associate--l+34.3%
associate-+r+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in x around 0 27.4%
associate-+r+27.4%
+-commutative27.4%
Simplified27.4%
if 1.3e15 < z < 3.90000000000000027e263Initial program 85.5%
Simplified21.6%
Taylor expanded in t around inf 4.6%
associate--l+21.6%
+-commutative21.6%
associate--l+14.4%
associate-+r+14.4%
+-commutative14.4%
Simplified14.4%
Taylor expanded in z around inf 25.7%
if 3.90000000000000027e263 < z Initial program 74.4%
Simplified20.5%
Taylor expanded in t around inf 3.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.2%
associate-+r+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 25.7%
Taylor expanded in y around inf 19.6%
flip--19.6%
add-sqr-sqrt20.1%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
associate--l+26.8%
+-inverses26.8%
metadata-eval26.8%
Simplified26.8%
Final simplification30.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 7e-24)
(+ t_2 (- (+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) 2.0) (sqrt y)))
(if (<= z 1.3e+15)
(- (+ (sqrt (+ 1.0 z)) (+ 1.0 t_2)) (+ (sqrt y) (sqrt z)))
(if (<= z 3.9e+263)
(+ t_1 (- t_2 (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ t_1 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 7e-24) {
tmp = t_2 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + 2.0) - sqrt(y));
} else if (z <= 1.3e+15) {
tmp = (sqrt((1.0 + z)) + (1.0 + t_2)) - (sqrt(y) + sqrt(z));
} else if (z <= 3.9e+263) {
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (z <= 7d-24) then
tmp = t_2 + (((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + 2.0d0) - sqrt(y))
else if (z <= 1.3d+15) then
tmp = (sqrt((1.0d0 + z)) + (1.0d0 + t_2)) - (sqrt(y) + sqrt(z))
else if (z <= 3.9d+263) then
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 7e-24) {
tmp = t_2 + (((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + 2.0) - Math.sqrt(y));
} else if (z <= 1.3e+15) {
tmp = (Math.sqrt((1.0 + z)) + (1.0 + t_2)) - (Math.sqrt(y) + Math.sqrt(z));
} else if (z <= 3.9e+263) {
tmp = t_1 + (t_2 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (t_1 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 7e-24: tmp = t_2 + (((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + 2.0) - math.sqrt(y)) elif z <= 1.3e+15: tmp = (math.sqrt((1.0 + z)) + (1.0 + t_2)) - (math.sqrt(y) + math.sqrt(z)) elif z <= 3.9e+263: tmp = t_1 + (t_2 - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (t_1 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 7e-24) tmp = Float64(t_2 + Float64(Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + 2.0) - sqrt(y))); elseif (z <= 1.3e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(1.0 + t_2)) - Float64(sqrt(y) + sqrt(z))); elseif (z <= 3.9e+263) tmp = Float64(t_1 + Float64(t_2 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 7e-24)
tmp = t_2 + (((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + 2.0) - sqrt(y));
elseif (z <= 1.3e+15)
tmp = (sqrt((1.0 + z)) + (1.0 + t_2)) - (sqrt(y) + sqrt(z));
elseif (z <= 3.9e+263)
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (t_1 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 7e-24], N[(t$95$2 + N[(N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+263], N[(t$95$1 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 7 \cdot 10^{-24}:\\
\;\;\;\;t_2 + \left(\left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + 2\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} + \left(1 + t_2\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+263}:\\
\;\;\;\;t_1 + \left(t_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 6.9999999999999993e-24Initial program 98.1%
Simplified38.2%
Taylor expanded in x around 0 25.7%
associate-+r+25.7%
Simplified25.7%
Taylor expanded in z around 0 25.3%
associate--l+34.3%
Simplified34.3%
flip--99.4%
add-sqr-sqrt76.2%
+-commutative76.2%
add-sqr-sqrt99.4%
+-commutative99.4%
Applied egg-rr34.3%
+-commutative99.4%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
Simplified34.4%
if 6.9999999999999993e-24 < z < 1.3e15Initial program 90.8%
Simplified43.8%
Taylor expanded in t around inf 25.6%
associate--l+30.2%
+-commutative30.2%
associate--l+35.7%
associate-+r+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 28.2%
associate-+r+28.2%
+-commutative28.2%
Simplified28.2%
if 1.3e15 < z < 3.90000000000000027e263Initial program 85.5%
Simplified21.6%
Taylor expanded in t around inf 4.6%
associate--l+21.6%
+-commutative21.6%
associate--l+14.4%
associate-+r+14.4%
+-commutative14.4%
Simplified14.4%
Taylor expanded in z around inf 25.7%
if 3.90000000000000027e263 < z Initial program 74.4%
Simplified20.5%
Taylor expanded in t around inf 3.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.2%
associate-+r+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 25.7%
Taylor expanded in y around inf 19.6%
flip--19.6%
add-sqr-sqrt20.1%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
associate--l+26.8%
+-inverses26.8%
metadata-eval26.8%
Simplified26.8%
Final simplification29.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= z 0.47)
(+ 1.0 (- (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 2.0) (sqrt y)))
(if (<= z 3.9e+263)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (z <= 0.47) {
tmp = 1.0 + (((sqrt((1.0 + t)) - sqrt(t)) + 2.0) - sqrt(y));
} else if (z <= 3.9e+263) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (z <= 0.47d0) then
tmp = 1.0d0 + (((sqrt((1.0d0 + t)) - sqrt(t)) + 2.0d0) - sqrt(y))
else if (z <= 3.9d+263) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 0.47) {
tmp = 1.0 + (((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 2.0) - Math.sqrt(y));
} else if (z <= 3.9e+263) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (t_1 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if z <= 0.47: tmp = 1.0 + (((math.sqrt((1.0 + t)) - math.sqrt(t)) + 2.0) - math.sqrt(y)) elif z <= 3.9e+263: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (t_1 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 0.47) tmp = Float64(1.0 + Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 2.0) - sqrt(y))); elseif (z <= 3.9e+263) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 0.47)
tmp = 1.0 + (((sqrt((1.0 + t)) - sqrt(t)) + 2.0) - sqrt(y));
elseif (z <= 3.9e+263)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (t_1 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.47], N[(1.0 + N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+263], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 0.47:\\
\;\;\;\;1 + \left(\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + 2\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+263}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 0.46999999999999997Initial program 97.6%
Simplified38.9%
Taylor expanded in x around 0 25.9%
associate-+r+25.9%
Simplified25.9%
Taylor expanded in z around 0 24.1%
associate--l+32.9%
Simplified32.9%
Taylor expanded in y around 0 29.9%
if 0.46999999999999997 < z < 3.90000000000000027e263Initial program 85.2%
Simplified22.4%
Taylor expanded in t around inf 5.4%
associate--l+21.8%
+-commutative21.8%
associate--l+14.8%
associate-+r+14.8%
+-commutative14.8%
Simplified14.8%
Taylor expanded in z around inf 25.7%
if 3.90000000000000027e263 < z Initial program 74.4%
Simplified20.5%
Taylor expanded in t around inf 3.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.2%
associate-+r+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 25.7%
Taylor expanded in y around inf 19.6%
flip--19.6%
add-sqr-sqrt20.1%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
associate--l+26.8%
+-inverses26.8%
metadata-eval26.8%
Simplified26.8%
Final simplification27.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 0.47)
(+ 1.0 (- (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 2.0) (sqrt y)))
(if (<= z 3.9e+263)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 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 (z <= 0.47) {
tmp = 1.0 + (((sqrt((1.0 + t)) - sqrt(t)) + 2.0) - sqrt(y));
} else if (z <= 3.9e+263) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} 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 (z <= 0.47d0) then
tmp = 1.0d0 + (((sqrt((1.0d0 + t)) - sqrt(t)) + 2.0d0) - sqrt(y))
else if (z <= 3.9d+263) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
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 (z <= 0.47) {
tmp = 1.0 + (((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 2.0) - Math.sqrt(y));
} else if (z <= 3.9e+263) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} 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 z <= 0.47: tmp = 1.0 + (((math.sqrt((1.0 + t)) - math.sqrt(t)) + 2.0) - math.sqrt(y)) elif z <= 3.9e+263: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) 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 (z <= 0.47) tmp = Float64(1.0 + Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 2.0) - sqrt(y))); elseif (z <= 3.9e+263) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); 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 (z <= 0.47)
tmp = 1.0 + (((sqrt((1.0 + t)) - sqrt(t)) + 2.0) - sqrt(y));
elseif (z <= 3.9e+263)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
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[z, 0.47], N[(1.0 + N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+263], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $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}\;z \leq 0.47:\\
\;\;\;\;1 + \left(\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + 2\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+263}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 0.46999999999999997Initial program 97.6%
Simplified38.9%
Taylor expanded in x around 0 25.9%
associate-+r+25.9%
Simplified25.9%
Taylor expanded in z around 0 24.1%
associate--l+32.9%
Simplified32.9%
Taylor expanded in y around 0 29.9%
if 0.46999999999999997 < z < 3.90000000000000027e263Initial program 85.2%
Simplified22.4%
Taylor expanded in t around inf 5.4%
associate--l+21.8%
+-commutative21.8%
associate--l+14.8%
associate-+r+14.8%
+-commutative14.8%
Simplified14.8%
Taylor expanded in z around inf 25.7%
Taylor expanded in x around 0 25.4%
associate--l+47.5%
Simplified47.5%
if 3.90000000000000027e263 < z Initial program 74.4%
Simplified20.5%
Taylor expanded in t around inf 3.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.2%
associate-+r+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 25.7%
Taylor expanded in y around inf 19.6%
flip--19.6%
add-sqr-sqrt20.1%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
associate--l+26.8%
+-inverses26.8%
metadata-eval26.8%
Simplified26.8%
Final simplification36.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 0.47)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 3.9e+263)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 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 (z <= 0.47) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 3.9e+263) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} 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 (z <= 0.47d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 3.9d+263) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
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 (z <= 0.47) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 3.9e+263) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} 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 z <= 0.47: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 3.9e+263: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) 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 (z <= 0.47) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 3.9e+263) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); 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 (z <= 0.47)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 3.9e+263)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
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[z, 0.47], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 3.9e+263], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $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}\;z \leq 0.47:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+263}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 0.46999999999999997Initial program 97.6%
Simplified38.9%
Taylor expanded in x around 0 25.9%
associate-+r+25.9%
Simplified25.9%
Taylor expanded in z around 0 24.1%
associate--l+32.9%
Simplified32.9%
Taylor expanded in y around 0 23.0%
associate--l+36.8%
Simplified36.8%
if 0.46999999999999997 < z < 3.90000000000000027e263Initial program 85.2%
Simplified22.4%
Taylor expanded in t around inf 5.4%
associate--l+21.8%
+-commutative21.8%
associate--l+14.8%
associate-+r+14.8%
+-commutative14.8%
Simplified14.8%
Taylor expanded in z around inf 25.7%
Taylor expanded in x around 0 25.4%
associate--l+47.5%
Simplified47.5%
if 3.90000000000000027e263 < z Initial program 74.4%
Simplified20.5%
Taylor expanded in t around inf 3.2%
associate--l+21.8%
+-commutative21.8%
associate--l+21.2%
associate-+r+21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around inf 25.7%
Taylor expanded in y around inf 19.6%
flip--19.6%
add-sqr-sqrt20.1%
add-sqr-sqrt19.6%
Applied egg-rr19.6%
associate--l+26.8%
+-inverses26.8%
metadata-eval26.8%
Simplified26.8%
Final simplification40.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.47) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.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 <= 0.47) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.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 <= 0.47d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.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 <= 0.47) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.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 <= 0.47: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.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 <= 0.47) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.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 <= 0.47)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.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, 0.47], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.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 0.47:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.46999999999999997Initial program 97.6%
Simplified38.9%
Taylor expanded in x around 0 25.9%
associate-+r+25.9%
Simplified25.9%
Taylor expanded in z around 0 24.1%
associate--l+32.9%
Simplified32.9%
Taylor expanded in y around 0 23.0%
associate--l+36.8%
Simplified36.8%
if 0.46999999999999997 < z Initial program 83.4%
Simplified22.1%
Taylor expanded in t around inf 5.0%
associate--l+21.8%
+-commutative21.8%
associate--l+15.9%
associate-+r+15.9%
+-commutative15.9%
Simplified15.9%
Taylor expanded in z around inf 25.7%
Taylor expanded in x around 0 25.3%
associate--l+47.9%
Simplified47.9%
Final simplification42.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[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])\\
\\
1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\end{array}
Initial program 90.6%
Simplified30.5%
Taylor expanded in t around inf 12.1%
associate--l+22.3%
+-commutative22.3%
associate--l+24.3%
associate-+r+24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in z around inf 18.9%
Taylor expanded in x around 0 24.6%
associate--l+41.6%
Simplified41.6%
Final simplification41.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ 1.0 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 90.6%
Simplified30.5%
Taylor expanded in t around inf 12.1%
associate--l+22.3%
+-commutative22.3%
associate--l+24.3%
associate-+r+24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in z around inf 18.9%
Taylor expanded in y around inf 15.5%
Final simplification15.5%
(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 2023320
(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))))