
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0))) (t_2 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (- t_1 (sqrt y)) 0.0)
(+
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))
t_2)
(+
t_2
(+
(+ (- 1.0 (sqrt x)) (/ (- (+ y 1.0) y) (+ (sqrt y) t_1)))
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if ((t_1 - sqrt(y)) <= 0.0) {
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)))) + t_2;
} else {
tmp = t_2 + (((1.0 - sqrt(x)) + (((y + 1.0) - y) / (sqrt(y) + t_1))) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
if ((t_1 - sqrt(y)) <= 0.0d0) then
tmp = (((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))) + t_2
else
tmp = t_2 + (((1.0d0 - sqrt(x)) + (((y + 1.0d0) - y) / (sqrt(y) + t_1))) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if ((t_1 - Math.sqrt(y)) <= 0.0) {
tmp = (((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)))) + t_2;
} else {
tmp = t_2 + (((1.0 - Math.sqrt(x)) + (((y + 1.0) - y) / (Math.sqrt(y) + t_1))) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if (t_1 - math.sqrt(y)) <= 0.0: tmp = (((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z)))) + t_2 else: tmp = t_2 + (((1.0 - math.sqrt(x)) + (((y + 1.0) - y) / (math.sqrt(y) + t_1))) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (Float64(t_1 - sqrt(y)) <= 0.0) tmp = Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))) + t_2); else tmp = Float64(t_2 + Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(Float64(y + 1.0) - y) / Float64(sqrt(y) + t_1))) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if ((t_1 - sqrt(y)) <= 0.0)
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)))) + t_2;
else
tmp = t_2 + (((1.0 - sqrt(x)) + (((y + 1.0) - y) / (sqrt(y) + t_1))) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(t$95$2 + N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + 1.0), $MachinePrecision] - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 - \sqrt{y} \leq 0:\\
\;\;\;\;\left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(\left(1 - \sqrt{x}\right) + \frac{\left(y + 1\right) - y}{\sqrt{y} + t\_1}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.0Initial program 83.6%
Taylor expanded in z around inf 46.4%
Taylor expanded in y around inf 51.6%
flip--51.8%
add-sqr-sqrt43.5%
+-commutative43.5%
add-sqr-sqrt51.8%
+-commutative51.8%
Applied egg-rr51.8%
associate--l+53.4%
+-inverses53.4%
metadata-eval53.4%
+-commutative53.4%
Simplified53.4%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 96.5%
flip--96.7%
add-sqr-sqrt79.5%
+-commutative79.5%
add-sqr-sqrt96.7%
+-commutative96.7%
Applied egg-rr96.7%
associate-+r-97.2%
+-inverses97.2%
metadata-eval97.2%
+-commutative97.2%
Simplified97.2%
flip--97.4%
add-sqr-sqrt97.7%
+-commutative97.7%
add-sqr-sqrt98.2%
+-commutative98.2%
+-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in x around 0 57.4%
Final simplification55.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_2 (sqrt (+ y 1.0)))
(t_3 (+ (- t_2 (sqrt y)) (- (sqrt (+ 1.0 x)) (sqrt x)))))
(if (<= t_3 5e-7)
(+
t_1
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (* 0.5 (sqrt (/ 1.0 x))))))
(if (<= t_3 1.9999999995)
(+ (- 1.0 (sqrt x)) (fma 0.5 x (/ 1.0 (+ (sqrt y) t_2))))
(+
2.0
(- (+ t_1 (sqrt (+ 1.0 z))) (+ (sqrt z) (+ (sqrt y) (sqrt x)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((y + 1.0));
double t_3 = (t_2 - sqrt(y)) + (sqrt((1.0 + x)) - sqrt(x));
double tmp;
if (t_3 <= 5e-7) {
tmp = t_1 + ((0.5 * sqrt((1.0 / z))) + ((0.5 * sqrt((1.0 / y))) + (0.5 * sqrt((1.0 / x)))));
} else if (t_3 <= 1.9999999995) {
tmp = (1.0 - sqrt(x)) + fma(0.5, x, (1.0 / (sqrt(y) + t_2)));
} else {
tmp = 2.0 + ((t_1 + sqrt((1.0 + z))) - (sqrt(z) + (sqrt(y) + sqrt(x))));
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(y + 1.0)) t_3 = Float64(Float64(t_2 - sqrt(y)) + Float64(sqrt(Float64(1.0 + x)) - sqrt(x))) tmp = 0.0 if (t_3 <= 5e-7) tmp = Float64(t_1 + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(0.5 * sqrt(Float64(1.0 / x)))))); elseif (t_3 <= 1.9999999995) tmp = Float64(Float64(1.0 - sqrt(x)) + fma(0.5, x, Float64(1.0 / Float64(sqrt(y) + t_2)))); else tmp = Float64(2.0 + Float64(Float64(t_1 + sqrt(Float64(1.0 + z))) - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x))))); 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_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 5e-7], N[(t$95$1 + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1.9999999995], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(0.5 * x + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(N[(t$95$1 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{y + 1}\\
t_3 := \left(t\_2 - \sqrt{y}\right) + \left(\sqrt{1 + x} - \sqrt{x}\right)\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t\_1 + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\right)\\
\mathbf{elif}\;t\_3 \leq 1.9999999995:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \mathsf{fma}\left(0.5, x, \frac{1}{\sqrt{y} + t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;2 + \left(\left(t\_1 + \sqrt{1 + z}\right) - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 4.99999999999999977e-7Initial program 67.9%
Taylor expanded in z around inf 37.4%
Taylor expanded in y around inf 47.5%
Taylor expanded in x around inf 51.3%
if 4.99999999999999977e-7 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.9999999995Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-67.4%
associate-+l-62.2%
+-commutative62.2%
+-commutative62.2%
associate--l+62.2%
Simplified48.1%
Taylor expanded in x around inf 24.4%
flip--24.4%
add-sqr-sqrt14.6%
add-sqr-sqrt24.6%
Applied egg-rr24.6%
associate--l+25.1%
+-inverses25.1%
metadata-eval25.1%
+-commutative25.1%
Simplified25.1%
Taylor expanded in x around 0 25.2%
+-commutative25.2%
associate--l+25.2%
fma-define25.2%
Simplified25.2%
if 1.9999999995 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+r-98.2%
associate-+l-98.2%
+-commutative98.2%
+-commutative98.2%
associate--l+98.2%
Simplified78.7%
Taylor expanded in y around 0 78.7%
Taylor expanded in x around 0 26.8%
associate--l+56.6%
associate--r+45.8%
+-commutative45.8%
metadata-eval45.8%
rem-square-sqrt45.8%
hypot-undefine45.8%
associate-+r-78.4%
hypot-undefine78.4%
metadata-eval78.4%
rem-square-sqrt78.4%
associate-+r+78.4%
Simplified78.4%
Final simplification44.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ y 1.0)))
(t_2 (- t_1 (sqrt y)))
(t_3 (* 0.5 (sqrt (/ 1.0 z))))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_2 0.0)
(+
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
t_3)
t_4)
(if (<= t_2 0.9999999995)
(+
t_4
(+ t_3 (+ (- 1.0 (sqrt x)) (/ (- (+ y 1.0) y) (+ (sqrt y) t_1)))))
(+
2.0
(- (+ t_4 (sqrt (+ 1.0 z))) (+ (sqrt z) (+ (sqrt y) (sqrt x)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = t_1 - sqrt(y);
double t_3 = 0.5 * sqrt((1.0 / z));
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_2 <= 0.0) {
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_3) + t_4;
} else if (t_2 <= 0.9999999995) {
tmp = t_4 + (t_3 + ((1.0 - sqrt(x)) + (((y + 1.0) - y) / (sqrt(y) + t_1))));
} else {
tmp = 2.0 + ((t_4 + sqrt((1.0 + z))) - (sqrt(z) + (sqrt(y) + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = t_1 - sqrt(y)
t_3 = 0.5d0 * sqrt((1.0d0 / z))
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_2 <= 0.0d0) then
tmp = (((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + t_3) + t_4
else if (t_2 <= 0.9999999995d0) then
tmp = t_4 + (t_3 + ((1.0d0 - sqrt(x)) + (((y + 1.0d0) - y) / (sqrt(y) + t_1))))
else
tmp = 2.0d0 + ((t_4 + sqrt((1.0d0 + z))) - (sqrt(z) + (sqrt(y) + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = t_1 - Math.sqrt(y);
double t_3 = 0.5 * Math.sqrt((1.0 / z));
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_2 <= 0.0) {
tmp = (((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + t_3) + t_4;
} else if (t_2 <= 0.9999999995) {
tmp = t_4 + (t_3 + ((1.0 - Math.sqrt(x)) + (((y + 1.0) - y) / (Math.sqrt(y) + t_1))));
} else {
tmp = 2.0 + ((t_4 + Math.sqrt((1.0 + z))) - (Math.sqrt(z) + (Math.sqrt(y) + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = t_1 - math.sqrt(y) t_3 = 0.5 * math.sqrt((1.0 / z)) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_2 <= 0.0: tmp = (((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + t_3) + t_4 elif t_2 <= 0.9999999995: tmp = t_4 + (t_3 + ((1.0 - math.sqrt(x)) + (((y + 1.0) - y) / (math.sqrt(y) + t_1)))) else: tmp = 2.0 + ((t_4 + math.sqrt((1.0 + z))) - (math.sqrt(z) + (math.sqrt(y) + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(t_1 - sqrt(y)) t_3 = Float64(0.5 * sqrt(Float64(1.0 / z))) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_2 <= 0.0) tmp = Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_3) + t_4); elseif (t_2 <= 0.9999999995) tmp = Float64(t_4 + Float64(t_3 + Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(Float64(y + 1.0) - y) / Float64(sqrt(y) + t_1))))); else tmp = Float64(2.0 + Float64(Float64(t_4 + sqrt(Float64(1.0 + z))) - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
t_2 = t_1 - sqrt(y);
t_3 = 0.5 * sqrt((1.0 / z));
t_4 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_2 <= 0.0)
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_3) + t_4;
elseif (t_2 <= 0.9999999995)
tmp = t_4 + (t_3 + ((1.0 - sqrt(x)) + (((y + 1.0) - y) / (sqrt(y) + t_1))));
else
tmp = 2.0 + ((t_4 + sqrt((1.0 + z))) - (sqrt(z) + (sqrt(y) + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision], If[LessEqual[t$95$2, 0.9999999995], N[(t$95$4 + N[(t$95$3 + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + 1.0), $MachinePrecision] - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(N[(t$95$4 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $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}\\
t_2 := t\_1 - \sqrt{y}\\
t_3 := 0.5 \cdot \sqrt{\frac{1}{z}}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;\left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_3\right) + t\_4\\
\mathbf{elif}\;t\_2 \leq 0.9999999995:\\
\;\;\;\;t\_4 + \left(t\_3 + \left(\left(1 - \sqrt{x}\right) + \frac{\left(y + 1\right) - y}{\sqrt{y} + t\_1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 + \left(\left(t\_4 + \sqrt{1 + z}\right) - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.0Initial program 83.6%
Taylor expanded in z around inf 46.4%
Taylor expanded in y around inf 51.6%
flip--51.8%
add-sqr-sqrt43.5%
+-commutative43.5%
add-sqr-sqrt51.8%
+-commutative51.8%
Applied egg-rr51.8%
associate--l+53.4%
+-inverses53.4%
metadata-eval53.4%
+-commutative53.4%
Simplified53.4%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 0.99999999949999996Initial program 88.6%
Taylor expanded in z around inf 48.0%
Taylor expanded in x around 0 40.3%
flip--90.4%
add-sqr-sqrt92.8%
+-commutative92.8%
add-sqr-sqrt97.5%
+-commutative97.5%
+-commutative97.5%
Applied egg-rr42.7%
if 0.99999999949999996 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-64.8%
associate-+l-59.4%
+-commutative59.4%
+-commutative59.4%
associate--l+59.5%
Simplified47.9%
Taylor expanded in y around 0 47.9%
Taylor expanded in x around 0 15.5%
associate--l+38.1%
associate--r+29.8%
+-commutative29.8%
metadata-eval29.8%
rem-square-sqrt29.8%
hypot-undefine29.8%
associate-+r-48.3%
hypot-undefine48.3%
metadata-eval48.3%
rem-square-sqrt48.3%
associate-+r+48.3%
Simplified48.3%
Final simplification50.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 (+ y 1.0)) (sqrt y)))
(t_2 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_1 5e-5)
(+
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))
t_2)
(+
t_2
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (+ t_1 (- 1.0 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_1 <= 5e-5) {
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)))) + t_2;
} else {
tmp = t_2 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (t_1 + (1.0 - sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_1 <= 5d-5) then
tmp = (((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))) + t_2
else
tmp = t_2 + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (t_1 + (1.0d0 - sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_1 <= 5e-5) {
tmp = (((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)))) + t_2;
} else {
tmp = t_2 + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (t_1 + (1.0 - Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) - math.sqrt(y) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_1 <= 5e-5: tmp = (((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z)))) + t_2 else: tmp = t_2 + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (t_1 + (1.0 - math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_1 <= 5e-5) tmp = Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))) + t_2); else tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(t_1 + Float64(1.0 - sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0)) - sqrt(y);
t_2 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_1 <= 5e-5)
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)))) + t_2;
else
tmp = t_2 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (t_1 + (1.0 - sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-5], N[(N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $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{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(t\_1 + \left(1 - \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 5.00000000000000024e-5Initial program 83.2%
Taylor expanded in z around inf 45.5%
Taylor expanded in y around inf 50.7%
flip--50.9%
add-sqr-sqrt42.8%
+-commutative42.8%
add-sqr-sqrt50.9%
+-commutative50.9%
Applied egg-rr50.9%
associate--l+52.4%
+-inverses52.4%
metadata-eval52.4%
+-commutative52.4%
Simplified52.4%
if 5.00000000000000024e-5 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 97.5%
flip--97.6%
add-sqr-sqrt79.8%
+-commutative79.8%
add-sqr-sqrt97.7%
+-commutative97.7%
Applied egg-rr97.7%
associate-+r-98.2%
+-inverses98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 57.9%
Final simplification55.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 t))))
(if (<= y 1.1)
(+
t_1
(+
(- 1.0 (sqrt y))
(-
(- (+ (sqrt (+ 1.0 z)) (/ 1.0 (+ (sqrt t) t_2))) (sqrt x))
(sqrt z))))
(+
(+
(+ (/ 1.0 (+ (sqrt x) t_1)) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 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((1.0 + x));
double t_2 = sqrt((1.0 + t));
double tmp;
if (y <= 1.1) {
tmp = t_1 + ((1.0 - sqrt(y)) + (((sqrt((1.0 + z)) + (1.0 / (sqrt(t) + t_2))) - sqrt(x)) - sqrt(z)));
} else {
tmp = (((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / 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) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + t))
if (y <= 1.1d0) then
tmp = t_1 + ((1.0d0 - sqrt(y)) + (((sqrt((1.0d0 + z)) + (1.0d0 / (sqrt(t) + t_2))) - sqrt(x)) - sqrt(z)))
else
tmp = (((1.0d0 / (sqrt(x) + t_1)) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / 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((1.0 + x));
double t_2 = Math.sqrt((1.0 + t));
double tmp;
if (y <= 1.1) {
tmp = t_1 + ((1.0 - Math.sqrt(y)) + (((Math.sqrt((1.0 + z)) + (1.0 / (Math.sqrt(t) + t_2))) - Math.sqrt(x)) - Math.sqrt(z)));
} else {
tmp = (((1.0 / (Math.sqrt(x) + t_1)) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / 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((1.0 + x)) t_2 = math.sqrt((1.0 + t)) tmp = 0 if y <= 1.1: tmp = t_1 + ((1.0 - math.sqrt(y)) + (((math.sqrt((1.0 + z)) + (1.0 / (math.sqrt(t) + t_2))) - math.sqrt(x)) - math.sqrt(z))) else: tmp = (((1.0 / (math.sqrt(x) + t_1)) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / 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 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (y <= 1.1) tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(y)) + Float64(Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(1.0 / Float64(sqrt(t) + t_2))) - sqrt(x)) - sqrt(z)))); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / 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((1.0 + x));
t_2 = sqrt((1.0 + t));
tmp = 0.0;
if (y <= 1.1)
tmp = t_1 + ((1.0 - sqrt(y)) + (((sqrt((1.0 + z)) + (1.0 / (sqrt(t) + t_2))) - sqrt(x)) - sqrt(z)));
else
tmp = (((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / 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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.1], N[(t$95$1 + N[(N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + t}\\
\mathbf{if}\;y \leq 1.1:\\
\;\;\;\;t\_1 + \left(\left(1 - \sqrt{y}\right) + \left(\left(\left(\sqrt{1 + z} + \frac{1}{\sqrt{t} + t\_2}\right) - \sqrt{x}\right) - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{\sqrt{x} + t\_1} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right) + \left(t\_2 - \sqrt{t}\right)\\
\end{array}
\end{array}
if y < 1.1000000000000001Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-65.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.4%
Simplified47.9%
Taylor expanded in y around 0 47.9%
flip--47.9%
add-sqr-sqrt36.8%
add-sqr-sqrt47.9%
Applied egg-rr47.9%
associate--l+48.2%
+-inverses48.2%
metadata-eval48.2%
+-commutative48.2%
Simplified48.2%
if 1.1000000000000001 < y Initial program 83.6%
Taylor expanded in z around inf 44.6%
Taylor expanded in y around inf 49.6%
flip--49.7%
add-sqr-sqrt42.0%
+-commutative42.0%
add-sqr-sqrt49.7%
+-commutative49.7%
Applied egg-rr49.7%
associate--l+51.2%
+-inverses51.2%
metadata-eval51.2%
+-commutative51.2%
Simplified51.2%
Final simplification49.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 0.86)
(+
t_2
(+ (- 1.0 (sqrt y)) (- (- (+ t_1 (sqrt (+ 1.0 z))) (sqrt x)) (sqrt z))))
(+
(+
(+ (/ 1.0 (+ (sqrt x) t_2)) (* 0.5 (sqrt (/ 1.0 y))))
(* 0.5 (sqrt (/ 1.0 z))))
t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 0.86) {
tmp = t_2 + ((1.0 - sqrt(y)) + (((t_1 + sqrt((1.0 + z))) - sqrt(x)) - sqrt(z)));
} else {
tmp = (((1.0 / (sqrt(x) + t_2)) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + x))
if (y <= 0.86d0) then
tmp = t_2 + ((1.0d0 - sqrt(y)) + (((t_1 + sqrt((1.0d0 + z))) - sqrt(x)) - sqrt(z)))
else
tmp = (((1.0d0 / (sqrt(x) + t_2)) + (0.5d0 * sqrt((1.0d0 / y)))) + (0.5d0 * sqrt((1.0d0 / z)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 0.86) {
tmp = t_2 + ((1.0 - Math.sqrt(y)) + (((t_1 + Math.sqrt((1.0 + z))) - Math.sqrt(x)) - Math.sqrt(z)));
} else {
tmp = (((1.0 / (Math.sqrt(x) + t_2)) + (0.5 * Math.sqrt((1.0 / y)))) + (0.5 * Math.sqrt((1.0 / z)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 0.86: tmp = t_2 + ((1.0 - math.sqrt(y)) + (((t_1 + math.sqrt((1.0 + z))) - math.sqrt(x)) - math.sqrt(z))) else: tmp = (((1.0 / (math.sqrt(x) + t_2)) + (0.5 * math.sqrt((1.0 / y)))) + (0.5 * math.sqrt((1.0 / z)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 0.86) tmp = Float64(t_2 + Float64(Float64(1.0 - sqrt(y)) + Float64(Float64(Float64(t_1 + sqrt(Float64(1.0 + z))) - sqrt(x)) - sqrt(z)))); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 0.86)
tmp = t_2 + ((1.0 - sqrt(y)) + (((t_1 + sqrt((1.0 + z))) - sqrt(x)) - sqrt(z)));
else
tmp = (((1.0 / (sqrt(x) + t_2)) + (0.5 * sqrt((1.0 / y)))) + (0.5 * sqrt((1.0 / z)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 0.86], N[(t$95$2 + N[(N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$1 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 0.86:\\
\;\;\;\;t\_2 + \left(\left(1 - \sqrt{y}\right) + \left(\left(\left(t\_1 + \sqrt{1 + z}\right) - \sqrt{x}\right) - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{\sqrt{x} + t\_2} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right) + t\_1\\
\end{array}
\end{array}
if y < 0.859999999999999987Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-65.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.4%
Simplified47.9%
Taylor expanded in y around 0 47.9%
if 0.859999999999999987 < y Initial program 83.6%
Taylor expanded in z around inf 44.6%
Taylor expanded in y around inf 49.6%
flip--49.7%
add-sqr-sqrt42.0%
+-commutative42.0%
add-sqr-sqrt49.7%
+-commutative49.7%
Applied egg-rr49.7%
associate--l+51.2%
+-inverses51.2%
metadata-eval51.2%
+-commutative51.2%
Simplified51.2%
Final simplification49.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 (* 0.5 (sqrt (/ 1.0 z)))) (t_2 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 4.8e-19)
(+ 2.0 (- (+ t_2 (sqrt (+ 1.0 z))) (+ (sqrt z) (+ (sqrt y) (sqrt x)))))
(if (<= y 14000000.0)
(+
(+ t_1 (+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x))))
(* 0.5 (sqrt (/ 1.0 t))))
(+
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
t_1)
t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / z));
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 4.8e-19) {
tmp = 2.0 + ((t_2 + sqrt((1.0 + z))) - (sqrt(z) + (sqrt(y) + sqrt(x))));
} else if (y <= 14000000.0) {
tmp = (t_1 + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
} else {
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_1) + 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 = 0.5d0 * sqrt((1.0d0 / z))
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 4.8d-19) then
tmp = 2.0d0 + ((t_2 + sqrt((1.0d0 + z))) - (sqrt(z) + (sqrt(y) + sqrt(x))))
else if (y <= 14000000.0d0) then
tmp = (t_1 + ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x)))) + (0.5d0 * sqrt((1.0d0 / t)))
else
tmp = (((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + t_1) + 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 = 0.5 * Math.sqrt((1.0 / z));
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 4.8e-19) {
tmp = 2.0 + ((t_2 + Math.sqrt((1.0 + z))) - (Math.sqrt(z) + (Math.sqrt(y) + Math.sqrt(x))));
} else if (y <= 14000000.0) {
tmp = (t_1 + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)))) + (0.5 * Math.sqrt((1.0 / t)));
} else {
tmp = (((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + t_1) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / z)) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 4.8e-19: tmp = 2.0 + ((t_2 + math.sqrt((1.0 + z))) - (math.sqrt(z) + (math.sqrt(y) + math.sqrt(x)))) elif y <= 14000000.0: tmp = (t_1 + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x)))) + (0.5 * math.sqrt((1.0 / t))) else: tmp = (((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + t_1) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / z))) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 4.8e-19) tmp = Float64(2.0 + Float64(Float64(t_2 + sqrt(Float64(1.0 + z))) - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x))))); elseif (y <= 14000000.0) tmp = Float64(Float64(t_1 + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x)))) + Float64(0.5 * sqrt(Float64(1.0 / t)))); else tmp = Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_1) + 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 = 0.5 * sqrt((1.0 / z));
t_2 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 4.8e-19)
tmp = 2.0 + ((t_2 + sqrt((1.0 + z))) - (sqrt(z) + (sqrt(y) + sqrt(x))));
elseif (y <= 14000000.0)
tmp = (t_1 + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)))) + (0.5 * sqrt((1.0 / t)));
else
tmp = (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_1) + 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[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.8e-19], N[(2.0 + N[(N[(t$95$2 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 14000000.0], N[(N[(t$95$1 + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{z}}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-19}:\\
\;\;\;\;2 + \left(\left(t\_2 + \sqrt{1 + z}\right) - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;y \leq 14000000:\\
\;\;\;\;\left(t\_1 + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_1\right) + t\_2\\
\end{array}
\end{array}
if y < 4.80000000000000046e-19Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-64.8%
associate-+l-59.4%
+-commutative59.4%
+-commutative59.4%
associate--l+59.5%
Simplified47.9%
Taylor expanded in y around 0 47.9%
Taylor expanded in x around 0 15.5%
associate--l+38.1%
associate--r+29.8%
+-commutative29.8%
metadata-eval29.8%
rem-square-sqrt29.8%
hypot-undefine29.8%
associate-+r-48.3%
hypot-undefine48.3%
metadata-eval48.3%
rem-square-sqrt48.3%
associate-+r+48.3%
Simplified48.3%
if 4.80000000000000046e-19 < y < 1.4e7Initial program 96.3%
Taylor expanded in z around inf 60.8%
Taylor expanded in x around 0 51.0%
Taylor expanded in t around inf 25.2%
if 1.4e7 < y Initial program 83.2%
Taylor expanded in z around inf 45.5%
Taylor expanded in y around inf 50.7%
flip--50.9%
add-sqr-sqrt42.8%
+-commutative42.8%
add-sqr-sqrt50.9%
+-commutative50.9%
Applied egg-rr50.9%
associate--l+52.4%
+-inverses52.4%
metadata-eval52.4%
+-commutative52.4%
Simplified52.4%
Final simplification49.5%
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.25e-19)
(+
(sqrt (+ 1.0 x))
(+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt z) (+ (sqrt y) (sqrt x))))))
(if (<= y 8.5e+27)
(- (+ 1.0 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))) (sqrt x))
(/ 1.0 (+ (sqrt x) (hypot 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.25e-19) {
tmp = sqrt((1.0 + x)) + (1.0 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(y) + sqrt(x)))));
} else if (y <= 8.5e+27) {
tmp = (1.0 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + hypot(1.0, sqrt(x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.25e-19) {
tmp = Math.sqrt((1.0 + x)) + (1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + (Math.sqrt(y) + Math.sqrt(x)))));
} else if (y <= 8.5e+27) {
tmp = (1.0 + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.hypot(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.25e-19: tmp = math.sqrt((1.0 + x)) + (1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + (math.sqrt(y) + math.sqrt(x))))) elif y <= 8.5e+27: tmp = (1.0 + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + math.hypot(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.25e-19) tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + Float64(sqrt(y) + sqrt(x)))))); elseif (y <= 8.5e+27) tmp = Float64(Float64(1.0 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + hypot(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.25e-19)
tmp = sqrt((1.0 + x)) + (1.0 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(y) + sqrt(x)))));
elseif (y <= 8.5e+27)
tmp = (1.0 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + hypot(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.25e-19], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+27], N[(N[(1.0 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.25 \cdot 10^{-19}:\\
\;\;\;\;\sqrt{1 + x} + \left(1 + \left(\sqrt{1 + z} - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{x}\right)\right)\right)\right)\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+27}:\\
\;\;\;\;\left(1 + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}\\
\end{array}
\end{array}
if y < 4.25000000000000002e-19Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-64.8%
associate-+l-59.4%
+-commutative59.4%
+-commutative59.4%
associate--l+59.5%
Simplified47.9%
Taylor expanded in y around 0 47.9%
Taylor expanded in t around inf 28.3%
associate--l+37.5%
associate-+r+37.5%
+-commutative37.5%
Simplified37.5%
if 4.25000000000000002e-19 < y < 8.5e27Initial program 75.9%
associate-+l+75.9%
+-commutative75.9%
associate-+r-68.9%
associate-+l-60.2%
+-commutative60.2%
+-commutative60.2%
associate--l+60.2%
Simplified48.4%
Taylor expanded in x around inf 26.2%
flip--26.1%
add-sqr-sqrt26.2%
add-sqr-sqrt27.1%
Applied egg-rr27.1%
associate--l+29.8%
+-inverses29.8%
metadata-eval29.8%
+-commutative29.8%
Simplified29.8%
Taylor expanded in x around 0 28.8%
if 8.5e27 < y Initial program 85.9%
associate-+l+85.9%
+-commutative85.9%
associate-+r-85.9%
associate-+l-56.8%
+-commutative56.8%
+-commutative56.8%
associate--l+56.8%
Simplified43.3%
Taylor expanded in x around inf 21.9%
Taylor expanded in y around inf 21.9%
flip--21.8%
add-sqr-sqrt22.2%
add-sqr-sqrt21.9%
div-sub21.9%
Applied egg-rr21.9%
div-sub21.9%
associate--l+24.1%
+-inverses24.1%
metadata-eval24.1%
+-commutative24.1%
rem-square-sqrt24.1%
hypot-1-def24.1%
Simplified24.1%
Final simplification30.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 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
(if (<= x 1.0)
(+ (- 1.0 (sqrt x)) (fma 0.5 x t_1))
(+ (* 0.5 (sqrt (/ 1.0 x))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
double tmp;
if (x <= 1.0) {
tmp = (1.0 - sqrt(x)) + fma(0.5, x, t_1);
} else {
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
}
return tmp;
}
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(1.0 - sqrt(x)) + fma(0.5, x, t_1)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1); 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_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(0.5 * x + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{y + 1}}\\
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \mathsf{fma}\left(0.5, x, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\\
\end{array}
\end{array}
if x < 1Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-97.1%
associate-+l-97.1%
+-commutative97.1%
+-commutative97.1%
associate--l+97.1%
Simplified75.3%
Taylor expanded in x around inf 37.7%
flip--37.7%
add-sqr-sqrt28.4%
add-sqr-sqrt37.9%
Applied egg-rr37.9%
associate--l+38.4%
+-inverses38.4%
metadata-eval38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in x around 0 38.4%
+-commutative38.4%
associate--l+38.4%
fma-define38.4%
Simplified38.4%
if 1 < x Initial program 81.3%
associate-+l+81.3%
+-commutative81.3%
associate-+r-47.2%
associate-+l-9.9%
+-commutative9.9%
+-commutative9.9%
associate--l+9.9%
Simplified9.0%
Taylor expanded in x around inf 4.3%
flip--4.3%
add-sqr-sqrt4.1%
add-sqr-sqrt4.3%
Applied egg-rr4.3%
associate--l+4.3%
+-inverses4.3%
metadata-eval4.3%
+-commutative4.3%
Simplified4.3%
Taylor expanded in x around inf 24.6%
Final simplification32.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
(if (<= x 49000000.0)
(+ (sqrt (+ 1.0 x)) (- t_1 (sqrt x)))
(+ (* 0.5 (sqrt (/ 1.0 x))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
double tmp;
if (x <= 49000000.0) {
tmp = sqrt((1.0 + x)) + (t_1 - sqrt(x));
} else {
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))
if (x <= 49000000.0d0) then
tmp = sqrt((1.0d0 + x)) + (t_1 - sqrt(x))
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)));
double tmp;
if (x <= 49000000.0) {
tmp = Math.sqrt((1.0 + x)) + (t_1 - Math.sqrt(x));
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))) tmp = 0 if x <= 49000000.0: tmp = math.sqrt((1.0 + x)) + (t_1 - math.sqrt(x)) else: tmp = (0.5 * math.sqrt((1.0 / x))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) tmp = 0.0 if (x <= 49000000.0) tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(t_1 - sqrt(x))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
tmp = 0.0;
if (x <= 49000000.0)
tmp = sqrt((1.0 + x)) + (t_1 - sqrt(x));
else
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 49000000.0], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{y + 1}}\\
\mathbf{if}\;x \leq 49000000:\\
\;\;\;\;\sqrt{1 + x} + \left(t\_1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\\
\end{array}
\end{array}
if x < 4.9e7Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-97.0%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
associate--l+97.0%
Simplified75.7%
Taylor expanded in x around inf 37.3%
flip--37.3%
add-sqr-sqrt28.1%
add-sqr-sqrt37.4%
Applied egg-rr37.4%
associate--l+37.9%
+-inverses37.9%
metadata-eval37.9%
+-commutative37.9%
Simplified37.9%
if 4.9e7 < x Initial program 81.0%
associate-+l+81.0%
+-commutative81.0%
associate-+r-45.9%
associate-+l-7.7%
+-commutative7.7%
+-commutative7.7%
associate--l+7.7%
Simplified6.7%
Taylor expanded in x around inf 3.9%
flip--3.9%
add-sqr-sqrt3.8%
add-sqr-sqrt3.9%
Applied egg-rr3.9%
associate--l+3.9%
+-inverses3.9%
metadata-eval3.9%
+-commutative3.9%
Simplified3.9%
Taylor expanded in x around inf 24.8%
Final simplification32.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0)))))) (if (<= x 0.4) (- (+ 1.0 t_1) (sqrt x)) (+ (* 0.5 (sqrt (/ 1.0 x))) t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
double tmp;
if (x <= 0.4) {
tmp = (1.0 + t_1) - sqrt(x);
} else {
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))
if (x <= 0.4d0) then
tmp = (1.0d0 + t_1) - sqrt(x)
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)));
double tmp;
if (x <= 0.4) {
tmp = (1.0 + t_1) - Math.sqrt(x);
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))) tmp = 0 if x <= 0.4: tmp = (1.0 + t_1) - math.sqrt(x) else: tmp = (0.5 * math.sqrt((1.0 / x))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))) tmp = 0.0 if (x <= 0.4) tmp = Float64(Float64(1.0 + t_1) - sqrt(x)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (sqrt(y) + sqrt((y + 1.0)));
tmp = 0.0;
if (x <= 0.4)
tmp = (1.0 + t_1) - sqrt(x);
else
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.4], N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{y + 1}}\\
\mathbf{if}\;x \leq 0.4:\\
\;\;\;\;\left(1 + t\_1\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\\
\end{array}
\end{array}
if x < 0.40000000000000002Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-97.1%
associate-+l-97.1%
+-commutative97.1%
+-commutative97.1%
associate--l+97.1%
Simplified75.3%
Taylor expanded in x around inf 37.7%
flip--37.7%
add-sqr-sqrt28.4%
add-sqr-sqrt37.9%
Applied egg-rr37.9%
associate--l+38.4%
+-inverses38.4%
metadata-eval38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in x around 0 37.7%
if 0.40000000000000002 < x Initial program 81.3%
associate-+l+81.3%
+-commutative81.3%
associate-+r-47.2%
associate-+l-9.9%
+-commutative9.9%
+-commutative9.9%
associate--l+9.9%
Simplified9.0%
Taylor expanded in x around inf 4.3%
flip--4.3%
add-sqr-sqrt4.1%
add-sqr-sqrt4.3%
Applied egg-rr4.3%
associate--l+4.3%
+-inverses4.3%
metadata-eval4.3%
+-commutative4.3%
Simplified4.3%
Taylor expanded in x around inf 24.6%
Final simplification31.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 (<= x 1.55e-15) (- (+ 1.0 (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))) (sqrt x)) (/ 1.0 (+ (sqrt x) (hypot 1.0 (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.55e-15) {
tmp = (1.0 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + hypot(1.0, sqrt(x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.55e-15) {
tmp = (1.0 + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0))))) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.hypot(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 x <= 1.55e-15: tmp = (1.0 + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + math.hypot(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 (x <= 1.55e-15) tmp = Float64(Float64(1.0 + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0))))) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + hypot(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 (x <= 1.55e-15)
tmp = (1.0 + (1.0 / (sqrt(y) + sqrt((y + 1.0))))) - sqrt(x);
else
tmp = 1.0 / (sqrt(x) + hypot(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[x, 1.55e-15], N[(N[(1.0 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.55 \cdot 10^{-15}:\\
\;\;\;\;\left(1 + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}\\
\end{array}
\end{array}
if x < 1.5499999999999999e-15Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-97.0%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
associate--l+97.0%
Simplified76.1%
Taylor expanded in x around inf 36.8%
flip--36.7%
add-sqr-sqrt27.9%
add-sqr-sqrt36.9%
Applied egg-rr36.9%
associate--l+37.4%
+-inverses37.4%
metadata-eval37.4%
+-commutative37.4%
Simplified37.4%
Taylor expanded in x around 0 37.4%
if 1.5499999999999999e-15 < x Initial program 82.2%
associate-+l+82.2%
+-commutative82.2%
associate-+r-49.8%
associate-+l-14.4%
+-commutative14.4%
+-commutative14.4%
associate--l+14.4%
Simplified11.4%
Taylor expanded in x around inf 7.0%
Taylor expanded in y around inf 6.5%
flip--6.5%
add-sqr-sqrt7.1%
add-sqr-sqrt6.5%
div-sub6.5%
Applied egg-rr6.5%
div-sub6.5%
associate--l+10.1%
+-inverses10.1%
metadata-eval10.1%
+-commutative10.1%
rem-square-sqrt10.1%
hypot-1-def10.1%
Simplified10.1%
Final simplification24.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 (<= x 3.1e-25) (+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x)))) (/ 1.0 (+ (sqrt x) (hypot 1.0 (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 3.1e-25) {
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + hypot(1.0, sqrt(x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 3.1e-25) {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.hypot(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 x <= 3.1e-25: tmp = 1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + math.hypot(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 (x <= 3.1e-25) tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + hypot(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 (x <= 3.1e-25)
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + hypot(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[x, 3.1e-25], N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.1 \cdot 10^{-25}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}\\
\end{array}
\end{array}
if x < 3.09999999999999995e-25Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+r-96.9%
associate-+l-96.9%
+-commutative96.9%
+-commutative96.9%
associate--l+96.9%
Simplified76.3%
Taylor expanded in x around inf 37.6%
Taylor expanded in x around 0 23.7%
+-commutative23.7%
associate--r+23.2%
associate-+r-37.6%
associate-+r-37.6%
associate--r+37.6%
metadata-eval37.6%
rem-square-sqrt37.6%
hypot-undefine37.6%
Simplified37.6%
+-commutative37.6%
hypot-undefine37.6%
metadata-eval37.6%
add-sqr-sqrt37.6%
+-commutative37.6%
Applied egg-rr37.6%
if 3.09999999999999995e-25 < x Initial program 83.0%
associate-+l+83.0%
+-commutative83.0%
associate-+r-52.2%
associate-+l-18.5%
+-commutative18.5%
+-commutative18.5%
associate--l+18.5%
Simplified14.4%
Taylor expanded in x around inf 7.6%
Taylor expanded in y around inf 7.1%
flip--7.0%
add-sqr-sqrt7.6%
add-sqr-sqrt7.1%
div-sub7.1%
Applied egg-rr7.1%
div-sub7.1%
associate--l+10.5%
+-inverses10.5%
metadata-eval10.5%
+-commutative10.5%
rem-square-sqrt10.5%
hypot-1-def10.5%
Simplified10.5%
Final simplification24.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 3e+19) (+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y))) (/ 1.0 (+ (sqrt x) (hypot 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 <= 3e+19) {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + hypot(1.0, sqrt(x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3e+19) {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.hypot(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 <= 3e+19: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.hypot(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 <= 3e+19) tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + hypot(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 <= 3e+19)
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + hypot(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, 3e+19], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{+19}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}\\
\end{array}
\end{array}
if y < 3e19Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-66.2%
associate-+l-60.4%
+-commutative60.4%
+-commutative60.4%
associate--l+60.5%
Simplified48.6%
Taylor expanded in x around inf 24.4%
Taylor expanded in x around 0 23.0%
+-commutative23.0%
associate--r+23.0%
associate-+r-23.0%
associate-+r-23.0%
associate--r+23.0%
metadata-eval23.0%
rem-square-sqrt23.0%
hypot-undefine23.0%
Simplified23.0%
Taylor expanded in y around inf 45.6%
if 3e19 < y Initial program 83.9%
associate-+l+83.9%
+-commutative83.9%
associate-+r-83.9%
associate-+l-56.1%
+-commutative56.1%
+-commutative56.1%
associate--l+56.1%
Simplified42.9%
Taylor expanded in x around inf 21.2%
Taylor expanded in y around inf 21.2%
flip--21.1%
add-sqr-sqrt21.5%
add-sqr-sqrt21.2%
div-sub21.2%
Applied egg-rr21.2%
div-sub21.2%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
+-commutative23.4%
rem-square-sqrt23.4%
hypot-1-def23.4%
Simplified23.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 (<= x 8.5) (+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 8.5) {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 8.5) {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 8.5: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 8.5) tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 8.5)
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 8.5], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 8.5Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-97.1%
associate-+l-97.1%
+-commutative97.1%
+-commutative97.1%
associate--l+97.1%
Simplified75.5%
Taylor expanded in x around inf 37.6%
Taylor expanded in x around 0 22.3%
+-commutative22.3%
associate--r+21.8%
associate-+r-36.9%
associate-+r-36.9%
associate--r+36.4%
metadata-eval36.4%
rem-square-sqrt36.4%
hypot-undefine36.4%
Simplified36.4%
Taylor expanded in y around inf 36.4%
if 8.5 < x Initial program 81.1%
associate-+l+81.1%
+-commutative81.1%
associate-+r-46.7%
associate-+l-9.2%
+-commutative9.2%
+-commutative9.2%
associate--l+9.2%
Simplified8.2%
Taylor expanded in x around inf 4.2%
Taylor expanded in y around inf 3.7%
Taylor expanded in x around inf 7.5%
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.0) (+ 1.0 (- (+ 1.0 (* y 0.5)) (+ (sqrt y) (sqrt x)))) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 1.0 + ((1.0 + (y * 0.5)) - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.0d0) then
tmp = 1.0d0 + ((1.0d0 + (y * 0.5d0)) - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 1.0 + ((1.0 + (y * 0.5)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 1.0 + ((1.0 + (y * 0.5)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(1.0 + Float64(Float64(1.0 + Float64(y * 0.5)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.0)
tmp = 1.0 + ((1.0 + (y * 0.5)) - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.0], N[(1.0 + N[(N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;1 + \left(\left(1 + y \cdot 0.5\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 1Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-65.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.4%
Simplified47.9%
Taylor expanded in x around inf 24.2%
Taylor expanded in x around 0 22.7%
+-commutative22.7%
associate--r+22.7%
associate-+r-22.7%
associate-+r-22.7%
associate--r+22.7%
metadata-eval22.7%
rem-square-sqrt22.7%
hypot-undefine22.7%
Simplified22.7%
Taylor expanded in y around 0 22.7%
if 1 < y Initial program 83.6%
associate-+l+83.6%
+-commutative83.6%
associate-+r-82.9%
associate-+l-56.6%
+-commutative56.6%
+-commutative56.6%
associate--l+56.6%
Simplified44.0%
Taylor expanded in x around inf 21.7%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
associate--r+4.2%
associate-+r-19.8%
associate-+r-19.8%
associate--r+27.3%
metadata-eval27.3%
rem-square-sqrt27.3%
hypot-undefine27.3%
Simplified27.3%
Taylor expanded in y around inf 20.4%
Final simplification21.5%
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.0) (- (+ 2.0 (* y 0.5)) (+ (sqrt y) (sqrt x))) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = (2.0 + (y * 0.5)) - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.0d0) then
tmp = (2.0d0 + (y * 0.5d0)) - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = (2.0 + (y * 0.5)) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = (2.0 + (y * 0.5)) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(Float64(2.0 + Float64(y * 0.5)) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.0)
tmp = (2.0 + (y * 0.5)) - (sqrt(y) + sqrt(x));
else
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.0], N[(N[(2.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\left(2 + y \cdot 0.5\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 1Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-65.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.4%
Simplified47.9%
Taylor expanded in x around inf 24.2%
Taylor expanded in x around 0 22.7%
+-commutative22.7%
associate--r+22.7%
associate-+r-22.7%
associate-+r-22.7%
associate--r+22.7%
metadata-eval22.7%
rem-square-sqrt22.7%
hypot-undefine22.7%
Simplified22.7%
Taylor expanded in y around 0 22.7%
if 1 < y Initial program 83.6%
associate-+l+83.6%
+-commutative83.6%
associate-+r-82.9%
associate-+l-56.6%
+-commutative56.6%
+-commutative56.6%
associate--l+56.6%
Simplified44.0%
Taylor expanded in x around inf 21.7%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
associate--r+4.2%
associate-+r-19.8%
associate-+r-19.8%
associate--r+27.3%
metadata-eval27.3%
rem-square-sqrt27.3%
hypot-undefine27.3%
Simplified27.3%
Taylor expanded in y around inf 20.4%
Final simplification21.5%
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 0.37) (+ 1.0 (- 1.0 (+ (sqrt y) (sqrt x)))) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.37) {
tmp = 1.0 + (1.0 - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.37d0) then
tmp = 1.0d0 + (1.0d0 - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.37) {
tmp = 1.0 + (1.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.37: tmp = 1.0 + (1.0 - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.37) tmp = Float64(1.0 + Float64(1.0 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 0.37)
tmp = 1.0 + (1.0 - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 0.37], N[(1.0 + N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.37:\\
\;\;\;\;1 + \left(1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.37Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-65.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.4%
Simplified47.9%
Taylor expanded in x around inf 24.2%
Taylor expanded in x around 0 22.7%
+-commutative22.7%
associate--r+22.7%
associate-+r-22.7%
associate-+r-22.7%
associate--r+22.7%
metadata-eval22.7%
rem-square-sqrt22.7%
hypot-undefine22.7%
Simplified22.7%
Taylor expanded in y around 0 22.7%
if 0.37 < y Initial program 83.6%
associate-+l+83.6%
+-commutative83.6%
associate-+r-82.9%
associate-+l-56.6%
+-commutative56.6%
+-commutative56.6%
associate--l+56.6%
Simplified44.0%
Taylor expanded in x around inf 21.7%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
associate--r+4.2%
associate-+r-19.8%
associate-+r-19.8%
associate--r+27.3%
metadata-eval27.3%
rem-square-sqrt27.3%
hypot-undefine27.3%
Simplified27.3%
Taylor expanded in y around inf 20.4%
Final simplification21.5%
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 0.85) (+ 1.0 (- 1.0 (+ (sqrt y) (sqrt x)))) (- (+ 1.0 (* x 0.5)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.85) {
tmp = 1.0 + (1.0 - (sqrt(y) + sqrt(x)));
} else {
tmp = (1.0 + (x * 0.5)) - 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 <= 0.85d0) then
tmp = 1.0d0 + (1.0d0 - (sqrt(y) + sqrt(x)))
else
tmp = (1.0d0 + (x * 0.5d0)) - 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 <= 0.85) {
tmp = 1.0 + (1.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.85: tmp = 1.0 + (1.0 - (math.sqrt(y) + math.sqrt(x))) else: tmp = (1.0 + (x * 0.5)) - 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 <= 0.85) tmp = Float64(1.0 + Float64(1.0 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - 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 <= 0.85)
tmp = 1.0 + (1.0 - (sqrt(y) + sqrt(x)));
else
tmp = (1.0 + (x * 0.5)) - 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, 0.85], N[(1.0 + N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.85:\\
\;\;\;\;1 + \left(1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.849999999999999978Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-65.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.4%
Simplified47.9%
Taylor expanded in x around inf 24.2%
Taylor expanded in x around 0 22.7%
+-commutative22.7%
associate--r+22.7%
associate-+r-22.7%
associate-+r-22.7%
associate--r+22.7%
metadata-eval22.7%
rem-square-sqrt22.7%
hypot-undefine22.7%
Simplified22.7%
Taylor expanded in y around 0 22.7%
if 0.849999999999999978 < y Initial program 83.6%
associate-+l+83.6%
+-commutative83.6%
associate-+r-82.9%
associate-+l-56.6%
+-commutative56.6%
+-commutative56.6%
associate--l+56.6%
Simplified44.0%
Taylor expanded in x around inf 21.7%
Taylor expanded in y around inf 21.4%
Taylor expanded in x around 0 22.0%
Final simplification22.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 0.85) (- 2.0 (+ (sqrt y) (sqrt x))) (- (+ 1.0 (* x 0.5)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.85) {
tmp = 2.0 - (sqrt(y) + sqrt(x));
} else {
tmp = (1.0 + (x * 0.5)) - 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 <= 0.85d0) then
tmp = 2.0d0 - (sqrt(y) + sqrt(x))
else
tmp = (1.0d0 + (x * 0.5d0)) - 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 <= 0.85) {
tmp = 2.0 - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.85: tmp = 2.0 - (math.sqrt(y) + math.sqrt(x)) else: tmp = (1.0 + (x * 0.5)) - 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 <= 0.85) tmp = Float64(2.0 - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - 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 <= 0.85)
tmp = 2.0 - (sqrt(y) + sqrt(x));
else
tmp = (1.0 + (x * 0.5)) - 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, 0.85], N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.85:\\
\;\;\;\;2 - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.849999999999999978Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-65.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.4%
Simplified47.9%
Taylor expanded in x around inf 24.2%
Taylor expanded in x around 0 22.7%
+-commutative22.7%
associate--r+22.7%
associate-+r-22.7%
associate-+r-22.7%
associate--r+22.7%
metadata-eval22.7%
rem-square-sqrt22.7%
hypot-undefine22.7%
Simplified22.7%
Taylor expanded in y around 0 22.7%
if 0.849999999999999978 < y Initial program 83.6%
associate-+l+83.6%
+-commutative83.6%
associate-+r-82.9%
associate-+l-56.6%
+-commutative56.6%
+-commutative56.6%
associate--l+56.6%
Simplified44.0%
Taylor expanded in x around inf 21.7%
Taylor expanded in y around inf 21.4%
Taylor expanded in x around 0 22.0%
Final simplification22.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.0) (- (+ 1.0 (* x 0.5)) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.0) {
tmp = (1.0 + (x * 0.5)) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.0d0) then
tmp = (1.0d0 + (x * 0.5d0)) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.0) {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.0: tmp = (1.0 + (x * 0.5)) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.0)
tmp = (1.0 + (x * 0.5)) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.0], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-97.1%
associate-+l-97.1%
+-commutative97.1%
+-commutative97.1%
associate--l+97.1%
Simplified75.3%
Taylor expanded in x around inf 37.7%
Taylor expanded in y around inf 27.6%
Taylor expanded in x around 0 27.6%
if 1 < x Initial program 81.3%
associate-+l+81.3%
+-commutative81.3%
associate-+r-47.2%
associate-+l-9.9%
+-commutative9.9%
+-commutative9.9%
associate--l+9.9%
Simplified9.0%
Taylor expanded in x around inf 4.3%
Taylor expanded in y around inf 3.8%
Taylor expanded in x around inf 7.6%
Final simplification18.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 (<= x 0.21) (- 1.0 (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.21) {
tmp = 1.0 - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.21d0) then
tmp = 1.0d0 - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.21) {
tmp = 1.0 - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.21: tmp = 1.0 - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.21) tmp = Float64(1.0 - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.21)
tmp = 1.0 - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.21], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.21:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.209999999999999992Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-97.1%
associate-+l-97.1%
+-commutative97.1%
+-commutative97.1%
associate--l+97.1%
Simplified75.3%
Taylor expanded in x around inf 37.7%
Taylor expanded in y around inf 27.6%
Taylor expanded in x around 0 27.0%
if 0.209999999999999992 < x Initial program 81.3%
associate-+l+81.3%
+-commutative81.3%
associate-+r-47.2%
associate-+l-9.9%
+-commutative9.9%
+-commutative9.9%
associate--l+9.9%
Simplified9.0%
Taylor expanded in x around inf 4.3%
Taylor expanded in y around inf 3.8%
Taylor expanded in x around inf 7.6%
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 90.1%
associate-+l+90.1%
+-commutative90.1%
associate-+r-74.9%
associate-+l-58.3%
+-commutative58.3%
+-commutative58.3%
associate--l+58.3%
Simplified45.8%
Taylor expanded in x around inf 22.8%
Taylor expanded in y around inf 17.0%
Taylor expanded in x around 0 15.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[y], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{y}
\end{array}
Initial program 90.1%
associate-+l+90.1%
+-commutative90.1%
associate-+r-74.9%
associate-+l-58.3%
+-commutative58.3%
+-commutative58.3%
associate--l+58.3%
Simplified45.8%
Taylor expanded in y around 0 23.0%
Taylor expanded in y around inf 1.6%
neg-mul-11.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024096
(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))))