
(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 x) (sqrt (+ 1.0 x)))))
(+
(/ (+ t_1 (+ (sqrt y) t_2)) (* t_2 (+ t_1 (sqrt y))))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt(x) + sqrt((1.0 + x));
return ((t_1 + (sqrt(y) + t_2)) / (t_2 * (t_1 + sqrt(y)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt(x) + sqrt((1.0d0 + x))
code = ((t_1 + (sqrt(y) + t_2)) / (t_2 * (t_1 + sqrt(y)))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt(x) + Math.sqrt((1.0 + x));
return ((t_1 + (Math.sqrt(y) + t_2)) / (t_2 * (t_1 + Math.sqrt(y)))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt(x) + math.sqrt((1.0 + x)) return ((t_1 + (math.sqrt(y) + t_2)) / (t_2 * (t_1 + math.sqrt(y)))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(x) + sqrt(Float64(1.0 + x))) return Float64(Float64(Float64(t_1 + Float64(sqrt(y) + t_2)) / Float64(t_2 * Float64(t_1 + sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt(x) + sqrt((1.0 + x));
tmp = ((t_1 + (sqrt(y) + t_2)) / (t_2 * (t_1 + sqrt(y)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(t$95$1 + N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{x} + \sqrt{1 + x}\\
\frac{t_1 + \left(\sqrt{y} + t_2\right)}{t_2 \cdot \left(t_1 + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
\end{array}
Initial program 89.9%
associate-+l+89.9%
associate-+l-71.7%
+-commutative71.7%
sub-neg71.7%
sub-neg71.7%
+-commutative71.7%
+-commutative71.7%
Simplified71.7%
flip--71.8%
add-sqr-sqrt55.7%
add-sqr-sqrt71.8%
Applied egg-rr71.8%
associate--l+72.1%
+-inverses72.1%
metadata-eval72.1%
Simplified72.1%
add-exp-log72.1%
associate--r-92.1%
Applied egg-rr92.1%
flip--92.1%
add-sqr-sqrt73.5%
add-sqr-sqrt92.3%
Applied egg-rr92.3%
+-commutative92.3%
associate--l+94.2%
+-commutative94.2%
+-commutative94.2%
Simplified94.2%
add-exp-log94.3%
frac-add94.2%
+-inverses94.2%
metadata-eval94.2%
*-un-lft-identity94.2%
Applied egg-rr94.2%
*-rgt-identity94.2%
associate-+l+94.2%
*-commutative94.2%
Simplified94.2%
Final simplification94.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)))
(t_2 (- t_1 (sqrt y)))
(t_3 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_4 (sqrt (+ 1.0 x)))
(t_5 (+ t_2 (- t_4 (sqrt x)))))
(if (<= t_5 5e-7)
(/ 1.0 (+ (sqrt x) t_4))
(if (<= t_5 1.999999999999996)
(+ t_3 (+ t_4 (- (/ 1.0 (+ t_1 (sqrt y))) (sqrt x))))
(+
(+ 1.0 t_2)
(+ t_3 (/ (- (+ 1.0 t) t) (+ (sqrt t) (sqrt (+ 1.0 t))))))))))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 = t_1 - sqrt(y);
double t_3 = sqrt((1.0 + z)) - sqrt(z);
double t_4 = sqrt((1.0 + x));
double t_5 = t_2 + (t_4 - sqrt(x));
double tmp;
if (t_5 <= 5e-7) {
tmp = 1.0 / (sqrt(x) + t_4);
} else if (t_5 <= 1.999999999999996) {
tmp = t_3 + (t_4 + ((1.0 / (t_1 + sqrt(y))) - sqrt(x)));
} else {
tmp = (1.0 + t_2) + (t_3 + (((1.0 + t) - t) / (sqrt(t) + sqrt((1.0 + t)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = t_1 - sqrt(y)
t_3 = sqrt((1.0d0 + z)) - sqrt(z)
t_4 = sqrt((1.0d0 + x))
t_5 = t_2 + (t_4 - sqrt(x))
if (t_5 <= 5d-7) then
tmp = 1.0d0 / (sqrt(x) + t_4)
else if (t_5 <= 1.999999999999996d0) then
tmp = t_3 + (t_4 + ((1.0d0 / (t_1 + sqrt(y))) - sqrt(x)))
else
tmp = (1.0d0 + t_2) + (t_3 + (((1.0d0 + t) - t) / (sqrt(t) + sqrt((1.0d0 + 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 + y));
double t_2 = t_1 - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + x));
double t_5 = t_2 + (t_4 - Math.sqrt(x));
double tmp;
if (t_5 <= 5e-7) {
tmp = 1.0 / (Math.sqrt(x) + t_4);
} else if (t_5 <= 1.999999999999996) {
tmp = t_3 + (t_4 + ((1.0 / (t_1 + Math.sqrt(y))) - Math.sqrt(x)));
} else {
tmp = (1.0 + t_2) + (t_3 + (((1.0 + t) - t) / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
}
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 = t_1 - math.sqrt(y) t_3 = math.sqrt((1.0 + z)) - math.sqrt(z) t_4 = math.sqrt((1.0 + x)) t_5 = t_2 + (t_4 - math.sqrt(x)) tmp = 0 if t_5 <= 5e-7: tmp = 1.0 / (math.sqrt(x) + t_4) elif t_5 <= 1.999999999999996: tmp = t_3 + (t_4 + ((1.0 / (t_1 + math.sqrt(y))) - math.sqrt(x))) else: tmp = (1.0 + t_2) + (t_3 + (((1.0 + t) - t) / (math.sqrt(t) + math.sqrt((1.0 + t))))) 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 = Float64(t_1 - sqrt(y)) t_3 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_4 = sqrt(Float64(1.0 + x)) t_5 = Float64(t_2 + Float64(t_4 - sqrt(x))) tmp = 0.0 if (t_5 <= 5e-7) tmp = Float64(1.0 / Float64(sqrt(x) + t_4)); elseif (t_5 <= 1.999999999999996) tmp = Float64(t_3 + Float64(t_4 + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) - sqrt(x)))); else tmp = Float64(Float64(1.0 + t_2) + Float64(t_3 + Float64(Float64(Float64(1.0 + t) - t) / Float64(sqrt(t) + sqrt(Float64(1.0 + 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 + y));
t_2 = t_1 - sqrt(y);
t_3 = sqrt((1.0 + z)) - sqrt(z);
t_4 = sqrt((1.0 + x));
t_5 = t_2 + (t_4 - sqrt(x));
tmp = 0.0;
if (t_5 <= 5e-7)
tmp = 1.0 / (sqrt(x) + t_4);
elseif (t_5 <= 1.999999999999996)
tmp = t_3 + (t_4 + ((1.0 / (t_1 + sqrt(y))) - sqrt(x)));
else
tmp = (1.0 + t_2) + (t_3 + (((1.0 + t) - t) / (sqrt(t) + sqrt((1.0 + 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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 + N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 5e-7], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 1.999999999999996], N[(t$95$3 + N[(t$95$4 + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$2), $MachinePrecision] + N[(t$95$3 + N[(N[(N[(1.0 + t), $MachinePrecision] - t), $MachinePrecision] / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := t_1 - \sqrt{y}\\
t_3 := \sqrt{1 + z} - \sqrt{z}\\
t_4 := \sqrt{1 + x}\\
t_5 := t_2 + \left(t_4 - \sqrt{x}\right)\\
\mathbf{if}\;t_5 \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_4}\\
\mathbf{elif}\;t_5 \leq 1.999999999999996:\\
\;\;\;\;t_3 + \left(t_4 + \left(\frac{1}{t_1 + \sqrt{y}} - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + t_2\right) + \left(t_3 + \frac{\left(1 + t\right) - t}{\sqrt{t} + \sqrt{1 + t}}\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) < 4.99999999999999977e-7Initial program 71.7%
associate-+l+71.7%
+-commutative71.7%
associate-+r-71.4%
associate-+l-9.9%
+-commutative9.9%
associate--l+9.9%
+-commutative9.9%
Simplified9.4%
Taylor expanded in t around inf 8.0%
+-commutative8.0%
+-commutative8.0%
associate--l+7.4%
Simplified7.4%
Taylor expanded in z around inf 3.2%
+-commutative3.2%
+-commutative3.2%
associate--l+5.0%
+-commutative5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 3.2%
flip--3.2%
add-sqr-sqrt3.8%
add-sqr-sqrt3.2%
associate-+r-13.2%
+-inverses13.2%
metadata-eval13.2%
+-commutative13.2%
Applied egg-rr13.2%
if 4.99999999999999977e-7 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) < 1.999999999999996Initial program 94.6%
associate-+l+94.6%
associate-+l-61.1%
+-commutative61.1%
sub-neg61.1%
sub-neg61.1%
+-commutative61.1%
+-commutative61.1%
Simplified61.1%
flip--61.3%
add-sqr-sqrt43.0%
add-sqr-sqrt61.4%
Applied egg-rr61.4%
associate--l+61.9%
+-inverses61.9%
metadata-eval61.9%
Simplified61.9%
Taylor expanded in t around inf 39.8%
if 1.999999999999996 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) Initial program 98.2%
associate-+l+98.2%
associate-+l-98.2%
+-commutative98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 98.2%
associate--l+98.2%
Simplified98.2%
flip--98.8%
add-sqr-sqrt79.9%
+-commutative79.9%
add-sqr-sqrt99.0%
+-commutative99.0%
Applied egg-rr99.0%
Final simplification46.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= (- t_1 (sqrt x)) 5e-7)
(/ 1.0 (+ (sqrt x) t_1))
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ t_1 (- (/ 1.0 (+ (sqrt (+ 1.0 y)) (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 + x));
double tmp;
if ((t_1 - sqrt(x)) <= 5e-7) {
tmp = 1.0 / (sqrt(x) + t_1);
} else {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + ((1.0 / (sqrt((1.0 + y)) + 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) :: tmp
t_1 = sqrt((1.0d0 + x))
if ((t_1 - sqrt(x)) <= 5d-7) then
tmp = 1.0d0 / (sqrt(x) + t_1)
else
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (t_1 + ((1.0d0 / (sqrt((1.0d0 + y)) + 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((1.0 + x));
double tmp;
if ((t_1 - Math.sqrt(x)) <= 5e-7) {
tmp = 1.0 / (Math.sqrt(x) + t_1);
} else {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (t_1 + ((1.0 / (Math.sqrt((1.0 + y)) + 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((1.0 + x)) tmp = 0 if (t_1 - math.sqrt(x)) <= 5e-7: tmp = 1.0 / (math.sqrt(x) + t_1) else: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (t_1 + ((1.0 / (math.sqrt((1.0 + y)) + 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(1.0 + x)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 5e-7) tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + 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((1.0 + x));
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 5e-7)
tmp = 1.0 / (sqrt(x) + t_1);
else
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + ((1.0 / (sqrt((1.0 + y)) + 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[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 5e-7], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;t_1 - \sqrt{x} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) < 4.99999999999999977e-7Initial program 83.6%
associate-+l+83.6%
+-commutative83.6%
associate-+r-45.9%
associate-+l-8.5%
+-commutative8.5%
associate--l+8.5%
+-commutative8.5%
Simplified8.0%
Taylor expanded in t around inf 6.7%
+-commutative6.7%
+-commutative6.7%
associate--l+6.0%
Simplified6.0%
Taylor expanded in z around inf 3.5%
+-commutative3.5%
+-commutative3.5%
associate--l+4.4%
+-commutative4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in y around inf 3.2%
flip--3.2%
add-sqr-sqrt3.9%
add-sqr-sqrt3.2%
associate-+r-9.9%
+-inverses9.9%
metadata-eval9.9%
+-commutative9.9%
Applied egg-rr9.9%
if 4.99999999999999977e-7 < (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) Initial program 95.9%
associate-+l+95.9%
associate-+l-95.9%
+-commutative95.9%
sub-neg95.9%
sub-neg95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
flip--96.1%
add-sqr-sqrt76.8%
add-sqr-sqrt96.2%
Applied egg-rr96.2%
associate--l+96.7%
+-inverses96.7%
metadata-eval96.7%
Simplified96.7%
Final simplification54.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(exp
(log
(+
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ 1.0 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) {
return ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + exp(log((((1.0 + (x - x)) / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + exp(log((((1.0d0 + (x - x)) / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + Math.exp(Math.log((((1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + math.exp(math.log((((1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + exp(log(Float64(Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + exp(log((((1.0 + (x - x)) / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Exp[N[Log[N[(N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + e^{\log \left(\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)}
\end{array}
Initial program 89.9%
associate-+l+89.9%
associate-+l-71.7%
+-commutative71.7%
sub-neg71.7%
sub-neg71.7%
+-commutative71.7%
+-commutative71.7%
Simplified71.7%
flip--71.8%
add-sqr-sqrt55.7%
add-sqr-sqrt71.8%
Applied egg-rr71.8%
associate--l+72.1%
+-inverses72.1%
metadata-eval72.1%
Simplified72.1%
add-exp-log72.1%
associate--r-92.1%
Applied egg-rr92.1%
flip--92.1%
add-sqr-sqrt73.5%
add-sqr-sqrt92.3%
Applied egg-rr92.3%
+-commutative92.3%
associate--l+94.2%
+-commutative94.2%
+-commutative94.2%
Simplified94.2%
Final simplification94.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)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (sqrt (+ 1.0 x))))
(if (<= y 1.35e-53)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (+ 1.0 (- t_1 (sqrt y))))
(if (<= y 2.5e+32)
(+ t_2 (+ t_3 (- (/ 1.0 (+ t_1 (sqrt y))) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_3))))))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)) - sqrt(z);
double t_3 = sqrt((1.0 + x));
double tmp;
if (y <= 1.35e-53) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - sqrt(y)));
} else if (y <= 2.5e+32) {
tmp = t_2 + (t_3 + ((1.0 / (t_1 + sqrt(y))) - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_3);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = sqrt((1.0d0 + x))
if (y <= 1.35d-53) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (t_1 - sqrt(y)))
else if (y <= 2.5d+32) then
tmp = t_2 + (t_3 + ((1.0d0 / (t_1 + sqrt(y))) - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_3)
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)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 1.35e-53) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (t_1 - Math.sqrt(y)));
} else if (y <= 2.5e+32) {
tmp = t_2 + (t_3 + ((1.0 / (t_1 + Math.sqrt(y))) - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_3);
}
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)) - math.sqrt(z) t_3 = math.sqrt((1.0 + x)) tmp = 0 if y <= 1.35e-53: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (t_1 - math.sqrt(y))) elif y <= 2.5e+32: tmp = t_2 + (t_3 + ((1.0 / (t_1 + math.sqrt(y))) - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_3) 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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 1.35e-53) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(t_1 - sqrt(y)))); elseif (y <= 2.5e+32) tmp = Float64(t_2 + Float64(t_3 + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_3)); 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)) - sqrt(z);
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 1.35e-53)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - sqrt(y)));
elseif (y <= 2.5e+32)
tmp = t_2 + (t_3 + ((1.0 / (t_1 + sqrt(y))) - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_3);
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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.35e-53], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+32], N[(t$95$2 + N[(t$95$3 + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $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} - \sqrt{z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.35 \cdot 10^{-53}:\\
\;\;\;\;\left(t_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(t_1 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+32}:\\
\;\;\;\;t_2 + \left(t_3 + \left(\frac{1}{t_1 + \sqrt{y}} - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_3}\\
\end{array}
\end{array}
if y < 1.35e-53Initial program 97.5%
associate-+l+97.5%
associate-+l-65.3%
+-commutative65.3%
sub-neg65.3%
sub-neg65.3%
+-commutative65.3%
+-commutative65.3%
Simplified65.3%
Taylor expanded in x around 0 61.2%
associate--l+61.2%
Simplified61.2%
if 1.35e-53 < y < 2.4999999999999999e32Initial program 89.8%
associate-+l+89.8%
associate-+l-56.6%
+-commutative56.6%
sub-neg56.6%
sub-neg56.6%
+-commutative56.6%
+-commutative56.6%
Simplified56.6%
flip--57.3%
add-sqr-sqrt53.7%
add-sqr-sqrt57.8%
Applied egg-rr57.8%
associate--l+59.6%
+-inverses59.6%
metadata-eval59.6%
Simplified59.6%
Taylor expanded in t around inf 36.7%
if 2.4999999999999999e32 < y Initial program 82.8%
associate-+l+82.8%
+-commutative82.8%
associate-+r-82.8%
associate-+l-51.6%
+-commutative51.6%
associate--l+51.6%
+-commutative51.6%
Simplified37.0%
Taylor expanded in t around inf 35.0%
+-commutative35.0%
+-commutative35.0%
associate--l+34.8%
Simplified34.8%
Taylor expanded in z around inf 3.2%
+-commutative3.2%
+-commutative3.2%
associate--l+20.9%
+-commutative20.9%
+-commutative20.9%
Simplified20.9%
Taylor expanded in y around inf 20.0%
flip--20.0%
add-sqr-sqrt20.2%
add-sqr-sqrt20.0%
associate-+r-25.3%
+-inverses25.3%
metadata-eval25.3%
+-commutative25.3%
Applied egg-rr25.3%
Final simplification41.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 y))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1.3e-53)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (+ 1.0 (- t_1 (sqrt y))))
(if (<= y 1.9e+27)
(+ t_2 (+ 1.0 (/ 1.0 (+ t_1 (sqrt y)))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 1.3e-53) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - sqrt(y)));
} else if (y <= 1.9e+27) {
tmp = t_2 + (1.0 + (1.0 / (t_1 + sqrt(y))));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 1.3d-53) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (t_1 - sqrt(y)))
else if (y <= 1.9d+27) then
tmp = t_2 + (1.0d0 + (1.0d0 / (t_1 + sqrt(y))))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 1.3e-53) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (t_1 - Math.sqrt(y)));
} else if (y <= 1.9e+27) {
tmp = t_2 + (1.0 + (1.0 / (t_1 + Math.sqrt(y))));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 1.3e-53: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (t_1 - math.sqrt(y))) elif y <= 1.9e+27: tmp = t_2 + (1.0 + (1.0 / (t_1 + math.sqrt(y)))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 1.3e-53) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(t_1 - sqrt(y)))); elseif (y <= 1.9e+27) tmp = Float64(t_2 + Float64(1.0 + Float64(1.0 / Float64(t_1 + sqrt(y))))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 1.3e-53)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - sqrt(y)));
elseif (y <= 1.9e+27)
tmp = t_2 + (1.0 + (1.0 / (t_1 + sqrt(y))));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.3e-53], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+27], N[(t$95$2 + N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;\left(t_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(t_1 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+27}:\\
\;\;\;\;t_2 + \left(1 + \frac{1}{t_1 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.29999999999999998e-53Initial program 97.5%
associate-+l+97.5%
associate-+l-65.3%
+-commutative65.3%
sub-neg65.3%
sub-neg65.3%
+-commutative65.3%
+-commutative65.3%
Simplified65.3%
Taylor expanded in x around 0 61.2%
associate--l+61.2%
Simplified61.2%
if 1.29999999999999998e-53 < y < 1.90000000000000011e27Initial program 89.1%
associate-+l+89.1%
associate-+l-53.0%
+-commutative53.0%
sub-neg53.0%
sub-neg53.0%
+-commutative53.0%
+-commutative53.0%
Simplified53.0%
Taylor expanded in x around 0 46.4%
associate--l+46.4%
Simplified46.4%
Taylor expanded in t around inf 58.0%
flip--53.7%
add-sqr-sqrt51.8%
add-sqr-sqrt54.3%
Applied egg-rr59.0%
associate--l+56.2%
+-inverses56.2%
metadata-eval56.2%
Simplified62.6%
if 1.90000000000000011e27 < y Initial program 83.2%
associate-+l+83.2%
+-commutative83.2%
associate-+r-83.2%
associate-+l-52.0%
+-commutative52.0%
associate--l+52.0%
+-commutative52.0%
Simplified36.4%
Taylor expanded in t around inf 34.5%
+-commutative34.5%
+-commutative34.5%
associate--l+34.2%
Simplified34.2%
Taylor expanded in z around inf 3.5%
+-commutative3.5%
+-commutative3.5%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 19.8%
flip--19.8%
add-sqr-sqrt20.1%
add-sqr-sqrt19.8%
associate-+r-25.0%
+-inverses25.0%
metadata-eval25.0%
+-commutative25.0%
Applied egg-rr25.0%
Final simplification45.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 6.6e+17)
(+
1.0
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.6e+17) {
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.6d+17) then
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.6e+17) {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.6e+17: tmp = 1.0 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.6e+17) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.6e+17)
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.6e+17], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{+17}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 6.6e17Initial program 95.8%
associate-+l+95.8%
sub-neg95.8%
associate-+l+61.9%
associate-+l+54.9%
+-commutative54.9%
neg-sub054.9%
associate-+l-54.9%
neg-sub054.9%
Simplified30.3%
flip--29.5%
Applied egg-rr41.0%
unpow241.0%
sub-neg41.0%
+-commutative41.0%
sub-neg41.0%
+-commutative41.0%
sub-neg41.0%
Simplified41.0%
Taylor expanded in t around inf 34.6%
associate-+r+34.6%
+-commutative34.6%
+-commutative34.6%
Simplified34.6%
Taylor expanded in x around 0 59.2%
associate--l+59.2%
+-commutative59.2%
+-commutative59.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
if 6.6e17 < y Initial program 83.1%
associate-+l+83.1%
+-commutative83.1%
associate-+r-83.1%
associate-+l-52.0%
+-commutative52.0%
associate--l+52.0%
+-commutative52.0%
Simplified36.3%
Taylor expanded in t around inf 35.0%
+-commutative35.0%
+-commutative35.0%
associate--l+34.7%
Simplified34.7%
Taylor expanded in z around inf 4.7%
+-commutative4.7%
+-commutative4.7%
associate--l+21.6%
+-commutative21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in y around inf 20.7%
flip--20.7%
add-sqr-sqrt20.9%
add-sqr-sqrt20.7%
associate-+r-25.7%
+-inverses25.7%
metadata-eval25.7%
+-commutative25.7%
Applied egg-rr25.7%
Final simplification43.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 5.3e-24)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5.3e-24) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 5.3d-24) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 5.3e-24) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 5.3e-24: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 5.3e-24) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 5.3e-24)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 5.3e-24], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.3 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if x < 5.29999999999999969e-24Initial program 96.1%
associate-+l+96.1%
associate-+l-96.1%
+-commutative96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in x around 0 62.3%
associate--l+96.0%
Simplified96.0%
Taylor expanded in t around inf 62.0%
flip--96.4%
add-sqr-sqrt76.6%
add-sqr-sqrt96.5%
Applied egg-rr62.0%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified62.6%
if 5.29999999999999969e-24 < x Initial program 84.3%
associate-+l+84.3%
+-commutative84.3%
associate-+r-49.7%
associate-+l-15.3%
+-commutative15.3%
associate--l+15.3%
+-commutative15.3%
Simplified11.7%
Taylor expanded in t around inf 9.9%
+-commutative9.9%
+-commutative9.9%
associate--l+9.8%
Simplified9.8%
Taylor expanded in z around inf 4.9%
+-commutative4.9%
+-commutative4.9%
associate--l+6.4%
+-commutative6.4%
+-commutative6.4%
Simplified6.4%
Taylor expanded in y around inf 4.5%
flip--4.5%
add-sqr-sqrt5.1%
add-sqr-sqrt4.5%
associate-+r-10.7%
+-inverses10.7%
metadata-eval10.7%
+-commutative10.7%
Applied egg-rr10.7%
Final simplification35.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 2.1e-23)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 5e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt y) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 2.1e-23) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 5e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 / (sqrt(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 = sqrt((1.0d0 + x))
if (y <= 2.1d-23) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 5d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 / (sqrt(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 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 2.1e-23) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 5e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 2.1e-23: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 5e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 2.1e-23) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 5e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(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 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 2.1e-23)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 5e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 / (sqrt(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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.1e-23], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 2.1 \cdot 10^{-23}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 2.1000000000000001e-23Initial program 97.7%
associate-+l+97.7%
associate-+l-64.2%
+-commutative64.2%
sub-neg64.2%
sub-neg64.2%
+-commutative64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 60.7%
associate--l+60.7%
Simplified60.7%
Taylor expanded in t around inf 59.6%
Taylor expanded in y around 0 33.6%
associate--l+59.5%
Simplified59.5%
if 2.1000000000000001e-23 < y < 5e15Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-49.1%
associate-+l-34.8%
+-commutative34.8%
associate--l+34.8%
+-commutative34.8%
Simplified28.4%
Taylor expanded in t around inf 26.4%
+-commutative26.4%
+-commutative26.4%
associate--l+28.2%
Simplified28.2%
Taylor expanded in z around inf 12.3%
+-commutative12.3%
+-commutative12.3%
associate--l+12.4%
+-commutative12.4%
+-commutative12.4%
Simplified12.4%
if 5e15 < y Initial program 82.8%
associate-+l+82.8%
+-commutative82.8%
associate-+r-82.8%
associate-+l-51.7%
+-commutative51.7%
associate--l+51.7%
+-commutative51.7%
Simplified36.2%
Taylor expanded in t around inf 35.0%
+-commutative35.0%
+-commutative35.0%
associate--l+34.7%
Simplified34.7%
Taylor expanded in z around inf 5.2%
+-commutative5.2%
+-commutative5.2%
associate--l+21.8%
+-commutative21.8%
+-commutative21.8%
Simplified21.8%
Taylor expanded in y around inf 20.9%
flip--20.9%
add-sqr-sqrt21.2%
add-sqr-sqrt20.9%
associate-+r-25.9%
+-inverses25.9%
metadata-eval25.9%
+-commutative25.9%
Applied egg-rr25.9%
Final simplification39.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 4.9e-24)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 4e+16)
(+ (sqrt (+ 1.0 y)) (- t_1 (+ (sqrt y) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 4.9e-24) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 4e+16) {
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 / (sqrt(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 = sqrt((1.0d0 + x))
if (y <= 4.9d-24) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 4d+16) then
tmp = sqrt((1.0d0 + y)) + (t_1 - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 / (sqrt(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 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.9e-24) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 4e+16) {
tmp = Math.sqrt((1.0 + y)) + (t_1 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.9e-24: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 4e+16: tmp = math.sqrt((1.0 + y)) + (t_1 - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.9e-24) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 4e+16) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(t_1 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(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 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 4.9e-24)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 4e+16)
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 / (sqrt(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[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.9e-24], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4e+16], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.9 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+16}:\\
\;\;\;\;\sqrt{1 + y} + \left(t_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 4.9000000000000001e-24Initial program 97.7%
associate-+l+97.7%
associate-+l-64.2%
+-commutative64.2%
sub-neg64.2%
sub-neg64.2%
+-commutative64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 60.7%
associate--l+60.7%
Simplified60.7%
Taylor expanded in t around inf 59.6%
Taylor expanded in y around 0 33.6%
associate--l+59.5%
Simplified59.5%
if 4.9000000000000001e-24 < y < 4e16Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-49.1%
associate-+l-34.8%
+-commutative34.8%
associate--l+34.8%
+-commutative34.8%
Simplified28.4%
Taylor expanded in t around inf 26.4%
+-commutative26.4%
+-commutative26.4%
associate--l+28.2%
Simplified28.2%
flip-+28.2%
add-sqr-sqrt28.8%
+-commutative28.8%
+-commutative28.8%
+-commutative28.8%
Applied egg-rr28.8%
Taylor expanded in z around 0 28.8%
Taylor expanded in z around inf 12.3%
associate--l+22.1%
+-commutative22.1%
Simplified22.1%
if 4e16 < y Initial program 82.8%
associate-+l+82.8%
+-commutative82.8%
associate-+r-82.8%
associate-+l-51.7%
+-commutative51.7%
associate--l+51.7%
+-commutative51.7%
Simplified36.2%
Taylor expanded in t around inf 35.0%
+-commutative35.0%
+-commutative35.0%
associate--l+34.7%
Simplified34.7%
Taylor expanded in z around inf 5.2%
+-commutative5.2%
+-commutative5.2%
associate--l+21.8%
+-commutative21.8%
+-commutative21.8%
Simplified21.8%
Taylor expanded in y around inf 20.9%
flip--20.9%
add-sqr-sqrt21.2%
add-sqr-sqrt20.9%
associate-+r-25.9%
+-inverses25.9%
metadata-eval25.9%
+-commutative25.9%
Applied egg-rr25.9%
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 6.6e+17) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.6e+17) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (sqrt((1.0 + y)) - sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.6d+17) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.6e+17) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.6e+17: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.6e+17) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.6e+17)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (sqrt((1.0 + y)) - sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.6e+17], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{+17}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 6.6e17Initial program 95.8%
associate-+l+95.8%
associate-+l-61.9%
+-commutative61.9%
sub-neg61.9%
sub-neg61.9%
+-commutative61.9%
+-commutative61.9%
Simplified61.9%
Taylor expanded in x around 0 57.5%
associate--l+57.5%
Simplified57.5%
Taylor expanded in t around inf 58.9%
if 6.6e17 < y Initial program 83.1%
associate-+l+83.1%
+-commutative83.1%
associate-+r-83.1%
associate-+l-52.0%
+-commutative52.0%
associate--l+52.0%
+-commutative52.0%
Simplified36.3%
Taylor expanded in t around inf 35.0%
+-commutative35.0%
+-commutative35.0%
associate--l+34.7%
Simplified34.7%
Taylor expanded in z around inf 4.7%
+-commutative4.7%
+-commutative4.7%
associate--l+21.6%
+-commutative21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in y around inf 20.7%
flip--20.7%
add-sqr-sqrt20.9%
add-sqr-sqrt20.7%
associate-+r-25.7%
+-inverses25.7%
metadata-eval25.7%
+-commutative25.7%
Applied egg-rr25.7%
Final simplification43.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 4.3e-23)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 4.5e+15)
(+ (- (sqrt (+ 1.0 y)) (+ (sqrt y) (sqrt x))) (+ 1.0 (* x 0.5)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.3e-23) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x))) + (1.0 + (x * 0.5));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.3d-23) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 4.5d+15) then
tmp = (sqrt((1.0d0 + y)) - (sqrt(y) + sqrt(x))) + (1.0d0 + (x * 0.5d0))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.3e-23) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = (Math.sqrt((1.0 + y)) - (Math.sqrt(y) + Math.sqrt(x))) + (1.0 + (x * 0.5));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.3e-23: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 4.5e+15: tmp = (math.sqrt((1.0 + y)) - (math.sqrt(y) + math.sqrt(x))) + (1.0 + (x * 0.5)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.3e-23) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 4.5e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(y) + sqrt(x))) + Float64(1.0 + Float64(x * 0.5))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.3e-23)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 4.5e+15)
tmp = (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x))) + (1.0 + (x * 0.5));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.3e-23], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{-23}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + y} - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(1 + x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 4.30000000000000002e-23Initial program 97.7%
associate-+l+97.7%
associate-+l-64.2%
+-commutative64.2%
sub-neg64.2%
sub-neg64.2%
+-commutative64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 60.7%
associate--l+60.7%
Simplified60.7%
Taylor expanded in t around inf 59.6%
Taylor expanded in y around 0 33.6%
associate--l+59.5%
Simplified59.5%
if 4.30000000000000002e-23 < y < 4.5e15Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-49.1%
associate-+l-34.8%
+-commutative34.8%
associate--l+34.8%
+-commutative34.8%
Simplified28.4%
Taylor expanded in t around inf 26.4%
+-commutative26.4%
+-commutative26.4%
associate--l+28.2%
Simplified28.2%
Taylor expanded in z around inf 12.3%
+-commutative12.3%
+-commutative12.3%
associate--l+12.4%
+-commutative12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 13.9%
if 4.5e15 < y Initial program 82.8%
associate-+l+82.8%
+-commutative82.8%
associate-+r-82.8%
associate-+l-51.7%
+-commutative51.7%
associate--l+51.7%
+-commutative51.7%
Simplified36.2%
Taylor expanded in t around inf 35.0%
+-commutative35.0%
+-commutative35.0%
associate--l+34.7%
Simplified34.7%
Taylor expanded in z around inf 5.2%
+-commutative5.2%
+-commutative5.2%
associate--l+21.8%
+-commutative21.8%
+-commutative21.8%
Simplified21.8%
Taylor expanded in y around inf 20.9%
flip--20.9%
add-sqr-sqrt21.2%
add-sqr-sqrt20.9%
associate-+r-25.9%
+-inverses25.9%
metadata-eval25.9%
+-commutative25.9%
Applied egg-rr25.9%
Final simplification40.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 9.5e-38)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 28000000000000.0)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 9.5e-38) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 28000000000000.0) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 9.5d-38) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 28000000000000.0d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 9.5e-38) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 28000000000000.0) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 9.5e-38: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 28000000000000.0: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 9.5e-38) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 28000000000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 9.5e-38)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 28000000000000.0)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 9.5e-38], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 28000000000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9.5 \cdot 10^{-38}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 28000000000000:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 9.5000000000000009e-38Initial program 97.3%
associate-+l+97.3%
associate-+l-80.4%
+-commutative80.4%
sub-neg80.4%
sub-neg80.4%
+-commutative80.4%
+-commutative80.4%
Simplified80.4%
Taylor expanded in x around 0 60.6%
associate--l+58.8%
Simplified58.8%
Taylor expanded in z around 0 58.6%
Taylor expanded in y around 0 23.6%
associate--l+40.7%
Simplified40.7%
if 9.5000000000000009e-38 < z < 2.8e13Initial program 91.7%
associate-+l+91.7%
associate-+l-71.1%
+-commutative71.1%
sub-neg71.1%
sub-neg71.1%
+-commutative71.1%
+-commutative71.1%
Simplified71.1%
Taylor expanded in x around 0 51.2%
associate--l+48.4%
Simplified48.4%
Taylor expanded in t around inf 53.0%
Taylor expanded in y around 0 43.4%
associate--l+43.5%
Simplified43.5%
if 2.8e13 < z Initial program 82.4%
associate-+l+82.4%
+-commutative82.4%
associate-+r-63.2%
associate-+l-51.6%
+-commutative51.6%
associate--l+51.6%
+-commutative51.6%
Simplified22.5%
Taylor expanded in t around inf 32.7%
+-commutative32.7%
+-commutative32.7%
associate--l+32.5%
Simplified32.5%
Taylor expanded in z around inf 21.2%
+-commutative21.2%
+-commutative21.2%
associate--l+32.8%
+-commutative32.8%
+-commutative32.8%
Simplified32.8%
Taylor expanded in x around 0 36.2%
associate-+r-55.2%
Simplified55.2%
Final simplification47.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 9.5e-22)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 4e+15)
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e-22) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 4e+15) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 9.5d-22) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 4d+15) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9.5e-22) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 4e+15) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 9.5e-22: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 4e+15: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 9.5e-22) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 4e+15) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 9.5e-22)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 4e+15)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 9.5e-22], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4e+15], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{-22}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 9.4999999999999994e-22Initial program 97.7%
associate-+l+97.7%
associate-+l-64.2%
+-commutative64.2%
sub-neg64.2%
sub-neg64.2%
+-commutative64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in x around 0 60.7%
associate--l+60.7%
Simplified60.7%
Taylor expanded in t around inf 59.6%
Taylor expanded in y around 0 33.6%
associate--l+59.5%
Simplified59.5%
if 9.4999999999999994e-22 < y < 4e15Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-49.1%
associate-+l-34.8%
+-commutative34.8%
associate--l+34.8%
+-commutative34.8%
Simplified28.4%
Taylor expanded in t around inf 26.4%
+-commutative26.4%
+-commutative26.4%
associate--l+28.2%
Simplified28.2%
Taylor expanded in z around inf 12.3%
+-commutative12.3%
+-commutative12.3%
associate--l+12.4%
+-commutative12.4%
+-commutative12.4%
Simplified12.4%
Taylor expanded in x around 0 43.2%
if 4e15 < y Initial program 82.8%
associate-+l+82.8%
+-commutative82.8%
associate-+r-82.8%
associate-+l-51.7%
+-commutative51.7%
associate--l+51.7%
+-commutative51.7%
Simplified36.2%
Taylor expanded in t around inf 35.0%
+-commutative35.0%
+-commutative35.0%
associate--l+34.7%
Simplified34.7%
Taylor expanded in z around inf 5.2%
+-commutative5.2%
+-commutative5.2%
associate--l+21.8%
+-commutative21.8%
+-commutative21.8%
Simplified21.8%
Taylor expanded in y around inf 20.9%
flip--20.9%
add-sqr-sqrt21.2%
add-sqr-sqrt20.9%
associate-+r-25.9%
+-inverses25.9%
metadata-eval25.9%
+-commutative25.9%
Applied egg-rr25.9%
Final simplification42.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x)))) (if (<= y 0.56) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 0.56) {
tmp = 1.0 + t_1;
} else {
tmp = 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 + x)) - sqrt(x)
if (y <= 0.56d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 0.56) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 0.56: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 0.56) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 0.56)
tmp = 1.0 + t_1;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.56], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 0.56:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 0.56000000000000005Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-63.5%
associate-+l-58.4%
+-commutative58.4%
associate--l+58.4%
+-commutative58.4%
Simplified42.9%
Taylor expanded in t around inf 36.3%
+-commutative36.3%
+-commutative36.3%
associate--l+36.5%
Simplified36.5%
Taylor expanded in z around inf 24.0%
+-commutative24.0%
+-commutative24.0%
associate--l+24.0%
+-commutative24.0%
+-commutative24.0%
Simplified24.0%
Taylor expanded in y around 0 23.5%
associate--l+36.1%
Simplified36.1%
if 0.56000000000000005 < y Initial program 82.9%
associate-+l+82.9%
+-commutative82.9%
associate-+r-79.2%
associate-+l-49.0%
+-commutative49.0%
associate--l+49.0%
+-commutative49.0%
Simplified34.7%
Taylor expanded in t around inf 32.9%
+-commutative32.9%
+-commutative32.9%
associate--l+32.6%
Simplified32.6%
Taylor expanded in z around inf 5.4%
+-commutative5.4%
+-commutative5.4%
associate--l+20.3%
+-commutative20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in y around inf 19.5%
Final simplification27.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 (<= z 8000000000000.0) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 8000000000000.0) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 8000000000000.0d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 8000000000000.0) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 8000000000000.0: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 8000000000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 8000000000000.0)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 8000000000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8000000000000:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 8e12Initial program 96.6%
associate-+l+96.6%
associate-+l-79.0%
+-commutative79.0%
sub-neg79.0%
sub-neg79.0%
+-commutative79.0%
+-commutative79.0%
Simplified79.0%
Taylor expanded in x around 0 59.5%
associate--l+57.0%
Simplified57.0%
Taylor expanded in t around inf 55.2%
Taylor expanded in y around 0 43.9%
associate--l+43.9%
Simplified43.9%
if 8e12 < z Initial program 82.3%
associate-+l+82.3%
+-commutative82.3%
associate-+r-63.3%
associate-+l-51.8%
+-commutative51.8%
associate--l+51.8%
+-commutative51.8%
Simplified22.4%
Taylor expanded in t around inf 33.0%
+-commutative33.0%
+-commutative33.0%
associate--l+32.9%
Simplified32.9%
Taylor expanded in z around inf 21.0%
+-commutative21.0%
+-commutative21.0%
associate--l+33.0%
+-commutative33.0%
+-commutative33.0%
Simplified33.0%
Taylor expanded in x around 0 35.9%
associate-+r-55.2%
Simplified55.2%
Final simplification49.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\end{array}
Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-71.7%
associate-+l-53.5%
+-commutative53.5%
associate--l+53.5%
+-commutative53.5%
Simplified38.6%
Taylor expanded in t around inf 34.6%
+-commutative34.6%
+-commutative34.6%
associate--l+34.5%
Simplified34.5%
Taylor expanded in z around inf 14.3%
+-commutative14.3%
+-commutative14.3%
associate--l+22.1%
+-commutative22.1%
+-commutative22.1%
Simplified22.1%
Taylor expanded in x around 0 27.6%
associate-+r-46.5%
Simplified46.5%
Final simplification46.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ 1.0 x)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((1.0 + x)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((1.0d0 + x)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((1.0 + x)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((1.0 + x)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{1 + x} - \sqrt{x}
\end{array}
Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-71.7%
associate-+l-53.5%
+-commutative53.5%
associate--l+53.5%
+-commutative53.5%
Simplified38.6%
Taylor expanded in t around inf 34.6%
+-commutative34.6%
+-commutative34.6%
associate--l+34.5%
Simplified34.5%
Taylor expanded in z around inf 14.3%
+-commutative14.3%
+-commutative14.3%
associate--l+22.1%
+-commutative22.1%
+-commutative22.1%
Simplified22.1%
Taylor expanded in y around inf 15.6%
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 (- (+ 1.0 (* x 0.5)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - 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 + (x * 0.5d0)) - 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 + (x * 0.5)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (x * 0.5)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (x * 0.5)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(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])\\
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-71.7%
associate-+l-53.5%
+-commutative53.5%
associate--l+53.5%
+-commutative53.5%
Simplified38.6%
Taylor expanded in t around inf 34.6%
+-commutative34.6%
+-commutative34.6%
associate--l+34.5%
Simplified34.5%
Taylor expanded in z around inf 14.3%
+-commutative14.3%
+-commutative14.3%
associate--l+22.1%
+-commutative22.1%
+-commutative22.1%
Simplified22.1%
Taylor expanded in y around inf 15.6%
Taylor expanded in x around 0 16.5%
Final simplification16.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
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
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-71.7%
associate-+l-53.5%
+-commutative53.5%
associate--l+53.5%
+-commutative53.5%
Simplified38.6%
Taylor expanded in t around inf 34.6%
+-commutative34.6%
+-commutative34.6%
associate--l+34.5%
Simplified34.5%
Taylor expanded in z around inf 14.3%
+-commutative14.3%
+-commutative14.3%
associate--l+22.1%
+-commutative22.1%
+-commutative22.1%
Simplified22.1%
Taylor expanded in y around inf 15.6%
Taylor expanded in x around 0 35.1%
Final simplification35.1%
(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 2023182
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))