
(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 (+ y 1.0)) (sqrt y)))
(t_2 (sqrt (+ t 1.0)))
(t_3 (sqrt (+ z 1.0))))
(if (<= t_1 4e-6)
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (+ t_2 (- (- t_3 (sqrt z)) (sqrt t)))))
(+
(+ (- 1.0 (sqrt x)) t_1)
(+ (/ (+ z (- 1.0 z)) (+ t_3 (sqrt z))) (- t_2 (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double t_2 = sqrt((t + 1.0));
double t_3 = sqrt((z + 1.0));
double tmp;
if (t_1 <= 4e-6) {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_2 + ((t_3 - sqrt(z)) - sqrt(t))));
} else {
tmp = ((1.0 - sqrt(x)) + t_1) + (((z + (1.0 - z)) / (t_3 + sqrt(z))) + (t_2 - 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((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((t + 1.0d0))
t_3 = sqrt((z + 1.0d0))
if (t_1 <= 4d-6) then
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((0.5d0 * sqrt((1.0d0 / y))) + (t_2 + ((t_3 - sqrt(z)) - sqrt(t))))
else
tmp = ((1.0d0 - sqrt(x)) + t_1) + (((z + (1.0d0 - z)) / (t_3 + sqrt(z))) + (t_2 - 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((y + 1.0)) - Math.sqrt(y);
double t_2 = Math.sqrt((t + 1.0));
double t_3 = Math.sqrt((z + 1.0));
double tmp;
if (t_1 <= 4e-6) {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((0.5 * Math.sqrt((1.0 / y))) + (t_2 + ((t_3 - Math.sqrt(z)) - Math.sqrt(t))));
} else {
tmp = ((1.0 - Math.sqrt(x)) + t_1) + (((z + (1.0 - z)) / (t_3 + Math.sqrt(z))) + (t_2 - Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) t_2 = math.sqrt((t + 1.0)) t_3 = math.sqrt((z + 1.0)) tmp = 0 if t_1 <= 4e-6: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((0.5 * math.sqrt((1.0 / y))) + (t_2 + ((t_3 - math.sqrt(z)) - math.sqrt(t)))) else: tmp = ((1.0 - math.sqrt(x)) + t_1) + (((z + (1.0 - z)) / (t_3 + math.sqrt(z))) + (t_2 - math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = sqrt(Float64(t + 1.0)) t_3 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (t_1 <= 4e-6) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(t_2 + Float64(Float64(t_3 - sqrt(z)) - sqrt(t))))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_1) + Float64(Float64(Float64(z + Float64(1.0 - z)) / Float64(t_3 + sqrt(z))) + Float64(t_2 - 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((y + 1.0)) - sqrt(y);
t_2 = sqrt((t + 1.0));
t_3 = sqrt((z + 1.0));
tmp = 0.0;
if (t_1 <= 4e-6)
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_2 + ((t_3 - sqrt(z)) - sqrt(t))));
else
tmp = ((1.0 - sqrt(x)) + t_1) + (((z + (1.0 - z)) / (t_3 + sqrt(z))) + (t_2 - 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[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 4e-6], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(N[(z + N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
t_2 := \sqrt{t + 1}\\
t_3 := \sqrt{z + 1}\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(t\_2 + \left(\left(t\_3 - \sqrt{z}\right) - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_1\right) + \left(\frac{z + \left(1 - z\right)}{t\_3 + \sqrt{z}} + \left(t\_2 - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 3.99999999999999982e-6Initial program 91.5%
associate-+l+91.5%
associate-+l+91.5%
+-commutative91.5%
+-commutative91.5%
associate-+l-69.4%
+-commutative69.4%
+-commutative69.4%
Simplified69.4%
flip--69.4%
div-inv69.4%
add-sqr-sqrt54.5%
+-commutative54.5%
add-sqr-sqrt69.4%
associate--l+71.6%
+-commutative71.6%
Applied egg-rr71.6%
+-inverses71.6%
metadata-eval71.6%
*-lft-identity71.6%
+-commutative71.6%
Simplified71.6%
Taylor expanded in y around inf 73.7%
if 3.99999999999999982e-6 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
flip--97.8%
add-sqr-sqrt72.7%
+-commutative72.7%
add-sqr-sqrt98.3%
associate--l+98.3%
Applied egg-rr98.3%
Taylor expanded in x around 0 60.9%
Final simplification67.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 (+ z 1.0)) (sqrt z))) (t_2 (sqrt (+ t 1.0))))
(if (<= y 16500000000.0)
(+
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (+ (- (* x 0.5) (sqrt x)) 1.0))
(+ t_1 (- t_2 (sqrt t))))
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (+ t_2 (- t_1 (sqrt t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double t_2 = sqrt((t + 1.0));
double tmp;
if (y <= 16500000000.0) {
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (((x * 0.5) - sqrt(x)) + 1.0)) + (t_1 + (t_2 - sqrt(t)));
} else {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_2 + (t_1 - 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) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
t_2 = sqrt((t + 1.0d0))
if (y <= 16500000000.0d0) then
tmp = ((sqrt((y + 1.0d0)) - sqrt(y)) + (((x * 0.5d0) - sqrt(x)) + 1.0d0)) + (t_1 + (t_2 - sqrt(t)))
else
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((0.5d0 * sqrt((1.0d0 / y))) + (t_2 + (t_1 - 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((z + 1.0)) - Math.sqrt(z);
double t_2 = Math.sqrt((t + 1.0));
double tmp;
if (y <= 16500000000.0) {
tmp = ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (((x * 0.5) - Math.sqrt(x)) + 1.0)) + (t_1 + (t_2 - Math.sqrt(t)));
} else {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((0.5 * Math.sqrt((1.0 / y))) + (t_2 + (t_1 - Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) t_2 = math.sqrt((t + 1.0)) tmp = 0 if y <= 16500000000.0: tmp = ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (((x * 0.5) - math.sqrt(x)) + 1.0)) + (t_1 + (t_2 - math.sqrt(t))) else: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((0.5 * math.sqrt((1.0 / y))) + (t_2 + (t_1 - math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) t_2 = sqrt(Float64(t + 1.0)) tmp = 0.0 if (y <= 16500000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * 0.5) - sqrt(x)) + 1.0)) + Float64(t_1 + Float64(t_2 - sqrt(t)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(t_2 + Float64(t_1 - 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((z + 1.0)) - sqrt(z);
t_2 = sqrt((t + 1.0));
tmp = 0.0;
if (y <= 16500000000.0)
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (((x * 0.5) - sqrt(x)) + 1.0)) + (t_1 + (t_2 - sqrt(t)));
else
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_2 + (t_1 - 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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 16500000000.0], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
t_2 := \sqrt{t + 1}\\
\mathbf{if}\;y \leq 16500000000:\\
\;\;\;\;\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot 0.5 - \sqrt{x}\right) + 1\right)\right) + \left(t\_1 + \left(t\_2 - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(t\_2 + \left(t\_1 - \sqrt{t}\right)\right)\right)\\
\end{array}
\end{array}
if y < 1.65e10Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 62.5%
associate--l+62.5%
Simplified62.5%
if 1.65e10 < y Initial program 91.5%
associate-+l+91.5%
associate-+l+91.5%
+-commutative91.5%
+-commutative91.5%
associate-+l-69.4%
+-commutative69.4%
+-commutative69.4%
Simplified69.4%
flip--69.4%
div-inv69.4%
add-sqr-sqrt54.5%
+-commutative54.5%
add-sqr-sqrt69.4%
associate--l+71.6%
+-commutative71.6%
Applied egg-rr71.6%
+-inverses71.6%
metadata-eval71.6%
*-lft-identity71.6%
+-commutative71.6%
Simplified71.6%
Taylor expanded in y around inf 73.7%
Final simplification67.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 (+ z 1.0))) (t_2 (sqrt (+ y 1.0))))
(if (<= x 4.5e-19)
(+
(+ (- t_2 (sqrt y)) (+ (- (* x 0.5) (sqrt x)) 1.0))
(+ (- t_1 (sqrt z)) (- (sqrt (+ t 1.0)) (sqrt t))))
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(- (+ t_1 t_2) (+ (sqrt z) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((y + 1.0));
double tmp;
if (x <= 4.5e-19) {
tmp = ((t_2 - sqrt(y)) + (((x * 0.5) - sqrt(x)) + 1.0)) + ((t_1 - sqrt(z)) + (sqrt((t + 1.0)) - sqrt(t)));
} else {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_1 + t_2) - (sqrt(z) + 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((z + 1.0d0))
t_2 = sqrt((y + 1.0d0))
if (x <= 4.5d-19) then
tmp = ((t_2 - sqrt(y)) + (((x * 0.5d0) - sqrt(x)) + 1.0d0)) + ((t_1 - sqrt(z)) + (sqrt((t + 1.0d0)) - sqrt(t)))
else
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((t_1 + t_2) - (sqrt(z) + 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((z + 1.0));
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (x <= 4.5e-19) {
tmp = ((t_2 - Math.sqrt(y)) + (((x * 0.5) - Math.sqrt(x)) + 1.0)) + ((t_1 - Math.sqrt(z)) + (Math.sqrt((t + 1.0)) - Math.sqrt(t)));
} else {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((t_1 + t_2) - (Math.sqrt(z) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((y + 1.0)) tmp = 0 if x <= 4.5e-19: tmp = ((t_2 - math.sqrt(y)) + (((x * 0.5) - math.sqrt(x)) + 1.0)) + ((t_1 - math.sqrt(z)) + (math.sqrt((t + 1.0)) - math.sqrt(t))) else: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((t_1 + t_2) - (math.sqrt(z) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (x <= 4.5e-19) tmp = Float64(Float64(Float64(t_2 - sqrt(y)) + Float64(Float64(Float64(x * 0.5) - sqrt(x)) + 1.0)) + Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(t_1 + t_2) - Float64(sqrt(z) + 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((z + 1.0));
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (x <= 4.5e-19)
tmp = ((t_2 - sqrt(y)) + (((x * 0.5) - sqrt(x)) + 1.0)) + ((t_1 - sqrt(z)) + (sqrt((t + 1.0)) - sqrt(t)));
else
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((t_1 + t_2) - (sqrt(z) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 4.5e-19], N[(N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + t$95$2), $MachinePrecision] - N[(N[Sqrt[z], $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{z + 1}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;x \leq 4.5 \cdot 10^{-19}:\\
\;\;\;\;\left(\left(t\_2 - \sqrt{y}\right) + \left(\left(x \cdot 0.5 - \sqrt{x}\right) + 1\right)\right) + \left(\left(t\_1 - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(\left(t\_1 + t\_2\right) - \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if x < 4.50000000000000013e-19Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 97.9%
associate--l+97.9%
Simplified97.9%
if 4.50000000000000013e-19 < x Initial program 90.9%
associate-+l+90.9%
associate-+l+91.0%
+-commutative91.0%
+-commutative91.0%
associate-+l-67.4%
+-commutative67.4%
+-commutative67.4%
Simplified67.4%
flip--67.4%
div-inv67.4%
add-sqr-sqrt34.2%
+-commutative34.2%
add-sqr-sqrt67.4%
associate--l+70.2%
+-commutative70.2%
Applied egg-rr70.2%
+-inverses70.2%
metadata-eval70.2%
*-lft-identity70.2%
+-commutative70.2%
Simplified70.2%
Taylor expanded in t around inf 30.2%
Final simplification67.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_2 (- (sqrt (+ y 1.0)) (sqrt y))))
(if (<= t 280000000.0)
(+ (+ t_2 t_1) (+ (- 1.0 (sqrt z)) (/ 1.0 (+ (sqrt (+ t 1.0)) (sqrt t)))))
(+
t_1
(+ t_2 (- (+ (sqrt (+ z 1.0)) (* 0.5 (sqrt (/ 1.0 t)))) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double t_2 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (t <= 280000000.0) {
tmp = (t_2 + t_1) + ((1.0 - sqrt(z)) + (1.0 / (sqrt((t + 1.0)) + sqrt(t))));
} else {
tmp = t_1 + (t_2 + ((sqrt((z + 1.0)) + (0.5 * sqrt((1.0 / t)))) - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((x + 1.0d0)) - sqrt(x)
t_2 = sqrt((y + 1.0d0)) - sqrt(y)
if (t <= 280000000.0d0) then
tmp = (t_2 + t_1) + ((1.0d0 - sqrt(z)) + (1.0d0 / (sqrt((t + 1.0d0)) + sqrt(t))))
else
tmp = t_1 + (t_2 + ((sqrt((z + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / t)))) - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_2 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double tmp;
if (t <= 280000000.0) {
tmp = (t_2 + t_1) + ((1.0 - Math.sqrt(z)) + (1.0 / (Math.sqrt((t + 1.0)) + Math.sqrt(t))));
} else {
tmp = t_1 + (t_2 + ((Math.sqrt((z + 1.0)) + (0.5 * Math.sqrt((1.0 / t)))) - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) t_2 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if t <= 280000000.0: tmp = (t_2 + t_1) + ((1.0 - math.sqrt(z)) + (1.0 / (math.sqrt((t + 1.0)) + math.sqrt(t)))) else: tmp = t_1 + (t_2 + ((math.sqrt((z + 1.0)) + (0.5 * math.sqrt((1.0 / t)))) - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_2 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (t <= 280000000.0) tmp = Float64(Float64(t_2 + t_1) + Float64(Float64(1.0 - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(t + 1.0)) + sqrt(t))))); else tmp = Float64(t_1 + Float64(t_2 + Float64(Float64(sqrt(Float64(z + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0)) - sqrt(x);
t_2 = sqrt((y + 1.0)) - sqrt(y);
tmp = 0.0;
if (t <= 280000000.0)
tmp = (t_2 + t_1) + ((1.0 - sqrt(z)) + (1.0 / (sqrt((t + 1.0)) + sqrt(t))));
else
tmp = t_1 + (t_2 + ((sqrt((z + 1.0)) + (0.5 * sqrt((1.0 / t)))) - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 280000000.0], N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t$95$2 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
t_2 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;t \leq 280000000:\\
\;\;\;\;\left(t\_2 + t\_1\right) + \left(\left(1 - \sqrt{z}\right) + \frac{1}{\sqrt{t + 1} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t\_2 + \left(\left(\sqrt{z + 1} + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if t < 2.8e8Initial program 98.5%
associate-+l+98.5%
sub-neg98.5%
sub-neg98.5%
+-commutative98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
flip--98.7%
div-inv98.7%
add-sqr-sqrt98.6%
add-sqr-sqrt98.7%
associate--l+98.7%
Applied egg-rr98.7%
+-inverses98.7%
metadata-eval98.7%
*-lft-identity98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in z around 0 51.1%
if 2.8e8 < t Initial program 91.2%
associate-+l+91.2%
associate-+l+91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l-49.9%
+-commutative49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in t around inf 91.6%
Final simplification71.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 (+ x 1.0)) (sqrt x)))
(t_2 (- (sqrt (+ y 1.0)) (sqrt y))))
(if (<= t 1.15e+26)
(+ (+ t_2 t_1) (+ (- 1.0 (sqrt z)) (/ 1.0 (+ (sqrt (+ t 1.0)) (sqrt t)))))
(+ t_1 (+ (- (sqrt (+ z 1.0)) (sqrt z)) t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double t_2 = sqrt((y + 1.0)) - sqrt(y);
double tmp;
if (t <= 1.15e+26) {
tmp = (t_2 + t_1) + ((1.0 - sqrt(z)) + (1.0 / (sqrt((t + 1.0)) + sqrt(t))));
} else {
tmp = t_1 + ((sqrt((z + 1.0)) - sqrt(z)) + 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) :: tmp
t_1 = sqrt((x + 1.0d0)) - sqrt(x)
t_2 = sqrt((y + 1.0d0)) - sqrt(y)
if (t <= 1.15d+26) then
tmp = (t_2 + t_1) + ((1.0d0 - sqrt(z)) + (1.0d0 / (sqrt((t + 1.0d0)) + sqrt(t))))
else
tmp = t_1 + ((sqrt((z + 1.0d0)) - sqrt(z)) + 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((x + 1.0)) - Math.sqrt(x);
double t_2 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double tmp;
if (t <= 1.15e+26) {
tmp = (t_2 + t_1) + ((1.0 - Math.sqrt(z)) + (1.0 / (Math.sqrt((t + 1.0)) + Math.sqrt(t))));
} else {
tmp = t_1 + ((Math.sqrt((z + 1.0)) - Math.sqrt(z)) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) t_2 = math.sqrt((y + 1.0)) - math.sqrt(y) tmp = 0 if t <= 1.15e+26: tmp = (t_2 + t_1) + ((1.0 - math.sqrt(z)) + (1.0 / (math.sqrt((t + 1.0)) + math.sqrt(t)))) else: tmp = t_1 + ((math.sqrt((z + 1.0)) - math.sqrt(z)) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_2 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) tmp = 0.0 if (t <= 1.15e+26) tmp = Float64(Float64(t_2 + t_1) + Float64(Float64(1.0 - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(t + 1.0)) + sqrt(t))))); else tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 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((x + 1.0)) - sqrt(x);
t_2 = sqrt((y + 1.0)) - sqrt(y);
tmp = 0.0;
if (t <= 1.15e+26)
tmp = (t_2 + t_1) + ((1.0 - sqrt(z)) + (1.0 / (sqrt((t + 1.0)) + sqrt(t))));
else
tmp = t_1 + ((sqrt((z + 1.0)) - sqrt(z)) + 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[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.15e+26], N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
t_2 := \sqrt{y + 1} - \sqrt{y}\\
\mathbf{if}\;t \leq 1.15 \cdot 10^{+26}:\\
\;\;\;\;\left(t\_2 + t\_1\right) + \left(\left(1 - \sqrt{z}\right) + \frac{1}{\sqrt{t + 1} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + t\_2\right)\\
\end{array}
\end{array}
if t < 1.15e26Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
flip--98.2%
div-inv98.2%
add-sqr-sqrt98.0%
add-sqr-sqrt98.5%
associate--l+98.7%
Applied egg-rr98.7%
+-inverses98.7%
metadata-eval98.7%
*-lft-identity98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in z around 0 51.5%
if 1.15e26 < t Initial program 91.7%
associate-+l+91.7%
associate-+l+91.7%
+-commutative91.7%
+-commutative91.7%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
Simplified49.4%
Taylor expanded in t around inf 91.7%
Final simplification71.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 280000000.0)
(-
(+ 3.0 (+ (sqrt (+ t 1.0)) (* y 0.5)))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (- (sqrt (+ z 1.0)) (sqrt z)) (- (sqrt (+ y 1.0)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 280000000.0) {
tmp = (3.0 + (sqrt((t + 1.0)) + (y * 0.5))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((z + 1.0)) - sqrt(z)) + (sqrt((y + 1.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 (t <= 280000000.0d0) then
tmp = (3.0d0 + (sqrt((t + 1.0d0)) + (y * 0.5d0))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))))
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((sqrt((z + 1.0d0)) - sqrt(z)) + (sqrt((y + 1.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 (t <= 280000000.0) {
tmp = (3.0 + (Math.sqrt((t + 1.0)) + (y * 0.5))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 280000000.0: tmp = (3.0 + (math.sqrt((t + 1.0)) + (y * 0.5))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((math.sqrt((z + 1.0)) - math.sqrt(z)) + (math.sqrt((y + 1.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 (t <= 280000000.0) tmp = Float64(Float64(3.0 + Float64(sqrt(Float64(t + 1.0)) + Float64(y * 0.5))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(sqrt(Float64(y + 1.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 (t <= 280000000.0)
tmp = (3.0 + (sqrt((t + 1.0)) + (y * 0.5))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
else
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((z + 1.0)) - sqrt(z)) + (sqrt((y + 1.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[t, 280000000.0], N[(N[(3.0 + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $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}
\mathbf{if}\;t \leq 280000000:\\
\;\;\;\;\left(3 + \left(\sqrt{t + 1} + y \cdot 0.5\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 2.8e8Initial program 98.5%
associate-+l+98.5%
associate-+l+98.6%
+-commutative98.6%
+-commutative98.6%
associate-+l-98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in y around 0 49.5%
Taylor expanded in x around 0 18.0%
+-commutative18.0%
*-commutative18.0%
Simplified18.0%
Taylor expanded in z around 0 16.2%
if 2.8e8 < t Initial program 91.2%
associate-+l+91.2%
associate-+l+91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l-49.9%
+-commutative49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in t around inf 91.1%
Final simplification54.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 (+ x 1.0)) (sqrt x))))
(if (<= y 1.25)
(+ t_1 (+ (- (sqrt (+ z 1.0)) (sqrt z)) (- (+ (* y 0.5) 1.0) (sqrt y))))
(+ t_1 (+ (* 0.5 (sqrt (/ 1.0 y))) (- (sqrt (+ t 1.0)) (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double tmp;
if (y <= 1.25) {
tmp = t_1 + ((sqrt((z + 1.0)) - sqrt(z)) + (((y * 0.5) + 1.0) - sqrt(y)));
} else {
tmp = t_1 + ((0.5 * sqrt((1.0 / y))) + (sqrt((t + 1.0)) - 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) :: tmp
t_1 = sqrt((x + 1.0d0)) - sqrt(x)
if (y <= 1.25d0) then
tmp = t_1 + ((sqrt((z + 1.0d0)) - sqrt(z)) + (((y * 0.5d0) + 1.0d0) - sqrt(y)))
else
tmp = t_1 + ((0.5d0 * sqrt((1.0d0 / y))) + (sqrt((t + 1.0d0)) - 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((x + 1.0)) - Math.sqrt(x);
double tmp;
if (y <= 1.25) {
tmp = t_1 + ((Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (((y * 0.5) + 1.0) - Math.sqrt(y)));
} else {
tmp = t_1 + ((0.5 * Math.sqrt((1.0 / y))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) tmp = 0 if y <= 1.25: tmp = t_1 + ((math.sqrt((z + 1.0)) - math.sqrt(z)) + (((y * 0.5) + 1.0) - math.sqrt(y))) else: tmp = t_1 + ((0.5 * math.sqrt((1.0 / y))) + (math.sqrt((t + 1.0)) - math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) tmp = 0.0 if (y <= 1.25) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(Float64(Float64(y * 0.5) + 1.0) - sqrt(y)))); else tmp = Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(sqrt(Float64(t + 1.0)) - 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((x + 1.0)) - sqrt(x);
tmp = 0.0;
if (y <= 1.25)
tmp = t_1 + ((sqrt((z + 1.0)) - sqrt(z)) + (((y * 0.5) + 1.0) - sqrt(y)));
else
tmp = t_1 + ((0.5 * sqrt((1.0 / y))) + (sqrt((t + 1.0)) - 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[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.25], N[(t$95$1 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
\mathbf{if}\;y \leq 1.25:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\left(y \cdot 0.5 + 1\right) - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if y < 1.25Initial program 97.9%
associate-+l+97.9%
associate-+l+97.9%
+-commutative97.9%
+-commutative97.9%
associate-+l-77.8%
+-commutative77.8%
+-commutative77.8%
Simplified77.8%
Taylor expanded in y around 0 77.1%
Taylor expanded in t around inf 61.2%
if 1.25 < y Initial program 91.6%
associate-+l+91.6%
associate-+l+91.6%
+-commutative91.6%
+-commutative91.6%
associate-+l-69.3%
+-commutative69.3%
+-commutative69.3%
Simplified69.3%
Taylor expanded in z around inf 46.2%
Taylor expanded in y around inf 48.2%
Final simplification54.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 4.1e+15)
(+ 2.0 (- (fma 0.5 y (sqrt (+ z 1.0))) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (* 0.5 (sqrt (/ 1.0 t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.1e+15) {
tmp = 2.0 + (fma(0.5, y, sqrt((z + 1.0))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((y + 1.0)) - sqrt(y)) + (0.5 * sqrt((1.0 / t))));
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4.1e+15) tmp = Float64(2.0 + Float64(fma(0.5, y, sqrt(Float64(z + 1.0))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); end return tmp end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.1e+15], N[(2.0 + N[(N[(0.5 * y + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(\mathsf{fma}\left(0.5, y, \sqrt{z + 1}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\end{array}
\end{array}
if z < 4.1e15Initial program 97.4%
associate-+l+97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 30.4%
Taylor expanded in t around inf 19.6%
Taylor expanded in x around 0 18.3%
associate--l+18.3%
+-commutative18.3%
fma-undefine18.3%
Simplified18.3%
if 4.1e15 < z Initial program 91.8%
associate-+l+91.8%
associate-+l+91.8%
+-commutative91.8%
+-commutative91.8%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 91.8%
Taylor expanded in t around inf 47.1%
Final simplification31.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 4.1e+15)
(+ 2.0 (- (fma 0.5 y (sqrt (+ z 1.0))) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
(- (sqrt (+ y 1.0)) (sqrt y))
(+ (- (* x (+ 0.5 (* x -0.125))) (sqrt x)) 1.0))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.1e+15) {
tmp = 2.0 + (fma(0.5, y, sqrt((z + 1.0))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4.1e+15) tmp = Float64(2.0 + Float64(fma(0.5, y, sqrt(Float64(z + 1.0))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x)) + 1.0)); end return tmp end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.1e+15], N[(2.0 + N[(N[(0.5 * y + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(\mathsf{fma}\left(0.5, y, \sqrt{z + 1}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right) + 1\right)\\
\end{array}
\end{array}
if z < 4.1e15Initial program 97.4%
associate-+l+97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 30.4%
Taylor expanded in t around inf 19.6%
Taylor expanded in x around 0 18.3%
associate--l+18.3%
+-commutative18.3%
fma-undefine18.3%
Simplified18.3%
if 4.1e15 < z Initial program 91.8%
associate-+l+91.8%
associate-+l+91.8%
+-commutative91.8%
+-commutative91.8%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 91.8%
Taylor expanded in x around 0 61.5%
associate--l+61.6%
Simplified61.6%
Taylor expanded in t around inf 37.2%
Final simplification27.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 2.3e+16)
(+
2.0
(-
(* y (+ 0.5 (* (/ 1.0 y) (sqrt (+ z 1.0)))))
(+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
(- (sqrt (+ y 1.0)) (sqrt y))
(+ (- (* x (+ 0.5 (* x -0.125))) (sqrt x)) 1.0))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.3e+16) {
tmp = 2.0 + ((y * (0.5 + ((1.0 / y) * sqrt((z + 1.0))))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
}
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 <= 2.3d+16) then
tmp = 2.0d0 + ((y * (0.5d0 + ((1.0d0 / y) * sqrt((z + 1.0d0))))) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + (((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x)) + 1.0d0)
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 <= 2.3e+16) {
tmp = 2.0 + ((y * (0.5 + ((1.0 / y) * Math.sqrt((z + 1.0))))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - Math.sqrt(x)) + 1.0);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 2.3e+16: tmp = 2.0 + ((y * (0.5 + ((1.0 / y) * math.sqrt((z + 1.0))))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) else: tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - math.sqrt(x)) + 1.0) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 2.3e+16) tmp = Float64(2.0 + Float64(Float64(y * Float64(0.5 + Float64(Float64(1.0 / y) * sqrt(Float64(z + 1.0))))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x)) + 1.0)); 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 <= 2.3e+16)
tmp = 2.0 + ((y * (0.5 + ((1.0 / y) * sqrt((z + 1.0))))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
else
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
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, 2.3e+16], N[(2.0 + N[(N[(y * N[(0.5 + N[(N[(1.0 / y), $MachinePrecision] * N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.3 \cdot 10^{+16}:\\
\;\;\;\;2 + \left(y \cdot \left(0.5 + \frac{1}{y} \cdot \sqrt{z + 1}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right) + 1\right)\\
\end{array}
\end{array}
if z < 2.3e16Initial program 97.4%
associate-+l+97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 30.4%
Taylor expanded in t around inf 19.6%
Taylor expanded in x around 0 18.3%
associate--l+18.3%
+-commutative18.3%
fma-undefine18.3%
Simplified18.3%
Taylor expanded in y around inf 18.3%
if 2.3e16 < z Initial program 91.8%
associate-+l+91.8%
associate-+l+91.8%
+-commutative91.8%
+-commutative91.8%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 91.8%
Taylor expanded in x around 0 61.5%
associate--l+61.6%
Simplified61.6%
Taylor expanded in t around inf 37.2%
Final simplification27.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 4.1e+15)
(-
(+ 2.0 (+ (sqrt (+ z 1.0)) (* y 0.5)))
(+ (sqrt x) (+ (sqrt z) (sqrt y))))
(+
(- (sqrt (+ y 1.0)) (sqrt y))
(+ (- (* x (+ 0.5 (* x -0.125))) (sqrt x)) 1.0))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.1e+15) {
tmp = (2.0 + (sqrt((z + 1.0)) + (y * 0.5))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 4.1d+15) then
tmp = (2.0d0 + (sqrt((z + 1.0d0)) + (y * 0.5d0))) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + (((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x)) + 1.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.1e+15) {
tmp = (2.0 + (Math.sqrt((z + 1.0)) + (y * 0.5))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - Math.sqrt(x)) + 1.0);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4.1e+15: tmp = (2.0 + (math.sqrt((z + 1.0)) + (y * 0.5))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - math.sqrt(x)) + 1.0) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4.1e+15) tmp = Float64(Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) + Float64(y * 0.5))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x)) + 1.0)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 4.1e+15)
tmp = (2.0 + (sqrt((z + 1.0)) + (y * 0.5))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.1e+15], N[(N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;\left(2 + \left(\sqrt{z + 1} + y \cdot 0.5\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right) + 1\right)\\
\end{array}
\end{array}
if z < 4.1e15Initial program 97.4%
associate-+l+97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 30.4%
Taylor expanded in t around inf 19.6%
Taylor expanded in x around 0 18.3%
if 4.1e15 < z Initial program 91.8%
associate-+l+91.8%
associate-+l+91.8%
+-commutative91.8%
+-commutative91.8%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 91.8%
Taylor expanded in x around 0 61.5%
associate--l+61.6%
Simplified61.6%
Taylor expanded in t around inf 37.2%
Final simplification27.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 4.1e+15)
(+ 2.0 (- (sqrt (+ z 1.0)) (+ (sqrt z) (+ (sqrt y) (sqrt x)))))
(+
(- (sqrt (+ y 1.0)) (sqrt y))
(+ (- (* x (+ 0.5 (* x -0.125))) (sqrt x)) 1.0))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.1e+15) {
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(z) + (sqrt(y) + sqrt(x))));
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 4.1d+15) then
tmp = 2.0d0 + (sqrt((z + 1.0d0)) - (sqrt(z) + (sqrt(y) + sqrt(x))))
else
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + (((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x)) + 1.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.1e+15) {
tmp = 2.0 + (Math.sqrt((z + 1.0)) - (Math.sqrt(z) + (Math.sqrt(y) + Math.sqrt(x))));
} else {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - Math.sqrt(x)) + 1.0);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4.1e+15: tmp = 2.0 + (math.sqrt((z + 1.0)) - (math.sqrt(z) + (math.sqrt(y) + math.sqrt(x)))) else: tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - math.sqrt(x)) + 1.0) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4.1e+15) tmp = Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x))))); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x)) + 1.0)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 4.1e+15)
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(z) + (sqrt(y) + sqrt(x))));
else
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.1e+15], N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(\sqrt{z + 1} - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right) + 1\right)\\
\end{array}
\end{array}
if z < 4.1e15Initial program 97.4%
associate-+l+97.4%
associate-+l+97.4%
+-commutative97.4%
+-commutative97.4%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 30.4%
Taylor expanded in t around inf 19.6%
Taylor expanded in x around 0 18.3%
associate--l+18.3%
+-commutative18.3%
fma-undefine18.3%
Simplified18.3%
Taylor expanded in y around 0 16.6%
+-commutative16.6%
+-commutative16.6%
associate-+l+16.6%
+-commutative16.6%
Simplified16.6%
if 4.1e15 < z Initial program 91.8%
associate-+l+91.8%
associate-+l+91.8%
+-commutative91.8%
+-commutative91.8%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in z around inf 91.8%
Taylor expanded in x around 0 61.5%
associate--l+61.6%
Simplified61.6%
Taylor expanded in t around inf 37.2%
Final simplification26.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.3)
(+
2.0
(-
(+ (+ (* y 0.5) (* z (+ 0.5 (* z (- (* z 0.0625) 0.125))))) 1.0)
(+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= z 1.65e+48)
(+ 2.0 (- (* 0.5 (+ y (sqrt (/ 1.0 z)))) (+ (sqrt y) (sqrt x))))
(+
(- (sqrt (+ y 1.0)) (sqrt y))
(+ (- (* x (+ 0.5 (* x -0.125))) (sqrt x)) 1.0)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.3) {
tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (z <= 1.65e+48) {
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x)));
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
}
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 <= 1.3d0) then
tmp = 2.0d0 + ((((y * 0.5d0) + (z * (0.5d0 + (z * ((z * 0.0625d0) - 0.125d0))))) + 1.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (z <= 1.65d+48) then
tmp = 2.0d0 + ((0.5d0 * (y + sqrt((1.0d0 / z)))) - (sqrt(y) + sqrt(x)))
else
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + (((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x)) + 1.0d0)
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 <= 1.3) {
tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + 1.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (z <= 1.65e+48) {
tmp = 2.0 + ((0.5 * (y + Math.sqrt((1.0 / z)))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - Math.sqrt(x)) + 1.0);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.3: tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + 1.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif z <= 1.65e+48: tmp = 2.0 + ((0.5 * (y + math.sqrt((1.0 / z)))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - math.sqrt(x)) + 1.0) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.3) tmp = Float64(2.0 + Float64(Float64(Float64(Float64(y * 0.5) + Float64(z * Float64(0.5 + Float64(z * Float64(Float64(z * 0.0625) - 0.125))))) + 1.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (z <= 1.65e+48) tmp = Float64(2.0 + Float64(Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z)))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x)) + 1.0)); 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 <= 1.3)
tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * ((z * 0.0625) - 0.125))))) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (z <= 1.65e+48)
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x)));
else
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
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, 1.3], N[(2.0 + N[(N[(N[(N[(y * 0.5), $MachinePrecision] + N[(z * N[(0.5 + N[(z * N[(N[(z * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+48], N[(2.0 + N[(N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.3:\\
\;\;\;\;2 + \left(\left(\left(y \cdot 0.5 + z \cdot \left(0.5 + z \cdot \left(z \cdot 0.0625 - 0.125\right)\right)\right) + 1\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+48}:\\
\;\;\;\;2 + \left(0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right) + 1\right)\\
\end{array}
\end{array}
if z < 1.30000000000000004Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 29.8%
Taylor expanded in t around inf 19.3%
Taylor expanded in x around 0 17.9%
associate--l+17.9%
+-commutative17.9%
fma-undefine17.9%
Simplified17.9%
Taylor expanded in z around 0 17.9%
if 1.30000000000000004 < z < 1.65000000000000011e48Initial program 83.6%
associate-+l+83.6%
associate-+l+83.6%
+-commutative83.6%
+-commutative83.6%
associate-+l-78.5%
+-commutative78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in t around inf 17.0%
Taylor expanded in x around 0 16.3%
associate--l+16.3%
+-commutative16.3%
fma-undefine16.3%
Simplified16.3%
Taylor expanded in z around inf 18.4%
distribute-lft-out18.4%
Simplified18.4%
if 1.65000000000000011e48 < z Initial program 92.6%
associate-+l+92.6%
associate-+l+92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l-92.6%
+-commutative92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in z around inf 92.6%
Taylor expanded in x around 0 62.6%
associate--l+62.6%
Simplified62.6%
Taylor expanded in t around inf 37.8%
Final simplification26.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 (<= z 1.25)
(+
2.0
(-
(+ (+ (* y 0.5) (* z (+ 0.5 (* z -0.125)))) 1.0)
(+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= z 1.65e+48)
(+ 2.0 (- (* 0.5 (+ y (sqrt (/ 1.0 z)))) (+ (sqrt y) (sqrt x))))
(+
(- (sqrt (+ y 1.0)) (sqrt y))
(+ (- (* x (+ 0.5 (* x -0.125))) (sqrt x)) 1.0)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.25) {
tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * -0.125)))) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (z <= 1.65e+48) {
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x)));
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
}
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 <= 1.25d0) then
tmp = 2.0d0 + ((((y * 0.5d0) + (z * (0.5d0 + (z * (-0.125d0))))) + 1.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (z <= 1.65d+48) then
tmp = 2.0d0 + ((0.5d0 * (y + sqrt((1.0d0 / z)))) - (sqrt(y) + sqrt(x)))
else
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + (((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x)) + 1.0d0)
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 <= 1.25) {
tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * -0.125)))) + 1.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (z <= 1.65e+48) {
tmp = 2.0 + ((0.5 * (y + Math.sqrt((1.0 / z)))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - Math.sqrt(x)) + 1.0);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.25: tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * -0.125)))) + 1.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif z <= 1.65e+48: tmp = 2.0 + ((0.5 * (y + math.sqrt((1.0 / z)))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - math.sqrt(x)) + 1.0) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.25) tmp = Float64(2.0 + Float64(Float64(Float64(Float64(y * 0.5) + Float64(z * Float64(0.5 + Float64(z * -0.125)))) + 1.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (z <= 1.65e+48) tmp = Float64(2.0 + Float64(Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z)))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x)) + 1.0)); 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 <= 1.25)
tmp = 2.0 + ((((y * 0.5) + (z * (0.5 + (z * -0.125)))) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (z <= 1.65e+48)
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x)));
else
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
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, 1.25], N[(2.0 + N[(N[(N[(N[(y * 0.5), $MachinePrecision] + N[(z * N[(0.5 + N[(z * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+48], N[(2.0 + N[(N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.25:\\
\;\;\;\;2 + \left(\left(\left(y \cdot 0.5 + z \cdot \left(0.5 + z \cdot -0.125\right)\right) + 1\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+48}:\\
\;\;\;\;2 + \left(0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right) + 1\right)\\
\end{array}
\end{array}
if z < 1.25Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 29.8%
Taylor expanded in t around inf 19.3%
Taylor expanded in x around 0 17.9%
associate--l+17.9%
+-commutative17.9%
fma-undefine17.9%
Simplified17.9%
Taylor expanded in z around 0 17.9%
if 1.25 < z < 1.65000000000000011e48Initial program 83.6%
associate-+l+83.6%
associate-+l+83.6%
+-commutative83.6%
+-commutative83.6%
associate-+l-78.5%
+-commutative78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in t around inf 17.0%
Taylor expanded in x around 0 16.3%
associate--l+16.3%
+-commutative16.3%
fma-undefine16.3%
Simplified16.3%
Taylor expanded in z around inf 18.4%
distribute-lft-out18.4%
Simplified18.4%
if 1.65000000000000011e48 < z Initial program 92.6%
associate-+l+92.6%
associate-+l+92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l-92.6%
+-commutative92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in z around inf 92.6%
Taylor expanded in x around 0 62.6%
associate--l+62.6%
Simplified62.6%
Taylor expanded in t around inf 37.8%
Final simplification26.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 (<= z 1.0)
(+ 2.0 (- (+ (* 0.5 (+ y z)) 1.0) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= z 1.65e+48)
(+ 2.0 (- (* 0.5 (+ y (sqrt (/ 1.0 z)))) (+ (sqrt y) (sqrt x))))
(+
(- (sqrt (+ y 1.0)) (sqrt y))
(+ (- (* x (+ 0.5 (* x -0.125))) (sqrt x)) 1.0)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.0) {
tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (z <= 1.65e+48) {
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x)));
} else {
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
}
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 <= 1.0d0) then
tmp = 2.0d0 + (((0.5d0 * (y + z)) + 1.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (z <= 1.65d+48) then
tmp = 2.0d0 + ((0.5d0 * (y + sqrt((1.0d0 / z)))) - (sqrt(y) + sqrt(x)))
else
tmp = (sqrt((y + 1.0d0)) - sqrt(y)) + (((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x)) + 1.0d0)
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 <= 1.0) {
tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (z <= 1.65e+48) {
tmp = 2.0 + ((0.5 * (y + Math.sqrt((1.0 / z)))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - Math.sqrt(x)) + 1.0);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.0: tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif z <= 1.65e+48: tmp = 2.0 + ((0.5 * (y + math.sqrt((1.0 / z)))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (math.sqrt((y + 1.0)) - math.sqrt(y)) + (((x * (0.5 + (x * -0.125))) - math.sqrt(x)) + 1.0) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.0) tmp = Float64(2.0 + Float64(Float64(Float64(0.5 * Float64(y + z)) + 1.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (z <= 1.65e+48) tmp = Float64(2.0 + Float64(Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z)))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x)) + 1.0)); 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 <= 1.0)
tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (z <= 1.65e+48)
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x)));
else
tmp = (sqrt((y + 1.0)) - sqrt(y)) + (((x * (0.5 + (x * -0.125))) - sqrt(x)) + 1.0);
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, 1.0], N[(2.0 + N[(N[(N[(0.5 * N[(y + z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+48], N[(2.0 + N[(N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;2 + \left(\left(0.5 \cdot \left(y + z\right) + 1\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+48}:\\
\;\;\;\;2 + \left(0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right) + 1\right)\\
\end{array}
\end{array}
if z < 1Initial program 97.7%
associate-+l+97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
associate-+l-57.9%
+-commutative57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in y around 0 29.8%
Taylor expanded in t around inf 19.3%
Taylor expanded in x around 0 17.9%
associate--l+17.9%
+-commutative17.9%
fma-undefine17.9%
Simplified17.9%
Taylor expanded in z around 0 17.9%
distribute-lft-out17.9%
+-commutative17.9%
Simplified17.9%
if 1 < z < 1.65000000000000011e48Initial program 83.6%
associate-+l+83.6%
associate-+l+83.6%
+-commutative83.6%
+-commutative83.6%
associate-+l-78.5%
+-commutative78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around 0 45.1%
Taylor expanded in t around inf 17.0%
Taylor expanded in x around 0 16.3%
associate--l+16.3%
+-commutative16.3%
fma-undefine16.3%
Simplified16.3%
Taylor expanded in z around inf 18.4%
distribute-lft-out18.4%
Simplified18.4%
if 1.65000000000000011e48 < z Initial program 92.6%
associate-+l+92.6%
associate-+l+92.6%
+-commutative92.6%
+-commutative92.6%
associate-+l-92.6%
+-commutative92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in z around inf 92.6%
Taylor expanded in x around 0 62.6%
associate--l+62.6%
Simplified62.6%
Taylor expanded in t around inf 37.8%
Final simplification26.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.7e-226)
(+ 2.0 (- (+ (* 0.5 (+ y z)) 1.0) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 4.5e+15)
(- (+ (sqrt (+ y 1.0)) 1.0) (+ (sqrt y) (sqrt x)))
(- 1.0 (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.7e-226) {
tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 4.5e+15) {
tmp = (sqrt((y + 1.0)) + 1.0) - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.7d-226) then
tmp = 2.0d0 + (((0.5d0 * (y + z)) + 1.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 4.5d+15) then
tmp = (sqrt((y + 1.0d0)) + 1.0d0) - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.7e-226) {
tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 4.5e+15) {
tmp = (Math.sqrt((y + 1.0)) + 1.0) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.7e-226: tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 4.5e+15: tmp = (math.sqrt((y + 1.0)) + 1.0) - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.7e-226) tmp = Float64(2.0 + Float64(Float64(Float64(0.5 * Float64(y + z)) + 1.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 4.5e+15) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) + 1.0) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.7e-226)
tmp = 2.0 + (((0.5 * (y + z)) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 4.5e+15)
tmp = (sqrt((y + 1.0)) + 1.0) - (sqrt(y) + sqrt(x));
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.7e-226], N[(2.0 + N[(N[(N[(0.5 * N[(y + z), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - 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 1.7 \cdot 10^{-226}:\\
\;\;\;\;2 + \left(\left(0.5 \cdot \left(y + z\right) + 1\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{y + 1} + 1\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.70000000000000004e-226Initial program 98.0%
associate-+l+98.0%
associate-+l+98.0%
+-commutative98.0%
+-commutative98.0%
associate-+l-76.2%
+-commutative76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in y around 0 76.2%
Taylor expanded in t around inf 23.7%
Taylor expanded in x around 0 21.0%
associate--l+35.9%
+-commutative35.9%
fma-undefine35.9%
Simplified35.9%
Taylor expanded in z around 0 21.9%
distribute-lft-out21.9%
+-commutative21.9%
Simplified21.9%
if 1.70000000000000004e-226 < y < 4.5e15Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
associate-+l-76.8%
+-commutative76.8%
+-commutative76.8%
Simplified76.8%
Taylor expanded in z around inf 59.2%
Taylor expanded in x around 0 20.7%
Taylor expanded in t around inf 26.5%
+-commutative26.5%
Simplified26.5%
if 4.5e15 < y Initial program 92.0%
associate-+l+92.0%
associate-+l+92.0%
+-commutative92.0%
+-commutative92.0%
associate-+l-70.2%
+-commutative70.2%
+-commutative70.2%
Simplified70.2%
Taylor expanded in z around inf 46.6%
Taylor expanded in x around 0 2.9%
Taylor expanded in y around inf 15.4%
associate--l+35.0%
Simplified35.0%
Taylor expanded in t around inf 20.3%
Final simplification23.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 4.9e-237)
(+ 2.0 (- (+ (* y 0.5) 1.0) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 4.5e+15)
(- (+ (sqrt (+ y 1.0)) 1.0) (+ (sqrt y) (sqrt x)))
(- 1.0 (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.9e-237) {
tmp = 2.0 + (((y * 0.5) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 4.5e+15) {
tmp = (sqrt((y + 1.0)) + 1.0) - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.9d-237) then
tmp = 2.0d0 + (((y * 0.5d0) + 1.0d0) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 4.5d+15) then
tmp = (sqrt((y + 1.0d0)) + 1.0d0) - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.9e-237) {
tmp = 2.0 + (((y * 0.5) + 1.0) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 4.5e+15) {
tmp = (Math.sqrt((y + 1.0)) + 1.0) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 - 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.9e-237: tmp = 2.0 + (((y * 0.5) + 1.0) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 4.5e+15: tmp = (math.sqrt((y + 1.0)) + 1.0) - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 - 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.9e-237) tmp = Float64(2.0 + Float64(Float64(Float64(y * 0.5) + 1.0) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 4.5e+15) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) + 1.0) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.9e-237)
tmp = 2.0 + (((y * 0.5) + 1.0) - (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 4.5e+15)
tmp = (sqrt((y + 1.0)) + 1.0) - (sqrt(y) + sqrt(x));
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.9e-237], N[(2.0 + N[(N[(N[(y * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - 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.9 \cdot 10^{-237}:\\
\;\;\;\;2 + \left(\left(y \cdot 0.5 + 1\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{y + 1} + 1\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 4.9000000000000001e-237Initial program 98.2%
associate-+l+98.2%
associate-+l+98.2%
+-commutative98.2%
+-commutative98.2%
associate-+l-75.0%
+-commutative75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in y around 0 75.0%
Taylor expanded in t around inf 25.1%
Taylor expanded in x around 0 22.2%
associate--l+37.6%
+-commutative37.6%
fma-undefine37.6%
Simplified37.6%
Taylor expanded in z around 0 21.6%
if 4.9000000000000001e-237 < y < 4.5e15Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
associate-+l-77.2%
+-commutative77.2%
+-commutative77.2%
Simplified77.2%
Taylor expanded in z around inf 59.2%
Taylor expanded in x around 0 21.3%
Taylor expanded in t around inf 26.2%
+-commutative26.2%
Simplified26.2%
if 4.5e15 < y Initial program 92.0%
associate-+l+92.0%
associate-+l+92.0%
+-commutative92.0%
+-commutative92.0%
associate-+l-70.2%
+-commutative70.2%
+-commutative70.2%
Simplified70.2%
Taylor expanded in z around inf 46.6%
Taylor expanded in x around 0 2.9%
Taylor expanded in y around inf 15.4%
associate--l+35.0%
Simplified35.0%
Taylor expanded in t around inf 20.3%
Final simplification22.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 (<= y 4.5e+15) (- (+ (sqrt (+ y 1.0)) 1.0) (+ (sqrt y) (sqrt x))) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e+15) {
tmp = (sqrt((y + 1.0)) + 1.0) - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.5d+15) then
tmp = (sqrt((y + 1.0d0)) + 1.0d0) - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e+15) {
tmp = (Math.sqrt((y + 1.0)) + 1.0) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 - 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.5e+15: tmp = (math.sqrt((y + 1.0)) + 1.0) - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 - 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.5e+15) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) + 1.0) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.5e+15)
tmp = (sqrt((y + 1.0)) + 1.0) - (sqrt(y) + sqrt(x));
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.5e+15], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - 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.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{y + 1} + 1\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 4.5e15Initial program 97.3%
associate-+l+97.3%
associate-+l+97.3%
+-commutative97.3%
+-commutative97.3%
associate-+l-76.7%
+-commutative76.7%
+-commutative76.7%
Simplified76.7%
Taylor expanded in z around inf 58.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in t around inf 25.5%
+-commutative25.5%
Simplified25.5%
if 4.5e15 < y Initial program 92.0%
associate-+l+92.0%
associate-+l+92.0%
+-commutative92.0%
+-commutative92.0%
associate-+l-70.2%
+-commutative70.2%
+-commutative70.2%
Simplified70.2%
Taylor expanded in z around inf 46.6%
Taylor expanded in x around 0 2.9%
Taylor expanded in y around inf 15.4%
associate--l+35.0%
Simplified35.0%
Taylor expanded in t around inf 20.3%
Final simplification23.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.9) (+ 2.0 (- (- (* y 0.5) (sqrt y)) (sqrt x))) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9) {
tmp = 2.0 + (((y * 0.5) - sqrt(y)) - sqrt(x));
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.9d0) then
tmp = 2.0d0 + (((y * 0.5d0) - sqrt(y)) - sqrt(x))
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9) {
tmp = 2.0 + (((y * 0.5) - Math.sqrt(y)) - Math.sqrt(x));
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.9: tmp = 2.0 + (((y * 0.5) - math.sqrt(y)) - math.sqrt(x)) else: tmp = 1.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.9) tmp = Float64(2.0 + Float64(Float64(Float64(y * 0.5) - sqrt(y)) - sqrt(x))); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.9)
tmp = 2.0 + (((y * 0.5) - sqrt(y)) - sqrt(x));
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.9], N[(2.0 + N[(N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - 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 2.9:\\
\;\;\;\;2 + \left(\left(y \cdot 0.5 - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.89999999999999991Initial program 97.9%
associate-+l+97.9%
associate-+l+97.9%
+-commutative97.9%
+-commutative97.9%
associate-+l-77.8%
+-commutative77.8%
+-commutative77.8%
Simplified77.8%
Taylor expanded in y around 0 77.1%
Taylor expanded in t around inf 20.4%
Taylor expanded in x around 0 19.0%
associate--l+38.8%
+-commutative38.8%
fma-undefine38.8%
Simplified38.8%
Taylor expanded in z around inf 25.6%
+-commutative25.6%
associate--r+25.6%
Simplified25.6%
if 2.89999999999999991 < y Initial program 91.6%
associate-+l+91.6%
associate-+l+91.6%
+-commutative91.6%
+-commutative91.6%
associate-+l-69.3%
+-commutative69.3%
+-commutative69.3%
Simplified69.3%
Taylor expanded in z around inf 46.2%
Taylor expanded in x around 0 3.4%
Taylor expanded in y around inf 15.1%
associate--l+34.3%
Simplified34.3%
Taylor expanded in t around inf 20.0%
Final simplification22.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 3.2) (+ 2.0 (* y (- 0.5 (sqrt (/ 1.0 y))))) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.2) {
tmp = 2.0 + (y * (0.5 - sqrt((1.0 / y))));
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.2d0) then
tmp = 2.0d0 + (y * (0.5d0 - sqrt((1.0d0 / y))))
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.2) {
tmp = 2.0 + (y * (0.5 - Math.sqrt((1.0 / y))));
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.2: tmp = 2.0 + (y * (0.5 - math.sqrt((1.0 / y)))) else: tmp = 1.0 - 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 <= 3.2) tmp = Float64(2.0 + Float64(y * Float64(0.5 - sqrt(Float64(1.0 / y))))); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3.2)
tmp = 2.0 + (y * (0.5 - sqrt((1.0 / y))));
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3.2], N[(2.0 + N[(y * N[(0.5 - N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - 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 3.2:\\
\;\;\;\;2 + y \cdot \left(0.5 - \sqrt{\frac{1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.2000000000000002Initial program 97.9%
associate-+l+97.9%
associate-+l+97.9%
+-commutative97.9%
+-commutative97.9%
associate-+l-77.8%
+-commutative77.8%
+-commutative77.8%
Simplified77.8%
Taylor expanded in y around 0 77.1%
Taylor expanded in t around inf 20.4%
Taylor expanded in x around 0 19.0%
associate--l+38.8%
+-commutative38.8%
fma-undefine38.8%
Simplified38.8%
Taylor expanded in y around inf 45.7%
if 3.2000000000000002 < y Initial program 91.6%
associate-+l+91.6%
associate-+l+91.6%
+-commutative91.6%
+-commutative91.6%
associate-+l-69.3%
+-commutative69.3%
+-commutative69.3%
Simplified69.3%
Taylor expanded in z around inf 46.2%
Taylor expanded in x around 0 3.4%
Taylor expanded in y around inf 15.1%
associate--l+34.3%
Simplified34.3%
Taylor expanded in t around inf 20.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 94.8%
associate-+l+94.8%
associate-+l+94.8%
+-commutative94.8%
+-commutative94.8%
associate-+l-73.6%
+-commutative73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in z around inf 52.6%
Taylor expanded in x around 0 13.1%
Taylor expanded in y around inf 11.6%
associate--l+25.4%
Simplified25.4%
Taylor expanded in t around inf 15.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 94.8%
associate-+l+94.8%
associate-+l+94.8%
+-commutative94.8%
+-commutative94.8%
associate-+l-73.6%
+-commutative73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in z around inf 52.6%
Taylor expanded in x around 0 13.1%
Taylor expanded in x around inf 1.6%
mul-1-neg1.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024107
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))