
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_5 (sqrt (+ x 1.0))))
(if (<= (+ (+ (+ (- t_5 (sqrt x)) (- t_1 (sqrt y))) t_3) t_4) 0.99)
(+ (+ (/ 1.0 (+ (sqrt x) t_5)) (* 0.5 (sqrt (/ 1.0 y)))) t_3)
(+
(+
(+ 1.0 (- (* x (+ 0.5 (* x -0.125))) (sqrt x)))
(/ 1.0 (+ (sqrt y) t_1)))
(+ (/ 1.0 (+ (sqrt z) t_2)) t_4)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double t_5 = sqrt((x + 1.0));
double tmp;
if (((((t_5 - sqrt(x)) + (t_1 - sqrt(y))) + t_3) + t_4) <= 0.99) {
tmp = ((1.0 / (sqrt(x) + t_5)) + (0.5 * sqrt((1.0 / y)))) + t_3;
} else {
tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x))) + (1.0 / (sqrt(y) + t_1))) + ((1.0 / (sqrt(z) + t_2)) + t_4);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
t_5 = sqrt((x + 1.0d0))
if (((((t_5 - sqrt(x)) + (t_1 - sqrt(y))) + t_3) + t_4) <= 0.99d0) then
tmp = ((1.0d0 / (sqrt(x) + t_5)) + (0.5d0 * sqrt((1.0d0 / y)))) + t_3
else
tmp = ((1.0d0 + ((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x))) + (1.0d0 / (sqrt(y) + t_1))) + ((1.0d0 / (sqrt(z) + t_2)) + t_4)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_5 = Math.sqrt((x + 1.0));
double tmp;
if (((((t_5 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + t_3) + t_4) <= 0.99) {
tmp = ((1.0 / (Math.sqrt(x) + t_5)) + (0.5 * Math.sqrt((1.0 / y)))) + t_3;
} else {
tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - Math.sqrt(x))) + (1.0 / (Math.sqrt(y) + t_1))) + ((1.0 / (Math.sqrt(z) + t_2)) + t_4);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) t_5 = math.sqrt((x + 1.0)) tmp = 0 if ((((t_5 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + t_3) + t_4) <= 0.99: tmp = ((1.0 / (math.sqrt(x) + t_5)) + (0.5 * math.sqrt((1.0 / y)))) + t_3 else: tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - math.sqrt(x))) + (1.0 / (math.sqrt(y) + t_1))) + ((1.0 / (math.sqrt(z) + t_2)) + t_4) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_5 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (Float64(Float64(Float64(Float64(t_5 - sqrt(x)) + Float64(t_1 - sqrt(y))) + t_3) + t_4) <= 0.99) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_5)) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_3); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + t_4)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + t)) - sqrt(t);
t_5 = sqrt((x + 1.0));
tmp = 0.0;
if (((((t_5 - sqrt(x)) + (t_1 - sqrt(y))) + t_3) + t_4) <= 0.99)
tmp = ((1.0 / (sqrt(x) + t_5)) + (0.5 * sqrt((1.0 / y)))) + t_3;
else
tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x))) + (1.0 / (sqrt(y) + t_1))) + ((1.0 / (sqrt(z) + t_2)) + t_4);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(t$95$5 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision], 0.99], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$5), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
t_3 := t\_2 - \sqrt{z}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
t_5 := \sqrt{x + 1}\\
\mathbf{if}\;\left(\left(\left(t\_5 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + t\_3\right) + t\_4 \leq 0.99:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t\_5} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right)\right) + \frac{1}{\sqrt{y} + t\_1}\right) + \left(\frac{1}{\sqrt{z} + t\_2} + t\_4\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.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))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t))) < 0.98999999999999999Initial program 22.6%
associate-+l+22.6%
sub-neg22.6%
sub-neg22.6%
+-commutative22.6%
+-commutative22.6%
+-commutative22.6%
Simplified22.6%
flip--22.6%
div-inv22.6%
add-sqr-sqrt8.6%
+-commutative8.6%
add-sqr-sqrt22.6%
+-commutative22.6%
Applied egg-rr22.6%
associate--l+46.0%
+-inverses46.0%
metadata-eval46.0%
*-lft-identity46.0%
+-commutative46.0%
Simplified46.0%
Taylor expanded in t around inf 41.7%
Taylor expanded in y around inf 56.0%
if 0.98999999999999999 < (+.f64 (+.f64 (+.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))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t #s(literal 1 binary64))) (sqrt.f64 t))) Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
sub-neg96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
flip--96.3%
div-inv96.3%
add-sqr-sqrt80.1%
add-sqr-sqrt96.4%
associate--l+97.2%
Applied egg-rr97.2%
+-inverses97.2%
metadata-eval97.2%
*-lft-identity97.2%
+-commutative97.2%
Simplified97.2%
flip--97.4%
div-inv97.4%
add-sqr-sqrt78.8%
add-sqr-sqrt98.1%
associate--l+98.7%
Applied egg-rr98.7%
+-inverses98.7%
metadata-eval98.7%
*-lft-identity98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in x around 0 52.2%
associate--l+52.2%
Simplified52.2%
Final simplification52.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))) (t_2 (sqrt (+ 1.0 z))))
(if (<= (- t_1 (sqrt x)) 0.99)
(+ (+ (/ 1.0 (+ (sqrt x) t_1)) (* 0.5 (sqrt (/ 1.0 y)))) (- t_2 (sqrt z)))
(+
(+
(+ 1.0 (- (* x (+ 0.5 (* x -0.125))) (sqrt x)))
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(/ 1.0 (+ (sqrt z) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((1.0 + z));
double tmp;
if ((t_1 - sqrt(x)) <= 0.99) {
tmp = ((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / y)))) + (t_2 - sqrt(z));
} else {
tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (1.0 / (sqrt(z) + t_2));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((1.0d0 + z))
if ((t_1 - sqrt(x)) <= 0.99d0) then
tmp = ((1.0d0 / (sqrt(x) + t_1)) + (0.5d0 * sqrt((1.0d0 / y)))) + (t_2 - sqrt(z))
else
tmp = ((1.0d0 + ((x * (0.5d0 + (x * (-0.125d0)))) - sqrt(x))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (1.0d0 / (sqrt(z) + t_2))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if ((t_1 - Math.sqrt(x)) <= 0.99) {
tmp = ((1.0 / (Math.sqrt(x) + t_1)) + (0.5 * Math.sqrt((1.0 / y)))) + (t_2 - Math.sqrt(z));
} else {
tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - Math.sqrt(x))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (1.0 / (Math.sqrt(z) + t_2));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if (t_1 - math.sqrt(x)) <= 0.99: tmp = ((1.0 / (math.sqrt(x) + t_1)) + (0.5 * math.sqrt((1.0 / y)))) + (t_2 - math.sqrt(z)) else: tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - math.sqrt(x))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (1.0 / (math.sqrt(z) + t_2)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 0.99) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(t_2 - sqrt(z))); else tmp = Float64(Float64(Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * -0.125))) - sqrt(x))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(1.0 / Float64(sqrt(z) + t_2))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 0.99)
tmp = ((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / y)))) + (t_2 - sqrt(z));
else
tmp = ((1.0 + ((x * (0.5 + (x * -0.125))) - sqrt(x))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (1.0 / (sqrt(z) + t_2));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.99], 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[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t\_1 - \sqrt{x} \leq 0.99:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t\_1} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(t\_2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \left(x \cdot \left(0.5 + x \cdot -0.125\right) - \sqrt{x}\right)\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \frac{1}{\sqrt{z} + t\_2}\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.98999999999999999Initial program 86.6%
associate-+l+86.6%
sub-neg86.6%
sub-neg86.6%
+-commutative86.6%
+-commutative86.6%
+-commutative86.6%
Simplified86.6%
flip--86.6%
div-inv86.6%
add-sqr-sqrt47.3%
+-commutative47.3%
add-sqr-sqrt86.7%
+-commutative86.7%
Applied egg-rr86.7%
associate--l+90.2%
+-inverses90.2%
metadata-eval90.2%
*-lft-identity90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in t around inf 45.6%
Taylor expanded in y around inf 23.6%
if 0.98999999999999999 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 95.8%
associate-+l+95.8%
sub-neg95.8%
sub-neg95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
flip--95.8%
div-inv95.8%
add-sqr-sqrt78.1%
add-sqr-sqrt96.0%
associate--l+97.2%
Applied egg-rr97.2%
+-inverses97.2%
metadata-eval97.2%
*-lft-identity97.2%
+-commutative97.2%
Simplified97.2%
flip--97.6%
div-inv97.6%
add-sqr-sqrt73.9%
add-sqr-sqrt98.3%
associate--l+99.1%
Applied egg-rr99.1%
+-inverses99.1%
metadata-eval99.1%
*-lft-identity99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 99.1%
associate--l+99.1%
Simplified99.1%
Taylor expanded in t around inf 63.8%
+-commutative63.8%
Simplified63.8%
Final simplification43.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 10500000.0)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(+ t_1 (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t))))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (* 0.5 (sqrt (/ 1.0 y))))
t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 10500000.0) {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (t_1 + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 10500000.0d0) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + (t_1 + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (0.5d0 * sqrt((1.0d0 / y)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 10500000.0) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (t_1 + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (0.5 * Math.sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 10500000.0: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (t_1 + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t))))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (0.5 * math.sqrt((1.0 / y)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 10500000.0) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(t_1 + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 10500000.0)
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (t_1 + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 10500000.0], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $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 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 10500000:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(t\_1 + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_1\\
\end{array}
\end{array}
if y < 1.05e7Initial program 97.1%
associate-+l+97.1%
sub-neg97.1%
sub-neg97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in x around 0 39.9%
flip--40.0%
div-inv40.0%
add-sqr-sqrt31.5%
+-commutative31.5%
add-sqr-sqrt40.0%
associate--l+40.0%
Applied egg-rr40.0%
associate-*r/40.0%
*-rgt-identity40.0%
associate-+r-40.0%
+-commutative40.0%
associate-+r-40.2%
+-inverses40.2%
metadata-eval40.2%
+-commutative40.2%
Simplified40.2%
if 1.05e7 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
flip--84.4%
div-inv84.4%
add-sqr-sqrt70.5%
+-commutative70.5%
add-sqr-sqrt84.4%
+-commutative84.4%
Applied egg-rr84.4%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
*-lft-identity87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 52.0%
Taylor expanded in y around inf 55.2%
Final simplification47.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 23000000.0)
(+
(+ (/ 1.0 (+ (sqrt z) t_1)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (* 0.5 (sqrt (/ 1.0 y))))
(- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 23000000.0) {
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 23000000.0d0) then
tmp = ((1.0d0 / (sqrt(z) + t_1)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 23000000.0) {
tmp = ((1.0 / (Math.sqrt(z) + t_1)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (0.5 * Math.sqrt((1.0 / y)))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 23000000.0: tmp = ((1.0 / (math.sqrt(z) + t_1)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (0.5 * math.sqrt((1.0 / y)))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 23000000.0) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 23000000.0)
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 23000000.0], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 23000000:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + t\_1} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 2.3e7Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 40.3%
flip--97.1%
div-inv97.1%
add-sqr-sqrt80.9%
add-sqr-sqrt97.1%
associate--l+98.1%
Applied egg-rr40.9%
+-inverses98.1%
metadata-eval98.1%
*-lft-identity98.1%
+-commutative98.1%
Simplified40.9%
if 2.3e7 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
flip--84.4%
div-inv84.4%
add-sqr-sqrt70.4%
+-commutative70.4%
add-sqr-sqrt84.4%
+-commutative84.4%
Applied egg-rr84.4%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
*-lft-identity87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 52.3%
Taylor expanded in y around inf 55.5%
Final simplification47.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 14500000.0)
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (* 0.5 (sqrt (/ 1.0 y))))
t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 14500000.0) {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 14500000.0d0) then
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + (t_1 + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (0.5d0 * sqrt((1.0d0 / y)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 14500000.0) {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (0.5 * Math.sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 14500000.0: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (0.5 * math.sqrt((1.0 / y)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 14500000.0) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 14500000.0)
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 14500000.0], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $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 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 14500000:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_1\\
\end{array}
\end{array}
if y < 1.45e7Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 40.3%
if 1.45e7 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
flip--84.4%
div-inv84.4%
add-sqr-sqrt70.4%
+-commutative70.4%
add-sqr-sqrt84.4%
+-commutative84.4%
Applied egg-rr84.4%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
*-lft-identity87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 52.3%
Taylor expanded in y around inf 55.5%
Final simplification47.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 27000000.0)
(+
(/ 1.0 (+ (sqrt z) t_1))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (* 0.5 (sqrt (/ 1.0 y))))
(- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 27000000.0) {
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 27000000.0d0) then
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 27000000.0) {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (0.5 * Math.sqrt((1.0 / y)))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 27000000.0: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (0.5 * math.sqrt((1.0 / y)))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 27000000.0) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 27000000.0)
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / y)))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 27000000.0], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 27000000:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 2.7e7Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 26.0%
flip--97.1%
div-inv97.1%
add-sqr-sqrt80.9%
add-sqr-sqrt97.1%
associate--l+98.1%
Applied egg-rr26.5%
+-inverses98.1%
metadata-eval98.1%
*-lft-identity98.1%
+-commutative98.1%
Simplified26.5%
if 2.7e7 < y Initial program 84.4%
associate-+l+84.4%
sub-neg84.4%
sub-neg84.4%
+-commutative84.4%
+-commutative84.4%
+-commutative84.4%
Simplified84.4%
flip--84.4%
div-inv84.4%
add-sqr-sqrt70.4%
+-commutative70.4%
add-sqr-sqrt84.4%
+-commutative84.4%
Applied egg-rr84.4%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
*-lft-identity87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 52.3%
Taylor expanded in y around inf 55.5%
Final simplification40.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= x 3.75e-19)
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (+ (- 1.0 (sqrt x)) t_1))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) 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 + y)) - sqrt(y);
double tmp;
if (x <= 3.75e-19) {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + t_1);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
if (x <= 3.75d-19) then
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 - sqrt(x)) + t_1)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + 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 + y)) - Math.sqrt(y);
double tmp;
if (x <= 3.75e-19) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 - Math.sqrt(x)) + t_1);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + 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 + y)) - math.sqrt(y) tmp = 0 if x <= 3.75e-19: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 - math.sqrt(x)) + t_1) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + 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 + y)) - sqrt(y)) tmp = 0.0 if (x <= 3.75e-19) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 - sqrt(x)) + t_1)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + 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 + y)) - sqrt(y);
tmp = 0.0;
if (x <= 3.75e-19)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + t_1);
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + 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 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.75e-19], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $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 + y} - \sqrt{y}\\
\mathbf{if}\;x \leq 3.75 \cdot 10^{-19}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 - \sqrt{x}\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\\
\end{array}
\end{array}
if x < 3.74999999999999979e-19Initial program 95.9%
associate-+l+95.9%
sub-neg95.9%
sub-neg95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in x around 0 95.9%
Taylor expanded in t around inf 62.1%
flip--95.9%
div-inv95.9%
add-sqr-sqrt77.2%
add-sqr-sqrt96.1%
associate--l+97.4%
Applied egg-rr63.2%
+-inverses97.4%
metadata-eval97.4%
*-lft-identity97.4%
+-commutative97.4%
Simplified63.2%
if 3.74999999999999979e-19 < x Initial program 86.9%
associate-+l+86.9%
sub-neg86.9%
sub-neg86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
flip--86.9%
div-inv86.9%
add-sqr-sqrt49.3%
+-commutative49.3%
add-sqr-sqrt87.0%
+-commutative87.0%
Applied egg-rr87.0%
associate--l+90.4%
+-inverses90.4%
metadata-eval90.4%
*-lft-identity90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 46.2%
Taylor expanded in z around inf 17.4%
+-commutative17.4%
associate-+r-22.4%
+-commutative22.4%
+-commutative22.4%
+-commutative22.4%
Simplified22.4%
Final simplification41.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= x 3.75e-19)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ (- 1.0 (sqrt x)) t_1))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) 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 + y)) - sqrt(y);
double tmp;
if (x <= 3.75e-19) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + t_1);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
if (x <= 3.75d-19) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 - sqrt(x)) + t_1)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + 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 + y)) - Math.sqrt(y);
double tmp;
if (x <= 3.75e-19) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 - Math.sqrt(x)) + t_1);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + 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 + y)) - math.sqrt(y) tmp = 0 if x <= 3.75e-19: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 - math.sqrt(x)) + t_1) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + 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 + y)) - sqrt(y)) tmp = 0.0 if (x <= 3.75e-19) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 - sqrt(x)) + t_1)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + 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 + y)) - sqrt(y);
tmp = 0.0;
if (x <= 3.75e-19)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + t_1);
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + 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 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.75e-19], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $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 + y} - \sqrt{y}\\
\mathbf{if}\;x \leq 3.75 \cdot 10^{-19}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 - \sqrt{x}\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\\
\end{array}
\end{array}
if x < 3.74999999999999979e-19Initial program 95.9%
associate-+l+95.9%
sub-neg95.9%
sub-neg95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in x around 0 95.9%
Taylor expanded in t around inf 62.1%
if 3.74999999999999979e-19 < x Initial program 86.9%
associate-+l+86.9%
sub-neg86.9%
sub-neg86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
flip--86.9%
div-inv86.9%
add-sqr-sqrt49.3%
+-commutative49.3%
add-sqr-sqrt87.0%
+-commutative87.0%
Applied egg-rr87.0%
associate--l+90.4%
+-inverses90.4%
metadata-eval90.4%
*-lft-identity90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 46.2%
Taylor expanded in z around inf 17.4%
+-commutative17.4%
associate-+r-22.4%
+-commutative22.4%
+-commutative22.4%
+-commutative22.4%
Simplified22.4%
Final simplification40.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 (<= y 2.2e-10)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(- (+ 2.0 (* y 0.5)) (+ (sqrt x) (sqrt y))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (- (sqrt (+ 1.0 y)) (sqrt y)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-10) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 + (y * 0.5)) - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.2d-10) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((2.0d0 + (y * 0.5d0)) - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-10) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((2.0 + (y * 0.5)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.2e-10: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((2.0 + (y * 0.5)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.2e-10) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(2.0 + Float64(y * 0.5)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.2e-10)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 + (y * 0.5)) - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e-10], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-10}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(2 + y \cdot 0.5\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if y < 2.1999999999999999e-10Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in t around inf 24.9%
Taylor expanded in y around 0 24.9%
if 2.1999999999999999e-10 < y Initial program 85.5%
associate-+l+85.5%
sub-neg85.5%
sub-neg85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
flip--85.5%
div-inv85.5%
add-sqr-sqrt69.4%
+-commutative69.4%
add-sqr-sqrt85.5%
+-commutative85.5%
Applied egg-rr85.5%
associate--l+88.6%
+-inverses88.6%
metadata-eval88.6%
*-lft-identity88.6%
+-commutative88.6%
Simplified88.6%
Taylor expanded in t around inf 53.4%
Taylor expanded in z around inf 10.6%
+-commutative10.6%
associate-+r-32.2%
+-commutative32.2%
+-commutative32.2%
+-commutative32.2%
Simplified32.2%
Final simplification28.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 6.6e-13) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (- 2.0 (sqrt x)) (sqrt y))) (+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.6e-13) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.6d-13) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((2.0d0 - sqrt(x)) - sqrt(y))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.6e-13) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.6e-13: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.6e-13) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.6e-13)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.6e-13], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{-13}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if y < 6.6000000000000001e-13Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in t around inf 24.9%
Taylor expanded in y around 0 24.9%
associate--r+24.9%
Simplified24.9%
if 6.6000000000000001e-13 < y Initial program 85.5%
associate-+l+85.5%
sub-neg85.5%
sub-neg85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
flip--85.5%
div-inv85.5%
add-sqr-sqrt69.4%
+-commutative69.4%
add-sqr-sqrt85.5%
+-commutative85.5%
Applied egg-rr85.5%
associate--l+88.6%
+-inverses88.6%
metadata-eval88.6%
*-lft-identity88.6%
+-commutative88.6%
Simplified88.6%
Taylor expanded in t around inf 53.4%
Taylor expanded in z around inf 10.6%
+-commutative10.6%
associate-+r-32.2%
+-commutative32.2%
+-commutative32.2%
+-commutative32.2%
Simplified32.2%
Final simplification28.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 0.65) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (- 2.0 (sqrt x)) (sqrt y))) (+ 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.65) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
} 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.65d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((2.0d0 - sqrt(x)) - sqrt(y))
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.65) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((2.0 - Math.sqrt(x)) - Math.sqrt(y));
} 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.65: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((2.0 - math.sqrt(x)) - math.sqrt(y)) 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.65) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(2.0 - sqrt(x)) - sqrt(y))); else tmp = Float64(1.0 + Float64(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.65)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((2.0 - sqrt(x)) - sqrt(y));
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.65], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.65:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 0.650000000000000022Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 25.3%
Taylor expanded in y around 0 24.3%
associate--r+24.3%
Simplified24.3%
if 0.650000000000000022 < y Initial program 84.9%
associate-+l+84.9%
sub-neg84.9%
sub-neg84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in x around 0 53.1%
Taylor expanded in t around inf 35.9%
Taylor expanded in y around inf 35.5%
Taylor expanded in z around inf 25.0%
associate--l+25.0%
Simplified25.0%
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 (<= y 0.39) (- (+ 2.0 (* 0.5 (sqrt (/ 1.0 t)))) (+ (sqrt x) (sqrt y))) (+ 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.39) {
tmp = (2.0 + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + sqrt(y));
} 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.39d0) then
tmp = (2.0d0 + (0.5d0 * sqrt((1.0d0 / t)))) - (sqrt(x) + sqrt(y))
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.39) {
tmp = (2.0 + (0.5 * Math.sqrt((1.0 / t)))) - (Math.sqrt(x) + Math.sqrt(y));
} 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.39: tmp = (2.0 + (0.5 * math.sqrt((1.0 / t)))) - (math.sqrt(x) + math.sqrt(y)) 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.39) tmp = Float64(Float64(2.0 + Float64(0.5 * sqrt(Float64(1.0 / t)))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 + Float64(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.39)
tmp = (2.0 + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + sqrt(y));
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.39], N[(N[(2.0 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.39:\\
\;\;\;\;\left(2 + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 0.39000000000000001Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 24.2%
Taylor expanded in y around 0 13.3%
Taylor expanded in z around inf 15.5%
if 0.39000000000000001 < y Initial program 84.9%
associate-+l+84.9%
sub-neg84.9%
sub-neg84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in x around 0 53.1%
Taylor expanded in t around inf 35.9%
Taylor expanded in y around inf 35.5%
Taylor expanded in z around inf 25.0%
associate--l+25.0%
Simplified25.0%
Final simplification20.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 0.335) (+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z)))) (+ 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.335) {
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
} 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.335d0) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z)))
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.335) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)));
} 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.335: tmp = 1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z))) 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.335) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))); else tmp = Float64(1.0 + Float64(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.335)
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
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.335], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.335:\\
\;\;\;\;1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 0.33500000000000002Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 25.3%
Taylor expanded in y around inf 5.3%
associate--l+11.1%
Simplified11.1%
if 0.33500000000000002 < y Initial program 84.9%
associate-+l+84.9%
sub-neg84.9%
sub-neg84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in x around 0 53.1%
Taylor expanded in t around inf 35.9%
Taylor expanded in y around inf 35.5%
Taylor expanded in z around inf 25.0%
associate--l+25.0%
Simplified25.0%
Final simplification18.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 3.2e+14) (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z))) (+ 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 (z <= 3.2e+14) {
tmp = sqrt((1.0 + z)) - (sqrt(x) + sqrt(z));
} 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 (z <= 3.2d+14) then
tmp = sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z))
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 (z <= 3.2e+14) {
tmp = Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z));
} 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 z <= 3.2e+14: tmp = math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z)) 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 (z <= 3.2e+14) tmp = Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z))); else tmp = Float64(1.0 + Float64(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 (z <= 3.2e+14)
tmp = sqrt((1.0 + z)) - (sqrt(x) + sqrt(z));
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[z, 3.2e+14], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.2 \cdot 10^{+14}:\\
\;\;\;\;\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 3.2e14Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 26.5%
Taylor expanded in x around inf 8.1%
mul-1-neg8.1%
Simplified8.1%
Taylor expanded in x around 0 8.1%
if 3.2e14 < z Initial program 85.1%
associate-+l+85.1%
sub-neg85.1%
sub-neg85.1%
+-commutative85.1%
+-commutative85.1%
+-commutative85.1%
Simplified85.1%
Taylor expanded in x around 0 54.1%
Taylor expanded in t around inf 35.4%
Taylor expanded in y around inf 23.4%
Taylor expanded in z around inf 23.4%
associate--l+23.4%
Simplified23.4%
Final simplification15.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.0) (- 1.0 (+ (sqrt x) (sqrt z))) (+ 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 (z <= 1.0) {
tmp = 1.0 - (sqrt(x) + sqrt(z));
} 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 (z <= 1.0d0) then
tmp = 1.0d0 - (sqrt(x) + sqrt(z))
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 (z <= 1.0) {
tmp = 1.0 - (Math.sqrt(x) + Math.sqrt(z));
} 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 z <= 1.0: tmp = 1.0 - (math.sqrt(x) + math.sqrt(z)) 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 (z <= 1.0) tmp = Float64(1.0 - Float64(sqrt(x) + sqrt(z))); else tmp = Float64(1.0 + Float64(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 (z <= 1.0)
tmp = 1.0 - (sqrt(x) + sqrt(z));
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[z, 1.0], N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;1 - \left(\sqrt{x} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 1Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 41.0%
Taylor expanded in t around inf 26.8%
Taylor expanded in x around inf 8.2%
mul-1-neg8.2%
Simplified8.2%
Taylor expanded in z around 0 8.2%
if 1 < z Initial program 85.0%
associate-+l+85.0%
sub-neg85.0%
sub-neg85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in x around 0 53.0%
Taylor expanded in t around inf 34.9%
Taylor expanded in y around inf 23.4%
Taylor expanded in z around inf 23.2%
associate--l+23.2%
Simplified23.2%
Final simplification15.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 (<= z 57000000000000.0) (- (+ 1.0 (* z 0.5)) (+ (sqrt x) (sqrt z))) (+ 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 (z <= 57000000000000.0) {
tmp = (1.0 + (z * 0.5)) - (sqrt(x) + sqrt(z));
} 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 (z <= 57000000000000.0d0) then
tmp = (1.0d0 + (z * 0.5d0)) - (sqrt(x) + sqrt(z))
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 (z <= 57000000000000.0) {
tmp = (1.0 + (z * 0.5)) - (Math.sqrt(x) + Math.sqrt(z));
} 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 z <= 57000000000000.0: tmp = (1.0 + (z * 0.5)) - (math.sqrt(x) + math.sqrt(z)) 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 (z <= 57000000000000.0) tmp = Float64(Float64(1.0 + Float64(z * 0.5)) - Float64(sqrt(x) + sqrt(z))); else tmp = Float64(1.0 + Float64(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 (z <= 57000000000000.0)
tmp = (1.0 + (z * 0.5)) - (sqrt(x) + sqrt(z));
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[z, 57000000000000.0], N[(N[(1.0 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 57000000000000:\\
\;\;\;\;\left(1 + z \cdot 0.5\right) - \left(\sqrt{x} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \sqrt{\frac{1}{y}} - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 5.7e13Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in x around 0 40.3%
Taylor expanded in t around inf 26.5%
Taylor expanded in x around inf 8.1%
mul-1-neg8.1%
Simplified8.1%
Taylor expanded in z around 0 8.1%
*-commutative8.1%
Simplified8.1%
if 5.7e13 < z Initial program 85.1%
associate-+l+85.1%
sub-neg85.1%
sub-neg85.1%
+-commutative85.1%
+-commutative85.1%
+-commutative85.1%
Simplified85.1%
Taylor expanded in x around 0 54.1%
Taylor expanded in t around inf 35.4%
Taylor expanded in y around inf 23.4%
Taylor expanded in z around inf 23.4%
associate--l+23.4%
Simplified23.4%
Final simplification15.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.0) (- 1.0 (+ (sqrt x) (sqrt z))) (* 0.5 (sqrt (/ 1.0 y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.0) {
tmp = 1.0 - (sqrt(x) + sqrt(z));
} else {
tmp = 0.5 * sqrt((1.0 / y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.0d0) then
tmp = 1.0d0 - (sqrt(x) + sqrt(z))
else
tmp = 0.5d0 * sqrt((1.0d0 / y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.0) {
tmp = 1.0 - (Math.sqrt(x) + Math.sqrt(z));
} else {
tmp = 0.5 * Math.sqrt((1.0 / y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.0: tmp = 1.0 - (math.sqrt(x) + math.sqrt(z)) else: tmp = 0.5 * math.sqrt((1.0 / y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.0) tmp = Float64(1.0 - Float64(sqrt(x) + sqrt(z))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.0)
tmp = 1.0 - (sqrt(x) + sqrt(z));
else
tmp = 0.5 * sqrt((1.0 / y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.0], N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1:\\
\;\;\;\;1 - \left(\sqrt{x} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{y}}\\
\end{array}
\end{array}
if z < 1Initial program 97.0%
associate-+l+97.0%
sub-neg97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 41.0%
Taylor expanded in t around inf 26.8%
Taylor expanded in x around inf 8.2%
mul-1-neg8.2%
Simplified8.2%
Taylor expanded in z around 0 8.2%
if 1 < z Initial program 85.0%
associate-+l+85.0%
sub-neg85.0%
sub-neg85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in x around 0 53.0%
Taylor expanded in t around inf 34.9%
Taylor expanded in y around inf 23.4%
Taylor expanded in y around 0 9.4%
Final simplification8.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.5 (sqrt (/ 1.0 t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.5 * sqrt((1.0 / t));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.5d0 * sqrt((1.0d0 / t))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.5 * Math.sqrt((1.0 / t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 * math.sqrt((1.0 / t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 * sqrt(Float64(1.0 / t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.5 * sqrt((1.0 / t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.5 \cdot \sqrt{\frac{1}{t}}
\end{array}
Initial program 91.1%
associate-+l+91.1%
sub-neg91.1%
sub-neg91.1%
+-commutative91.1%
+-commutative91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in x around 0 46.9%
Taylor expanded in t around inf 29.4%
Taylor expanded in y around 0 7.6%
Taylor expanded in t around 0 7.3%
Final simplification7.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.5 (sqrt (/ 1.0 y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.5 * sqrt((1.0 / 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 = 0.5d0 * sqrt((1.0d0 / y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.5 * Math.sqrt((1.0 / y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 * math.sqrt((1.0 / y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 * sqrt(Float64(1.0 / y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.5 * sqrt((1.0 / y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.5 \cdot \sqrt{\frac{1}{y}}
\end{array}
Initial program 91.1%
associate-+l+91.1%
sub-neg91.1%
sub-neg91.1%
+-commutative91.1%
+-commutative91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in x around 0 46.9%
Taylor expanded in t around inf 30.8%
Taylor expanded in y around inf 20.6%
Taylor expanded in y around 0 8.4%
Final simplification8.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 91.1%
associate-+l+91.1%
sub-neg91.1%
sub-neg91.1%
+-commutative91.1%
+-commutative91.1%
+-commutative91.1%
Simplified91.1%
Taylor expanded in x around 0 46.9%
Taylor expanded in t around inf 30.8%
Taylor expanded in x around inf 5.0%
mul-1-neg5.0%
Simplified5.0%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
Final simplification1.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 2024071
(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))))