
(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
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ 1.0 z))) (t_3 (sqrt (+ 1.0 x))))
(if (<= z 7.7e+34)
(+
(- t_3 (sqrt x))
(+
(- t_1 (sqrt y))
(+ (/ 1.0 (+ t_2 (sqrt z))) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))
(+
(+ (/ 1.0 (+ t_1 (sqrt y))) (- t_2 (sqrt z)))
(/ 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((1.0 + y));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + x));
double tmp;
if (z <= 7.7e+34) {
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (t_2 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
} else {
tmp = ((1.0 / (t_1 + sqrt(y))) + (t_2 - sqrt(z))) + (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((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + x))
if (z <= 7.7d+34) then
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0d0 / (t_2 + sqrt(z))) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
else
tmp = ((1.0d0 / (t_1 + sqrt(y))) + (t_2 - sqrt(z))) + (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((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 7.7e+34) {
tmp = (t_3 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((1.0 / (t_2 + Math.sqrt(z))) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
} else {
tmp = ((1.0 / (t_1 + Math.sqrt(y))) + (t_2 - Math.sqrt(z))) + (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((1.0 + y)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if z <= 7.7e+34: tmp = (t_3 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((1.0 / (t_2 + math.sqrt(z))) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) else: tmp = ((1.0 / (t_1 + math.sqrt(y))) + (t_2 - math.sqrt(z))) + (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 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 7.7e+34) tmp = Float64(Float64(t_3 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + Float64(t_2 - sqrt(z))) + 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((1.0 + y));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 7.7e+34)
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (t_2 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
else
tmp = ((1.0 / (t_1 + sqrt(y))) + (t_2 - sqrt(z))) + (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[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 7.7e+34], N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 7.7 \cdot 10^{+34}:\\
\;\;\;\;\left(t_3 - \sqrt{x}\right) + \left(\left(t_1 - \sqrt{y}\right) + \left(\frac{1}{t_2 + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{y}} + \left(t_2 - \sqrt{z}\right)\right) + \frac{1}{t_3 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 7.6999999999999999e34Initial program 95.7%
associate-+l+95.7%
associate-+l+95.7%
+-commutative95.7%
+-commutative95.7%
+-commutative95.7%
Simplified95.7%
flip--95.9%
add-sqr-sqrt77.2%
add-sqr-sqrt95.9%
Applied egg-rr95.9%
associate--l+96.4%
+-inverses96.4%
metadata-eval96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.9%
add-sqr-sqrt96.7%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
+-commutative99.0%
Simplified99.0%
if 7.6999999999999999e34 < z Initial program 83.1%
associate-+l+83.1%
associate-+l+83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
flip--83.3%
add-sqr-sqrt68.4%
add-sqr-sqrt83.8%
Applied egg-rr83.8%
+-commutative83.8%
associate--l+86.6%
+-inverses86.6%
metadata-eval86.6%
+-commutative86.6%
+-commutative86.6%
Simplified86.6%
flip--86.6%
add-sqr-sqrt69.7%
add-sqr-sqrt86.7%
Applied egg-rr86.7%
associate--l+90.3%
+-inverses90.3%
metadata-eval90.3%
Simplified90.3%
Taylor expanded in t around inf 52.8%
Final simplification79.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))) (t_3 (sqrt (+ 1.0 x))))
(if (<= (- t_2 (sqrt y)) 1.0)
(+ (+ (/ 1.0 (+ t_2 (sqrt y))) (- t_1 (sqrt z))) (/ 1.0 (+ t_3 (sqrt x))))
(+
(- t_3 (sqrt x))
(+
1.0
(+ (/ 1.0 (+ t_1 (sqrt z))) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + x));
double tmp;
if ((t_2 - sqrt(y)) <= 1.0) {
tmp = ((1.0 / (t_2 + sqrt(y))) + (t_1 - sqrt(z))) + (1.0 / (t_3 + sqrt(x)));
} else {
tmp = (t_3 - sqrt(x)) + (1.0 + ((1.0 / (t_1 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + x))
if ((t_2 - sqrt(y)) <= 1.0d0) then
tmp = ((1.0d0 / (t_2 + sqrt(y))) + (t_1 - sqrt(z))) + (1.0d0 / (t_3 + sqrt(x)))
else
tmp = (t_3 - sqrt(x)) + (1.0d0 + ((1.0d0 / (t_1 + sqrt(z))) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if ((t_2 - Math.sqrt(y)) <= 1.0) {
tmp = ((1.0 / (t_2 + Math.sqrt(y))) + (t_1 - Math.sqrt(z))) + (1.0 / (t_3 + Math.sqrt(x)));
} else {
tmp = (t_3 - Math.sqrt(x)) + (1.0 + ((1.0 / (t_1 + Math.sqrt(z))) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if (t_2 - math.sqrt(y)) <= 1.0: tmp = ((1.0 / (t_2 + math.sqrt(y))) + (t_1 - math.sqrt(z))) + (1.0 / (t_3 + math.sqrt(x))) else: tmp = (t_3 - math.sqrt(x)) + (1.0 + ((1.0 / (t_1 + math.sqrt(z))) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_2 - sqrt(y)) <= 1.0) tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + Float64(t_1 - sqrt(z))) + Float64(1.0 / Float64(t_3 + sqrt(x)))); else tmp = Float64(Float64(t_3 - sqrt(x)) + Float64(1.0 + Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if ((t_2 - sqrt(y)) <= 1.0)
tmp = ((1.0 / (t_2 + sqrt(y))) + (t_1 - sqrt(z))) + (1.0 / (t_3 + sqrt(x)));
else
tmp = (t_3 - sqrt(x)) + (1.0 + ((1.0 / (t_1 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $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[N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 1.0], N[(N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $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 + z}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;t_2 - \sqrt{y} \leq 1:\\
\;\;\;\;\left(\frac{1}{t_2 + \sqrt{y}} + \left(t_1 - \sqrt{z}\right)\right) + \frac{1}{t_3 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(t_3 - \sqrt{x}\right) + \left(1 + \left(\frac{1}{t_1 + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 1Initial program 90.3%
associate-+l+90.3%
associate-+l+90.3%
+-commutative90.3%
+-commutative90.3%
+-commutative90.3%
Simplified90.3%
flip--90.5%
add-sqr-sqrt72.6%
add-sqr-sqrt90.7%
Applied egg-rr90.7%
+-commutative90.7%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
+-commutative92.1%
+-commutative92.1%
Simplified92.1%
flip--92.1%
add-sqr-sqrt75.6%
add-sqr-sqrt92.2%
Applied egg-rr92.2%
associate--l+93.9%
+-inverses93.9%
metadata-eval93.9%
Simplified93.9%
Taylor expanded in t around inf 55.1%
if 1 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 90.3%
associate-+l+90.3%
associate-+l+90.3%
+-commutative90.3%
+-commutative90.3%
+-commutative90.3%
Simplified90.3%
flip--90.4%
add-sqr-sqrt74.4%
add-sqr-sqrt90.7%
Applied egg-rr90.7%
associate--l+92.9%
+-inverses92.9%
metadata-eval92.9%
+-commutative92.9%
+-commutative92.9%
Simplified92.9%
flip--93.2%
add-sqr-sqrt76.3%
add-sqr-sqrt93.4%
Applied egg-rr93.4%
associate--l+96.2%
+-inverses96.2%
metadata-eval96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 62.9%
Final simplification55.1%
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))) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))) (/ 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) {
return ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)))) + (1.0 / (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 = ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))) + (1.0d0 / (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 ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)));
}
[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))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))) + (1.0 / (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(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) + Float64(1.0 / 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 = ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)))) + (1.0 / (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[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right) + \frac{1}{\sqrt{1 + x} + \sqrt{x}}
\end{array}
Initial program 90.3%
associate-+l+90.3%
associate-+l+90.3%
+-commutative90.3%
+-commutative90.3%
+-commutative90.3%
Simplified90.3%
flip--90.5%
add-sqr-sqrt72.6%
add-sqr-sqrt90.7%
Applied egg-rr90.7%
+-commutative90.7%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
+-commutative92.1%
+-commutative92.1%
Simplified92.1%
flip--92.1%
add-sqr-sqrt75.6%
add-sqr-sqrt92.2%
Applied egg-rr92.2%
associate--l+93.9%
+-inverses93.9%
metadata-eval93.9%
Simplified93.9%
Final simplification93.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 x))) (t_3 (- t_2 (sqrt x))))
(if (<= y 5.8e-114)
(+ t_3 (+ 1.0 (+ (- t_1 (sqrt z)) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))
(if (<= y 5e+39)
(+
t_3
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ t_1 (sqrt z)))))
(/ 1.0 (+ t_2 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double tmp;
if (y <= 5.8e-114) {
tmp = t_3 + (1.0 + ((t_1 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
} else if (y <= 5e+39) {
tmp = t_3 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(z))));
} else {
tmp = 1.0 / (t_2 + 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((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
if (y <= 5.8d-114) then
tmp = t_3 + (1.0d0 + ((t_1 - sqrt(z)) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
else if (y <= 5d+39) then
tmp = t_3 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (t_1 + sqrt(z))))
else
tmp = 1.0d0 / (t_2 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double tmp;
if (y <= 5.8e-114) {
tmp = t_3 + (1.0 + ((t_1 - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
} else if (y <= 5e+39) {
tmp = t_3 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (t_1 + Math.sqrt(z))));
} else {
tmp = 1.0 / (t_2 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) tmp = 0 if y <= 5.8e-114: tmp = t_3 + (1.0 + ((t_1 - math.sqrt(z)) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) elif y <= 5e+39: tmp = t_3 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (t_1 + math.sqrt(z)))) else: tmp = 1.0 / (t_2 + 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 + z)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) tmp = 0.0 if (y <= 5.8e-114) tmp = Float64(t_3 + Float64(1.0 + Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); elseif (y <= 5e+39) tmp = Float64(t_3 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(t_1 + sqrt(z))))); else tmp = Float64(1.0 / Float64(t_2 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
tmp = 0.0;
if (y <= 5.8e-114)
tmp = t_3 + (1.0 + ((t_1 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
elseif (y <= 5e+39)
tmp = t_3 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(z))));
else
tmp = 1.0 / (t_2 + 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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.8e-114], N[(t$95$3 + N[(1.0 + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+39], N[(t$95$3 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$2 + 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 + z}\\
t_2 := \sqrt{1 + x}\\
t_3 := t_2 - \sqrt{x}\\
\mathbf{if}\;y \leq 5.8 \cdot 10^{-114}:\\
\;\;\;\;t_3 + \left(1 + \left(\left(t_1 - \sqrt{z}\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+39}:\\
\;\;\;\;t_3 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{t_1 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 5.79999999999999993e-114Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.6%
add-sqr-sqrt77.9%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate--l+99.1%
+-inverses99.1%
metadata-eval99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around 0 99.1%
if 5.79999999999999993e-114 < y < 5.00000000000000015e39Initial program 95.5%
associate-+l+95.5%
associate-+l+95.5%
+-commutative95.5%
+-commutative95.5%
+-commutative95.5%
Simplified95.5%
flip--96.3%
add-sqr-sqrt96.7%
add-sqr-sqrt97.0%
Applied egg-rr96.2%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified96.9%
Taylor expanded in t around inf 59.8%
flip--97.1%
add-sqr-sqrt78.9%
add-sqr-sqrt97.6%
Applied egg-rr60.6%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
+-commutative97.6%
+-commutative97.6%
Simplified60.6%
if 5.00000000000000015e39 < y Initial program 79.9%
associate-+l+79.9%
+-commutative79.9%
associate-+r-79.9%
associate-+l-49.7%
+-commutative49.7%
+-commutative49.7%
associate--l+49.7%
Simplified33.9%
Taylor expanded in z around inf 27.0%
associate--l+27.4%
+-commutative27.4%
Simplified27.4%
Taylor expanded in t around inf 18.9%
Taylor expanded in y around inf 18.9%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.6%
+-inverses22.6%
metadata-eval22.6%
Simplified22.6%
Final simplification60.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- t_2 (sqrt x))))
(if (<= y 1.7e-108)
(+ t_3 (+ 1.0 (+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= y 5e+39)
(+ t_3 (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_1))
(/ 1.0 (+ t_2 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double tmp;
if (y <= 1.7e-108) {
tmp = t_3 + (1.0 + (t_1 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (y <= 5e+39) {
tmp = t_3 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1);
} else {
tmp = 1.0 / (t_2 + 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((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
if (y <= 1.7d-108) then
tmp = t_3 + (1.0d0 + (t_1 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (y <= 5d+39) then
tmp = t_3 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_1)
else
tmp = 1.0d0 / (t_2 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double tmp;
if (y <= 1.7e-108) {
tmp = t_3 + (1.0 + (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (y <= 5e+39) {
tmp = t_3 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_1);
} else {
tmp = 1.0 / (t_2 + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) tmp = 0 if y <= 1.7e-108: tmp = t_3 + (1.0 + (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif y <= 5e+39: tmp = t_3 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_1) else: tmp = 1.0 / (t_2 + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) tmp = 0.0 if (y <= 1.7e-108) tmp = Float64(t_3 + Float64(1.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (y <= 5e+39) tmp = Float64(t_3 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_1)); else tmp = Float64(1.0 / Float64(t_2 + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
tmp = 0.0;
if (y <= 1.7e-108)
tmp = t_3 + (1.0 + (t_1 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (y <= 5e+39)
tmp = t_3 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1);
else
tmp = 1.0 / (t_2 + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e-108], N[(t$95$3 + N[(1.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+39], N[(t$95$3 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$2 + 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 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + x}\\
t_3 := t_2 - \sqrt{x}\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{-108}:\\
\;\;\;\;t_3 + \left(1 + \left(t_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+39}:\\
\;\;\;\;t_3 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.70000000000000001e-108Initial program 97.4%
associate-+l+97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in y around 0 97.4%
if 1.70000000000000001e-108 < y < 5.00000000000000015e39Initial program 95.9%
associate-+l+95.9%
associate-+l+95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
flip--96.2%
add-sqr-sqrt96.6%
add-sqr-sqrt96.9%
Applied egg-rr96.7%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.3%
Taylor expanded in t around inf 61.1%
if 5.00000000000000015e39 < y Initial program 79.9%
associate-+l+79.9%
+-commutative79.9%
associate-+r-79.9%
associate-+l-49.7%
+-commutative49.7%
+-commutative49.7%
associate--l+49.7%
Simplified33.9%
Taylor expanded in z around inf 27.0%
associate--l+27.4%
+-commutative27.4%
Simplified27.4%
Taylor expanded in t around inf 18.9%
Taylor expanded in y around inf 18.9%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.6%
+-inverses22.6%
metadata-eval22.6%
Simplified22.6%
Final simplification59.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 2.7e+54)
(+ (- t_2 (sqrt x)) (+ 1.0 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))
(+ (/ 1.0 (+ t_2 (sqrt x))) (+ t_1 (- (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)) - sqrt(z);
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 2.7e+54) {
tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
} else {
tmp = (1.0 / (t_2 + sqrt(x))) + (t_1 + (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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + x))
if (t <= 2.7d+54) then
tmp = (t_2 - sqrt(x)) + (1.0d0 + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
else
tmp = (1.0d0 / (t_2 + sqrt(x))) + (t_1 + (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)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 2.7e+54) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + (t_1 + (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)) - math.sqrt(z) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 2.7e+54: tmp = (t_2 - math.sqrt(x)) + (1.0 + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) else: tmp = (1.0 / (t_2 + math.sqrt(x))) + (t_1 + (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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 2.7e+54) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(t_1 + 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)) - sqrt(z);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 2.7e+54)
tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
else
tmp = (1.0 / (t_2 + sqrt(x))) + (t_1 + (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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.7e+54], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + 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} - \sqrt{z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 2.7 \cdot 10^{+54}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(1 + \left(t_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{x}} + \left(t_1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 2.70000000000000011e54Initial program 94.6%
associate-+l+94.6%
associate-+l+94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
Simplified94.6%
flip--94.7%
add-sqr-sqrt92.6%
add-sqr-sqrt95.3%
Applied egg-rr95.3%
associate--l+96.9%
+-inverses96.9%
metadata-eval96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in y around 0 64.0%
if 2.70000000000000011e54 < t Initial program 85.0%
associate-+l+85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.1%
add-sqr-sqrt71.8%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
+-commutative85.4%
associate--l+87.6%
+-inverses87.6%
metadata-eval87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in t around inf 87.6%
Final simplification74.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)) (sqrt z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 2.7e+54)
(+ (- t_2 (sqrt x)) (+ 1.0 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_1)
(/ 1.0 (+ t_2 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 2.7e+54) {
tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
} else {
tmp = ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1) + (1.0 / (t_2 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + x))
if (t <= 2.7d+54) then
tmp = (t_2 - sqrt(x)) + (1.0d0 + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_1) + (1.0d0 / (t_2 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 2.7e+54) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_1) + (1.0 / (t_2 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 2.7e+54: tmp = (t_2 - math.sqrt(x)) + (1.0 + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) else: tmp = ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_1) + (1.0 / (t_2 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 2.7e+54) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_1) + Float64(1.0 / Float64(t_2 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 2.7e+54)
tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
else
tmp = ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1) + (1.0 / (t_2 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.7e+54], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 2.7 \cdot 10^{+54}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(1 + \left(t_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\right) + \frac{1}{t_2 + \sqrt{x}}\\
\end{array}
\end{array}
if t < 2.70000000000000011e54Initial program 94.6%
associate-+l+94.6%
associate-+l+94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
Simplified94.6%
flip--94.7%
add-sqr-sqrt92.6%
add-sqr-sqrt95.3%
Applied egg-rr95.3%
associate--l+96.9%
+-inverses96.9%
metadata-eval96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in y around 0 64.0%
if 2.70000000000000011e54 < t Initial program 85.0%
associate-+l+85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.1%
add-sqr-sqrt71.8%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
+-commutative85.4%
associate--l+87.6%
+-inverses87.6%
metadata-eval87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.6%
add-sqr-sqrt71.2%
add-sqr-sqrt87.7%
Applied egg-rr87.7%
associate--l+91.1%
+-inverses91.1%
metadata-eval91.1%
Simplified91.1%
Taylor expanded in t around inf 91.1%
Final simplification76.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (- t_1 (sqrt x))) (t_3 (sqrt (+ 1.0 y))))
(if (<= z 2.1e-41)
(+ t_2 (+ 1.0 (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= z 3.9e+27)
(+ t_1 (- (- t_3 (sqrt y)) (- (+ (sqrt z) (sqrt x)) (sqrt (+ 1.0 z)))))
(+ (/ 1.0 (+ t_3 (sqrt y))) t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = t_1 - sqrt(x);
double t_3 = sqrt((1.0 + y));
double tmp;
if (z <= 2.1e-41) {
tmp = t_2 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (z <= 3.9e+27) {
tmp = t_1 + ((t_3 - sqrt(y)) - ((sqrt(z) + sqrt(x)) - sqrt((1.0 + z))));
} else {
tmp = (1.0 / (t_3 + sqrt(y))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = t_1 - sqrt(x)
t_3 = sqrt((1.0d0 + y))
if (z <= 2.1d-41) then
tmp = t_2 + (1.0d0 + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (z <= 3.9d+27) then
tmp = t_1 + ((t_3 - sqrt(y)) - ((sqrt(z) + sqrt(x)) - sqrt((1.0d0 + z))))
else
tmp = (1.0d0 / (t_3 + sqrt(y))) + t_2
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 2.1e-41) {
tmp = t_2 + (1.0 + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (z <= 3.9e+27) {
tmp = t_1 + ((t_3 - Math.sqrt(y)) - ((Math.sqrt(z) + Math.sqrt(x)) - Math.sqrt((1.0 + z))));
} else {
tmp = (1.0 / (t_3 + Math.sqrt(y))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = t_1 - math.sqrt(x) t_3 = math.sqrt((1.0 + y)) tmp = 0 if z <= 2.1e-41: tmp = t_2 + (1.0 + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif z <= 3.9e+27: tmp = t_1 + ((t_3 - math.sqrt(y)) - ((math.sqrt(z) + math.sqrt(x)) - math.sqrt((1.0 + z)))) else: tmp = (1.0 / (t_3 + math.sqrt(y))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(t_1 - sqrt(x)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 2.1e-41) tmp = Float64(t_2 + Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (z <= 3.9e+27) tmp = Float64(t_1 + Float64(Float64(t_3 - sqrt(y)) - Float64(Float64(sqrt(z) + sqrt(x)) - sqrt(Float64(1.0 + z))))); else tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(y))) + t_2); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = t_1 - sqrt(x);
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 2.1e-41)
tmp = t_2 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (z <= 3.9e+27)
tmp = t_1 + ((t_3 - sqrt(y)) - ((sqrt(z) + sqrt(x)) - sqrt((1.0 + z))));
else
tmp = (1.0 / (t_3 + sqrt(y))) + t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.1e-41], N[(t$95$2 + N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.9e+27], N[(t$95$1 + N[(N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := t_1 - \sqrt{x}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.1 \cdot 10^{-41}:\\
\;\;\;\;t_2 + \left(1 + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+27}:\\
\;\;\;\;t_1 + \left(\left(t_3 - \sqrt{y}\right) - \left(\left(\sqrt{z} + \sqrt{x}\right) - \sqrt{1 + z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_3 + \sqrt{y}} + t_2\\
\end{array}
\end{array}
if z < 2.10000000000000013e-41Initial program 98.3%
associate-+l+98.3%
associate-+l+98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in y around 0 65.5%
Taylor expanded in z around 0 54.9%
associate--l+65.5%
Simplified65.5%
if 2.10000000000000013e-41 < z < 3.8999999999999999e27Initial program 87.6%
associate-+l+87.6%
+-commutative87.6%
associate-+r-73.0%
associate-+l-55.6%
+-commutative55.6%
+-commutative55.6%
associate--l+55.6%
Simplified31.1%
Taylor expanded in t around inf 40.4%
+-commutative40.4%
Simplified40.4%
if 3.8999999999999999e27 < z Initial program 82.5%
associate-+l+82.5%
associate-+l+82.5%
+-commutative82.5%
+-commutative82.5%
+-commutative82.5%
Simplified82.5%
flip--86.0%
add-sqr-sqrt69.4%
add-sqr-sqrt86.1%
Applied egg-rr82.5%
associate--l+89.6%
+-inverses89.6%
metadata-eval89.6%
Simplified86.3%
Taylor expanded in t around inf 50.3%
Taylor expanded in z around inf 50.3%
Final simplification56.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 x))) (t_2 (- t_1 (sqrt x))))
(if (<= y 9.5e-25)
(+
t_2
(+ 1.0 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= y 2.5e+35)
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_2)
(/ 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 = t_1 - sqrt(x);
double tmp;
if (y <= 9.5e-25) {
tmp = t_2 + (1.0 + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))));
} else if (y <= 2.5e+35) {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_2;
} 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 = t_1 - sqrt(x)
if (y <= 9.5d-25) then
tmp = t_2 + (1.0d0 + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (y <= 2.5d+35) then
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_2
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 = t_1 - Math.sqrt(x);
double tmp;
if (y <= 9.5e-25) {
tmp = t_2 + (1.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (y <= 2.5e+35) {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_2;
} 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 = t_1 - math.sqrt(x) tmp = 0 if y <= 9.5e-25: tmp = t_2 + (1.0 + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif y <= 2.5e+35: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_2 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 = Float64(t_1 - sqrt(x)) tmp = 0.0 if (y <= 9.5e-25) tmp = Float64(t_2 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (y <= 2.5e+35) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_2); 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 = t_1 - sqrt(x);
tmp = 0.0;
if (y <= 9.5e-25)
tmp = t_2 + (1.0 + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))));
elseif (y <= 2.5e+35)
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_2;
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[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9.5e-25], N[(t$95$2 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+35], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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 := t_1 - \sqrt{x}\\
\mathbf{if}\;y \leq 9.5 \cdot 10^{-25}:\\
\;\;\;\;t_2 + \left(1 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+35}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9.50000000000000065e-25Initial program 97.2%
associate-+l+97.2%
associate-+l+97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in y around 0 97.1%
if 9.50000000000000065e-25 < y < 2.50000000000000011e35Initial program 93.5%
associate-+l+93.5%
associate-+l+93.5%
+-commutative93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
flip--93.6%
add-sqr-sqrt95.2%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in t around inf 57.7%
Taylor expanded in z around inf 36.0%
if 2.50000000000000011e35 < y Initial program 79.9%
associate-+l+79.9%
+-commutative79.9%
associate-+r-79.9%
associate-+l-49.7%
+-commutative49.7%
+-commutative49.7%
associate--l+49.7%
Simplified33.9%
Taylor expanded in z around inf 27.0%
associate--l+27.4%
+-commutative27.4%
Simplified27.4%
Taylor expanded in t around inf 18.9%
Taylor expanded in y around inf 18.9%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.6%
+-inverses22.6%
metadata-eval22.6%
Simplified22.6%
Final simplification64.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 2.7e+54)
(+ (- t_2 (sqrt x)) (+ 1.0 (+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (/ 1.0 (+ t_2 (sqrt x))) (+ t_1 (- (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)) - sqrt(z);
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 2.7e+54) {
tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (sqrt((1.0 + t)) - sqrt(t))));
} else {
tmp = (1.0 / (t_2 + sqrt(x))) + (t_1 + (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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + x))
if (t <= 2.7d+54) then
tmp = (t_2 - sqrt(x)) + (1.0d0 + (t_1 + (sqrt((1.0d0 + t)) - sqrt(t))))
else
tmp = (1.0d0 / (t_2 + sqrt(x))) + (t_1 + (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)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 2.7e+54) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 + (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + (t_1 + (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)) - math.sqrt(z) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 2.7e+54: tmp = (t_2 - math.sqrt(x)) + (1.0 + (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) else: tmp = (1.0 / (t_2 + math.sqrt(x))) + (t_1 + (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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 2.7e+54) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(t_1 + 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)) - sqrt(z);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 2.7e+54)
tmp = (t_2 - sqrt(x)) + (1.0 + (t_1 + (sqrt((1.0 + t)) - sqrt(t))));
else
tmp = (1.0 / (t_2 + sqrt(x))) + (t_1 + (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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.7e+54], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + 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} - \sqrt{z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 2.7 \cdot 10^{+54}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(1 + \left(t_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{x}} + \left(t_1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 2.70000000000000011e54Initial program 94.6%
associate-+l+94.6%
associate-+l+94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
Simplified94.6%
Taylor expanded in y around 0 62.6%
if 2.70000000000000011e54 < t Initial program 85.0%
associate-+l+85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.1%
add-sqr-sqrt71.8%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
+-commutative85.4%
associate--l+87.6%
+-inverses87.6%
metadata-eval87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in t around inf 87.6%
Final simplification73.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)) (sqrt x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 9.5e-41)
(+ t_1 (+ 1.0 (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= z 9.2e+14)
(+ (+ 1.0 (+ t_2 (sqrt (+ 1.0 z)))) (/ (- y z) (- (sqrt z) (sqrt y))))
(+ (/ 1.0 (+ t_2 (sqrt y))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 9.5e-41) {
tmp = t_1 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (z <= 9.2e+14) {
tmp = (1.0 + (t_2 + sqrt((1.0 + z)))) + ((y - z) / (sqrt(z) - sqrt(y)));
} else {
tmp = (1.0 / (t_2 + sqrt(y))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
t_2 = sqrt((1.0d0 + y))
if (z <= 9.5d-41) then
tmp = t_1 + (1.0d0 + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (z <= 9.2d+14) then
tmp = (1.0d0 + (t_2 + sqrt((1.0d0 + z)))) + ((y - z) / (sqrt(z) - sqrt(y)))
else
tmp = (1.0d0 / (t_2 + sqrt(y))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 9.5e-41) {
tmp = t_1 + (1.0 + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (z <= 9.2e+14) {
tmp = (1.0 + (t_2 + Math.sqrt((1.0 + z)))) + ((y - z) / (Math.sqrt(z) - Math.sqrt(y)));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(y))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 9.5e-41: tmp = t_1 + (1.0 + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif z <= 9.2e+14: tmp = (1.0 + (t_2 + math.sqrt((1.0 + z)))) + ((y - z) / (math.sqrt(z) - math.sqrt(y))) else: tmp = (1.0 / (t_2 + math.sqrt(y))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 9.5e-41) tmp = Float64(t_1 + Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (z <= 9.2e+14) tmp = Float64(Float64(1.0 + Float64(t_2 + sqrt(Float64(1.0 + z)))) + Float64(Float64(y - z) / Float64(sqrt(z) - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 9.5e-41)
tmp = t_1 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (z <= 9.2e+14)
tmp = (1.0 + (t_2 + sqrt((1.0 + z)))) + ((y - z) / (sqrt(z) - sqrt(y)));
else
tmp = (1.0 / (t_2 + sqrt(y))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 9.5e-41], N[(t$95$1 + N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+14], N[(N[(1.0 + N[(t$95$2 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y - z), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 9.5 \cdot 10^{-41}:\\
\;\;\;\;t_1 + \left(1 + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + \left(t_2 + \sqrt{1 + z}\right)\right) + \frac{y - z}{\sqrt{z} - \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{y}} + t_1\\
\end{array}
\end{array}
if z < 9.4999999999999997e-41Initial program 98.2%
associate-+l+98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in y around 0 65.1%
Taylor expanded in z around 0 54.7%
associate--l+65.1%
Simplified65.1%
if 9.4999999999999997e-41 < z < 9.2e14Initial program 94.3%
associate-+l+94.3%
+-commutative94.3%
associate-+r-76.3%
associate-+l-60.6%
+-commutative60.6%
+-commutative60.6%
associate--l+60.7%
Simplified34.3%
Taylor expanded in t around inf 28.1%
Taylor expanded in x around 0 39.4%
flip-+39.4%
add-sqr-sqrt39.4%
add-sqr-sqrt39.7%
Applied egg-rr39.7%
if 9.2e14 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--84.8%
add-sqr-sqrt68.2%
add-sqr-sqrt84.9%
Applied egg-rr81.4%
associate--l+88.3%
+-inverses88.3%
metadata-eval88.3%
Simplified85.1%
Taylor expanded in t around inf 49.3%
Taylor expanded in z around inf 49.3%
Final simplification55.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 9.5e-25)
(+ 2.0 (- (- (sqrt (+ 1.0 z)) (sqrt y)) (sqrt z)))
(if (<= y 4e+38)
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt x)))
(/ 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 (y <= 9.5e-25) {
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
} else if (y <= 4e+38) {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
} 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 (y <= 9.5d-25) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) - sqrt(y)) - sqrt(z))
else if (y <= 4d+38) then
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (t_1 - sqrt(x))
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 (y <= 9.5e-25) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(y)) - Math.sqrt(z));
} else if (y <= 4e+38) {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_1 - Math.sqrt(x));
} 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 y <= 9.5e-25: tmp = 2.0 + ((math.sqrt((1.0 + z)) - math.sqrt(y)) - math.sqrt(z)) elif y <= 4e+38: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_1 - math.sqrt(x)) 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 (y <= 9.5e-25) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(y)) - sqrt(z))); elseif (y <= 4e+38) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_1 - sqrt(x))); 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 (y <= 9.5e-25)
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
elseif (y <= 4e+38)
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
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[y, 9.5e-25], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+38], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $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}\;y \leq 9.5 \cdot 10^{-25}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} - \sqrt{y}\right) - \sqrt{z}\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+38}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9.50000000000000065e-25Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-60.9%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.5%
Taylor expanded in t around inf 22.8%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 35.2%
associate--l+49.2%
Applied egg-rr49.2%
associate--l+58.4%
associate-+r+58.4%
metadata-eval58.4%
+-commutative58.4%
associate--r+58.4%
Simplified58.4%
if 9.50000000000000065e-25 < y < 3.99999999999999991e38Initial program 93.5%
associate-+l+93.5%
associate-+l+93.5%
+-commutative93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
flip--93.6%
add-sqr-sqrt95.2%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in t around inf 57.7%
Taylor expanded in z around inf 36.0%
if 3.99999999999999991e38 < y Initial program 79.9%
associate-+l+79.9%
+-commutative79.9%
associate-+r-79.9%
associate-+l-49.7%
+-commutative49.7%
+-commutative49.7%
associate--l+49.7%
Simplified33.9%
Taylor expanded in z around inf 27.0%
associate--l+27.4%
+-commutative27.4%
Simplified27.4%
Taylor expanded in t around inf 18.9%
Taylor expanded in y around inf 18.9%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.6%
+-inverses22.6%
metadata-eval22.6%
Simplified22.6%
Final simplification43.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)) (sqrt x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 5.6e-41)
(+ t_1 (+ 1.0 (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= z 1.02e+15)
(- (+ 1.0 (+ t_2 (sqrt (+ 1.0 z)))) (+ (sqrt z) (sqrt y)))
(+ (/ 1.0 (+ t_2 (sqrt y))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 5.6e-41) {
tmp = t_1 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (z <= 1.02e+15) {
tmp = (1.0 + (t_2 + sqrt((1.0 + z)))) - (sqrt(z) + sqrt(y));
} else {
tmp = (1.0 / (t_2 + sqrt(y))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
t_2 = sqrt((1.0d0 + y))
if (z <= 5.6d-41) then
tmp = t_1 + (1.0d0 + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (z <= 1.02d+15) then
tmp = (1.0d0 + (t_2 + sqrt((1.0d0 + z)))) - (sqrt(z) + sqrt(y))
else
tmp = (1.0d0 / (t_2 + sqrt(y))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 5.6e-41) {
tmp = t_1 + (1.0 + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (z <= 1.02e+15) {
tmp = (1.0 + (t_2 + Math.sqrt((1.0 + z)))) - (Math.sqrt(z) + Math.sqrt(y));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(y))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 5.6e-41: tmp = t_1 + (1.0 + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif z <= 1.02e+15: tmp = (1.0 + (t_2 + math.sqrt((1.0 + z)))) - (math.sqrt(z) + math.sqrt(y)) else: tmp = (1.0 / (t_2 + math.sqrt(y))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 5.6e-41) tmp = Float64(t_1 + Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (z <= 1.02e+15) tmp = Float64(Float64(1.0 + Float64(t_2 + sqrt(Float64(1.0 + z)))) - Float64(sqrt(z) + sqrt(y))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 5.6e-41)
tmp = t_1 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (z <= 1.02e+15)
tmp = (1.0 + (t_2 + sqrt((1.0 + z)))) - (sqrt(z) + sqrt(y));
else
tmp = (1.0 / (t_2 + sqrt(y))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.6e-41], N[(t$95$1 + N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+15], N[(N[(1.0 + N[(t$95$2 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 5.6 \cdot 10^{-41}:\\
\;\;\;\;t_1 + \left(1 + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(t_2 + \sqrt{1 + z}\right)\right) - \left(\sqrt{z} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{y}} + t_1\\
\end{array}
\end{array}
if z < 5.6000000000000003e-41Initial program 98.3%
associate-+l+98.3%
associate-+l+98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in y around 0 65.5%
Taylor expanded in z around 0 54.9%
associate--l+65.5%
Simplified65.5%
if 5.6000000000000003e-41 < z < 1.02e15Initial program 94.4%
associate-+l+94.4%
+-commutative94.4%
associate-+r-77.1%
associate-+l-62.2%
+-commutative62.2%
+-commutative62.2%
associate--l+62.2%
Simplified33.6%
Taylor expanded in t around inf 31.2%
Taylor expanded in x around 0 41.9%
if 1.02e15 < z Initial program 81.4%
associate-+l+81.4%
associate-+l+81.4%
+-commutative81.4%
+-commutative81.4%
+-commutative81.4%
Simplified81.4%
flip--84.8%
add-sqr-sqrt68.2%
add-sqr-sqrt84.9%
Applied egg-rr81.4%
associate--l+88.3%
+-inverses88.3%
metadata-eval88.3%
Simplified85.1%
Taylor expanded in t around inf 49.3%
Taylor expanded in z around inf 49.3%
Final simplification56.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 1.05e-24)
(+ 2.0 (- (- (sqrt (+ 1.0 z)) (sqrt y)) (sqrt z)))
(if (<= y 4e+17)
(+ 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 (y <= 1.05e-24) {
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
} else if (y <= 4e+17) {
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 (y <= 1.05d-24) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) - sqrt(y)) - sqrt(z))
else if (y <= 4d+17) 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 (y <= 1.05e-24) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(y)) - Math.sqrt(z));
} else if (y <= 4e+17) {
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 y <= 1.05e-24: tmp = 2.0 + ((math.sqrt((1.0 + z)) - math.sqrt(y)) - math.sqrt(z)) elif y <= 4e+17: 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 (y <= 1.05e-24) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(y)) - sqrt(z))); elseif (y <= 4e+17) 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 (y <= 1.05e-24)
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
elseif (y <= 4e+17)
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[y, 1.05e-24], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+17], 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}\;y \leq 1.05 \cdot 10^{-24}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} - \sqrt{y}\right) - \sqrt{z}\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+17}:\\
\;\;\;\;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 y < 1.05e-24Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-60.9%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.5%
Taylor expanded in t around inf 22.8%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 35.2%
associate--l+49.2%
Applied egg-rr49.2%
associate--l+58.4%
associate-+r+58.4%
metadata-eval58.4%
+-commutative58.4%
associate--r+58.4%
Simplified58.4%
if 1.05e-24 < y < 4e17Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
associate-+r-70.7%
associate-+l-63.4%
+-commutative63.4%
+-commutative63.4%
associate--l+63.4%
Simplified33.3%
Taylor expanded in z around inf 26.2%
associate--l+30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in t around inf 30.3%
sub-neg30.3%
Applied egg-rr30.3%
sub-neg30.3%
associate--l-30.3%
Simplified30.3%
if 4e17 < y Initial program 80.2%
associate-+l+80.2%
+-commutative80.2%
associate-+r-80.2%
associate-+l-51.1%
+-commutative51.1%
+-commutative51.1%
associate--l+51.1%
Simplified35.2%
Taylor expanded in z around inf 27.3%
associate--l+27.6%
+-commutative27.6%
Simplified27.6%
Taylor expanded in t around inf 18.8%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.5%
+-inverses22.5%
metadata-eval22.5%
Simplified22.5%
Final simplification42.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))))
(if (<= y 6e-25)
(+ 2.0 (- (- (sqrt (+ 1.0 z)) (sqrt y)) (sqrt z)))
(if (<= y 4e+17)
(+ t_1 (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))
(/ 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 (y <= 6e-25) {
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
} else if (y <= 4e+17) {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
} 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 (y <= 6d-25) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) - sqrt(y)) - sqrt(z))
else if (y <= 4d+17) then
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
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 (y <= 6e-25) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(y)) - Math.sqrt(z));
} else if (y <= 4e+17) {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
} 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 y <= 6e-25: tmp = 2.0 + ((math.sqrt((1.0 + z)) - math.sqrt(y)) - math.sqrt(z)) elif y <= 4e+17: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) 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 (y <= 6e-25) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(y)) - sqrt(z))); elseif (y <= 4e+17) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); 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 (y <= 6e-25)
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
elseif (y <= 4e+17)
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
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[y, 6e-25], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+17], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $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}\;y \leq 6 \cdot 10^{-25}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} - \sqrt{y}\right) - \sqrt{z}\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+17}:\\
\;\;\;\;t_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 5.9999999999999995e-25Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-60.9%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.5%
Taylor expanded in t around inf 22.8%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 35.2%
associate--l+49.2%
Applied egg-rr49.2%
associate--l+58.4%
associate-+r+58.4%
metadata-eval58.4%
+-commutative58.4%
associate--r+58.4%
Simplified58.4%
if 5.9999999999999995e-25 < y < 4e17Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
associate-+r-70.7%
associate-+l-63.4%
+-commutative63.4%
+-commutative63.4%
associate--l+63.4%
Simplified33.3%
Taylor expanded in z around inf 26.2%
associate--l+30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in t around inf 30.3%
if 4e17 < y Initial program 80.2%
associate-+l+80.2%
+-commutative80.2%
associate-+r-80.2%
associate-+l-51.1%
+-commutative51.1%
+-commutative51.1%
associate--l+51.1%
Simplified35.2%
Taylor expanded in z around inf 27.3%
associate--l+27.6%
+-commutative27.6%
Simplified27.6%
Taylor expanded in t around inf 18.8%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.5%
+-inverses22.5%
metadata-eval22.5%
Simplified22.5%
Final simplification42.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1.05e-24)
(+ 2.0 (- (- (sqrt (+ 1.0 z)) (sqrt y)) (sqrt z)))
(if (<= y 4e+21)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05e-24) {
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
} else if (y <= 4e+21) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.05d-24) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) - sqrt(y)) - sqrt(z))
else if (y <= 4d+21) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05e-24) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(y)) - Math.sqrt(z));
} else if (y <= 4e+21) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.05e-24: tmp = 2.0 + ((math.sqrt((1.0 + z)) - math.sqrt(y)) - math.sqrt(z)) elif y <= 4e+21: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.05e-24) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(y)) - sqrt(z))); elseif (y <= 4e+21) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.05e-24)
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(y)) - sqrt(z));
elseif (y <= 4e+21)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.05e-24], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+21], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{-24}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} - \sqrt{y}\right) - \sqrt{z}\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+21}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.05e-24Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-60.9%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.5%
Taylor expanded in t around inf 22.8%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 35.2%
associate--l+49.2%
Applied egg-rr49.2%
associate--l+58.4%
associate-+r+58.4%
metadata-eval58.4%
+-commutative58.4%
associate--r+58.4%
Simplified58.4%
if 1.05e-24 < y < 4e21Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
associate-+r-70.7%
associate-+l-63.4%
+-commutative63.4%
+-commutative63.4%
associate--l+63.4%
Simplified33.3%
Taylor expanded in z around inf 26.2%
associate--l+30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in t around inf 30.3%
Taylor expanded in x around 0 38.3%
associate--l+38.3%
Simplified38.3%
if 4e21 < y Initial program 80.2%
associate-+l+80.2%
+-commutative80.2%
associate-+r-80.2%
associate-+l-51.1%
+-commutative51.1%
+-commutative51.1%
associate--l+51.1%
Simplified35.2%
Taylor expanded in z around inf 27.3%
associate--l+27.6%
+-commutative27.6%
Simplified27.6%
Taylor expanded in t around inf 18.8%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.5%
+-inverses22.5%
metadata-eval22.5%
Simplified22.5%
Final simplification42.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 6e-25)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 4e+17)
(+ 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 (y <= 6e-25) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 4e+17) {
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 (y <= 6d-25) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 4d+17) 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 (y <= 6e-25) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 4e+17) {
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 y <= 6e-25: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 4e+17: 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 (y <= 6e-25) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 4e+17) 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 (y <= 6e-25)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 4e+17)
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[y, 6e-25], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4e+17], 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}\;y \leq 6 \cdot 10^{-25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+17}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 5.9999999999999995e-25Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-60.9%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.5%
Taylor expanded in t around inf 22.8%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 35.2%
associate--l+58.4%
Simplified58.4%
if 5.9999999999999995e-25 < y < 4e17Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
associate-+r-70.7%
associate-+l-63.4%
+-commutative63.4%
+-commutative63.4%
associate--l+63.4%
Simplified33.3%
Taylor expanded in z around inf 26.2%
associate--l+30.7%
+-commutative30.7%
Simplified30.7%
Taylor expanded in t around inf 30.3%
Taylor expanded in x around 0 38.3%
associate--l+38.3%
Simplified38.3%
if 4e17 < y Initial program 80.2%
associate-+l+80.2%
+-commutative80.2%
associate-+r-80.2%
associate-+l-51.1%
+-commutative51.1%
+-commutative51.1%
associate--l+51.1%
Simplified35.2%
Taylor expanded in z around inf 27.3%
associate--l+27.6%
+-commutative27.6%
Simplified27.6%
Taylor expanded in t around inf 18.8%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.9%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+22.5%
+-inverses22.5%
metadata-eval22.5%
Simplified22.5%
Final simplification42.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 4.8e-137) (- 3.0 (sqrt y)) (if (<= y 2.2) (- 2.0 (sqrt y)) (- (sqrt (+ 1.0 x)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.8e-137) {
tmp = 3.0 - sqrt(y);
} else if (y <= 2.2) {
tmp = 2.0 - sqrt(y);
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.8d-137) then
tmp = 3.0d0 - sqrt(y)
else if (y <= 2.2d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.8e-137) {
tmp = 3.0 - Math.sqrt(y);
} else if (y <= 2.2) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.8e-137: tmp = 3.0 - math.sqrt(y) elif y <= 2.2: tmp = 2.0 - math.sqrt(y) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.8e-137) tmp = Float64(3.0 - sqrt(y)); elseif (y <= 2.2) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.8e-137)
tmp = 3.0 - sqrt(y);
elseif (y <= 2.2)
tmp = 2.0 - sqrt(y);
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.8e-137], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{elif}\;y \leq 2.2:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 4.8000000000000001e-137Initial program 97.8%
associate-+l+97.8%
+-commutative97.8%
associate-+r-61.8%
associate-+l-56.2%
+-commutative56.2%
+-commutative56.2%
associate--l+56.2%
Simplified39.6%
Taylor expanded in t around inf 23.1%
Taylor expanded in x around 0 37.5%
Taylor expanded in y around 0 37.5%
Taylor expanded in z around 0 48.9%
if 4.8000000000000001e-137 < y < 2.2000000000000002Initial program 96.8%
associate-+l+96.8%
+-commutative96.8%
associate-+r-61.8%
associate-+l-57.0%
+-commutative57.0%
+-commutative57.0%
associate--l+57.0%
Simplified36.3%
Taylor expanded in t around inf 23.5%
Taylor expanded in x around 0 32.9%
Taylor expanded in y around 0 31.7%
Taylor expanded in z around inf 44.5%
if 2.2000000000000002 < y Initial program 80.7%
associate-+l+80.7%
+-commutative80.7%
associate-+r-79.1%
associate-+l-50.8%
+-commutative50.8%
+-commutative50.8%
associate--l+50.8%
Simplified35.2%
Taylor expanded in z around inf 27.1%
associate--l+27.4%
+-commutative27.4%
Simplified27.4%
Taylor expanded in t around inf 19.1%
Taylor expanded in y around inf 18.5%
Final simplification34.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.5) (- 3.0 (sqrt y)) (+ 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.5) {
tmp = 3.0 - sqrt(y);
} 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.5d0) then
tmp = 3.0d0 - sqrt(y)
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.5) {
tmp = 3.0 - Math.sqrt(y);
} 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.5: tmp = 3.0 - math.sqrt(y) 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.5) tmp = Float64(3.0 - sqrt(y)); 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.5)
tmp = 3.0 - sqrt(y);
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.5], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $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.5:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.5Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r-78.1%
associate-+l-60.4%
+-commutative60.4%
+-commutative60.4%
associate--l+60.4%
Simplified38.4%
Taylor expanded in t around inf 26.1%
Taylor expanded in x around 0 38.8%
Taylor expanded in y around 0 34.9%
Taylor expanded in z around 0 34.0%
if 0.5 < z Initial program 81.8%
associate-+l+81.8%
+-commutative81.8%
associate-+r-59.7%
associate-+l-47.4%
+-commutative47.4%
+-commutative47.4%
associate--l+47.4%
Simplified35.3%
Taylor expanded in z around inf 44.6%
associate--l+46.0%
+-commutative46.0%
Simplified46.0%
Taylor expanded in t around inf 30.4%
Taylor expanded in x around 0 33.4%
associate--l+53.2%
Simplified53.2%
Final simplification43.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 9.2e+14) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 9.2e+14) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 9.2d+14) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 9.2e+14) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 9.2e+14: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 9.2e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 9.2e+14)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 9.2e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9.2 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 9.2e14Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-77.1%
associate-+l-59.0%
+-commutative59.0%
+-commutative59.0%
associate--l+59.0%
Simplified37.6%
Taylor expanded in t around inf 26.1%
Taylor expanded in x around 0 39.5%
Taylor expanded in y around 0 48.1%
associate--l+48.1%
Simplified48.1%
if 9.2e14 < z Initial program 81.4%
associate-+l+81.4%
+-commutative81.4%
associate-+r-59.6%
associate-+l-48.2%
+-commutative48.2%
+-commutative48.2%
associate--l+48.2%
Simplified36.1%
Taylor expanded in z around inf 46.6%
associate--l+48.1%
+-commutative48.1%
Simplified48.1%
Taylor expanded in t around inf 31.5%
Taylor expanded in x around 0 34.1%
associate--l+54.7%
Simplified54.7%
Final simplification51.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.75) (- 3.0 (sqrt y)) (- 2.0 (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.75) {
tmp = 3.0 - sqrt(y);
} else {
tmp = 2.0 - sqrt(y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.75d0) then
tmp = 3.0d0 - sqrt(y)
else
tmp = 2.0d0 - sqrt(y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.75) {
tmp = 3.0 - Math.sqrt(y);
} else {
tmp = 2.0 - Math.sqrt(y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.75: tmp = 3.0 - math.sqrt(y) else: tmp = 2.0 - math.sqrt(y) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.75) tmp = Float64(3.0 - sqrt(y)); else tmp = Float64(2.0 - sqrt(y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.75)
tmp = 3.0 - sqrt(y);
else
tmp = 2.0 - sqrt(y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.75], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.75:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;2 - \sqrt{y}\\
\end{array}
\end{array}
if z < 0.75Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r-78.1%
associate-+l-60.4%
+-commutative60.4%
+-commutative60.4%
associate--l+60.4%
Simplified38.4%
Taylor expanded in t around inf 26.1%
Taylor expanded in x around 0 38.8%
Taylor expanded in y around 0 34.9%
Taylor expanded in z around 0 34.0%
if 0.75 < z Initial program 81.8%
associate-+l+81.8%
+-commutative81.8%
associate-+r-59.7%
associate-+l-47.4%
+-commutative47.4%
+-commutative47.4%
associate--l+47.4%
Simplified35.3%
Taylor expanded in t around inf 4.7%
Taylor expanded in x around 0 6.4%
Taylor expanded in y around 0 5.9%
Taylor expanded in z around inf 30.7%
Final simplification32.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 2.0 (sqrt y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 2.0 - 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 = 2.0d0 - sqrt(y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 2.0 - Math.sqrt(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 2.0 - math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(2.0 - sqrt(y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 2.0 - 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[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
2 - \sqrt{y}
\end{array}
Initial program 90.3%
associate-+l+90.3%
+-commutative90.3%
associate-+r-69.2%
associate-+l-54.1%
+-commutative54.1%
+-commutative54.1%
associate--l+54.1%
Simplified36.9%
Taylor expanded in t around inf 15.7%
Taylor expanded in x around 0 23.1%
Taylor expanded in y around 0 20.8%
Taylor expanded in z around inf 26.4%
Final simplification26.4%
(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 2023268
(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))))