
(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 18 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 t)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (sqrt (+ 1.0 z))))
(if (<= z 2.35e+29)
(+
(- t_3 (sqrt x))
(+
(- t_1 (sqrt y))
(+ (/ 1.0 (+ t_2 (sqrt t))) (/ 1.0 (+ t_4 (sqrt z))))))
(+
(/ 1.0 (+ t_3 (sqrt x)))
(+ (/ 1.0 (+ t_1 (sqrt y))) (+ (- t_4 (sqrt z)) (- t_2 (sqrt t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + t));
double t_3 = sqrt((1.0 + x));
double t_4 = sqrt((1.0 + z));
double tmp;
if (z <= 2.35e+29) {
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (t_2 + sqrt(t))) + (1.0 / (t_4 + sqrt(z)))));
} else {
tmp = (1.0 / (t_3 + sqrt(x))) + ((1.0 / (t_1 + sqrt(y))) + ((t_4 - sqrt(z)) + (t_2 - sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + t))
t_3 = sqrt((1.0d0 + x))
t_4 = sqrt((1.0d0 + z))
if (z <= 2.35d+29) then
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0d0 / (t_2 + sqrt(t))) + (1.0d0 / (t_4 + sqrt(z)))))
else
tmp = (1.0d0 / (t_3 + sqrt(x))) + ((1.0d0 / (t_1 + sqrt(y))) + ((t_4 - sqrt(z)) + (t_2 - sqrt(t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + t));
double t_3 = Math.sqrt((1.0 + x));
double t_4 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 2.35e+29) {
tmp = (t_3 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((1.0 / (t_2 + Math.sqrt(t))) + (1.0 / (t_4 + Math.sqrt(z)))));
} else {
tmp = (1.0 / (t_3 + Math.sqrt(x))) + ((1.0 / (t_1 + Math.sqrt(y))) + ((t_4 - Math.sqrt(z)) + (t_2 - Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + t)) t_3 = math.sqrt((1.0 + x)) t_4 = math.sqrt((1.0 + z)) tmp = 0 if z <= 2.35e+29: tmp = (t_3 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((1.0 / (t_2 + math.sqrt(t))) + (1.0 / (t_4 + math.sqrt(z))))) else: tmp = (1.0 / (t_3 + math.sqrt(x))) + ((1.0 / (t_1 + math.sqrt(y))) + ((t_4 - math.sqrt(z)) + (t_2 - math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + t)) t_3 = sqrt(Float64(1.0 + x)) t_4 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 2.35e+29) tmp = Float64(Float64(t_3 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(1.0 / Float64(t_2 + sqrt(t))) + Float64(1.0 / Float64(t_4 + sqrt(z)))))); else tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(x))) + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + Float64(Float64(t_4 - sqrt(z)) + Float64(t_2 - sqrt(t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + t));
t_3 = sqrt((1.0 + x));
t_4 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 2.35e+29)
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (t_2 + sqrt(t))) + (1.0 / (t_4 + sqrt(z)))));
else
tmp = (1.0 / (t_3 + sqrt(x))) + ((1.0 / (t_1 + sqrt(y))) + ((t_4 - sqrt(z)) + (t_2 - sqrt(t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.35e+29], N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + t}\\
t_3 := \sqrt{1 + x}\\
t_4 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 2.35 \cdot 10^{+29}:\\
\;\;\;\;\left(t\_3 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(\frac{1}{t\_2 + \sqrt{t}} + \frac{1}{t\_4 + \sqrt{z}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_3 + \sqrt{x}} + \left(\frac{1}{t\_1 + \sqrt{y}} + \left(\left(t\_4 - \sqrt{z}\right) + \left(t\_2 - \sqrt{t}\right)\right)\right)\\
\end{array}
\end{array}
if z < 2.3500000000000001e29Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
Simplified95.3%
add-sqr-sqrt93.3%
fma-neg92.5%
pow1/292.5%
sqrt-pow192.7%
metadata-eval92.7%
pow1/292.7%
sqrt-pow192.5%
metadata-eval92.5%
Applied egg-rr92.5%
fma-undefine93.3%
pow-prod-up95.3%
metadata-eval95.3%
pow1/295.3%
sub-neg95.3%
flip--95.5%
add-sqr-sqrt93.5%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
Simplified96.6%
flip--96.8%
div-inv96.8%
add-sqr-sqrt72.6%
add-sqr-sqrt96.9%
associate--l+97.5%
Applied egg-rr97.5%
+-inverses97.5%
metadata-eval97.5%
*-lft-identity97.5%
Simplified97.5%
if 2.3500000000000001e29 < z Initial program 87.3%
associate-+l+87.3%
associate-+l+87.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
Simplified87.3%
flip--87.2%
div-inv87.2%
add-sqr-sqrt75.4%
+-commutative75.4%
add-sqr-sqrt87.9%
associate--l+90.5%
+-commutative90.5%
Applied egg-rr90.5%
+-inverses90.5%
metadata-eval90.5%
*-lft-identity90.5%
Simplified90.5%
flip--90.4%
div-inv90.4%
add-sqr-sqrt71.1%
add-sqr-sqrt90.4%
associate--l+92.2%
Applied egg-rr92.2%
+-inverses92.2%
metadata-eval92.2%
*-lft-identity92.2%
Simplified92.2%
Final simplification95.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt (+ 1.0 x)) (sqrt x))))
(+
(+
(/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(/ (cbrt (pow t_1 -2.0)) (cbrt 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);
return ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))))) + (cbrt(pow(t_1, -2.0)) / cbrt(t_1));
}
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);
return ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))))) + (Math.cbrt(Math.pow(t_1, -2.0)) / Math.cbrt(t_1));
}
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)) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))) + Float64(cbrt((t_1 ^ -2.0)) / cbrt(t_1))) 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]}, N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision] + N[(N[Power[N[Power[t$95$1, -2.0], $MachinePrecision], 1/3], $MachinePrecision] / N[Power[t$95$1, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} + \sqrt{x}\\
\left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right) + \frac{\sqrt[3]{{t\_1}^{-2}}}{\sqrt[3]{t\_1}}
\end{array}
\end{array}
Initial program 91.7%
associate-+l+91.7%
associate-+l+91.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
Simplified91.7%
flip--91.9%
div-inv91.9%
add-sqr-sqrt76.0%
+-commutative76.0%
add-sqr-sqrt92.4%
associate--l+93.9%
+-commutative93.9%
Applied egg-rr93.9%
+-inverses93.9%
metadata-eval93.9%
*-lft-identity93.9%
Simplified93.9%
flip--93.9%
div-inv93.9%
add-sqr-sqrt77.2%
add-sqr-sqrt94.1%
associate--l+95.1%
Applied egg-rr95.1%
+-inverses95.1%
metadata-eval95.1%
*-lft-identity95.1%
Simplified95.1%
add-cube-cbrt95.1%
fma-define95.1%
Applied egg-rr95.1%
fma-undefine95.1%
+-commutative95.1%
Simplified95.2%
flip--93.7%
div-inv93.7%
add-sqr-sqrt72.5%
add-sqr-sqrt94.3%
associate--l+95.5%
Applied egg-rr97.3%
+-inverses95.5%
metadata-eval95.5%
*-lft-identity95.5%
Simplified97.3%
Final simplification97.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 y))) (t_2 (sqrt (+ 1.0 x))) (t_3 (sqrt (+ 1.0 z))))
(if (<= z 2.35e+29)
(+
(- t_2 (sqrt x))
(+
(- t_1 (sqrt y))
(+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) (/ 1.0 (+ t_3 (sqrt z))))))
(+
(/ 1.0 (+ t_2 (sqrt x)))
(+ (- t_3 (sqrt z)) (/ 1.0 (+ t_1 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + z));
double tmp;
if (z <= 2.35e+29) {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 / (t_3 + sqrt(z)))));
} else {
tmp = (1.0 / (t_2 + sqrt(x))) + ((t_3 - sqrt(z)) + (1.0 / (t_1 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + z))
if (z <= 2.35d+29) then
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (1.0d0 / (t_3 + sqrt(z)))))
else
tmp = (1.0d0 / (t_2 + sqrt(x))) + ((t_3 - sqrt(z)) + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 2.35e+29) {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (1.0 / (t_3 + Math.sqrt(z)))));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + ((t_3 - Math.sqrt(z)) + (1.0 / (t_1 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if z <= 2.35e+29: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (1.0 / (t_3 + math.sqrt(z))))) else: tmp = (1.0 / (t_2 + math.sqrt(x))) + ((t_3 - math.sqrt(z)) + (1.0 / (t_1 + math.sqrt(y)))) 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 + x)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 2.35e+29) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(1.0 / Float64(t_3 + sqrt(z)))))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(Float64(t_3 - sqrt(z)) + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 2.35e+29)
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 / (t_3 + sqrt(z)))));
else
tmp = (1.0 / (t_2 + sqrt(x))) + ((t_3 - sqrt(z)) + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.35e+29], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $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 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 2.35 \cdot 10^{+29}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \frac{1}{t\_3 + \sqrt{z}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_2 + \sqrt{x}} + \left(\left(t\_3 - \sqrt{z}\right) + \frac{1}{t\_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if z < 2.3500000000000001e29Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
Simplified95.3%
add-sqr-sqrt93.3%
fma-neg92.5%
pow1/292.5%
sqrt-pow192.7%
metadata-eval92.7%
pow1/292.7%
sqrt-pow192.5%
metadata-eval92.5%
Applied egg-rr92.5%
fma-undefine93.3%
pow-prod-up95.3%
metadata-eval95.3%
pow1/295.3%
sub-neg95.3%
flip--95.5%
add-sqr-sqrt93.5%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
Simplified96.6%
flip--96.8%
div-inv96.8%
add-sqr-sqrt72.6%
add-sqr-sqrt96.9%
associate--l+97.5%
Applied egg-rr97.5%
+-inverses97.5%
metadata-eval97.5%
*-lft-identity97.5%
Simplified97.5%
if 2.3500000000000001e29 < z Initial program 87.3%
associate-+l+87.3%
associate-+l+87.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
Simplified87.3%
flip--87.2%
div-inv87.2%
add-sqr-sqrt75.4%
+-commutative75.4%
add-sqr-sqrt87.9%
associate--l+90.5%
+-commutative90.5%
Applied egg-rr90.5%
+-inverses90.5%
metadata-eval90.5%
*-lft-identity90.5%
Simplified90.5%
flip--90.4%
div-inv90.4%
add-sqr-sqrt71.1%
add-sqr-sqrt90.4%
associate--l+92.2%
Applied egg-rr92.2%
+-inverses92.2%
metadata-eval92.2%
*-lft-identity92.2%
Simplified92.2%
Taylor expanded in t around inf 46.9%
Final simplification75.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (sqrt (+ 1.0 x))))
(if (<= (- t_2 (sqrt y)) 1.0)
(+ (/ 1.0 (+ t_3 (sqrt x))) (+ t_1 (/ 1.0 (+ t_2 (sqrt y)))))
(+
(- t_3 (sqrt x))
(+ 1.0 (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) 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 t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + x));
double tmp;
if ((t_2 - sqrt(y)) <= 1.0) {
tmp = (1.0 / (t_3 + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(y))));
} else {
tmp = (t_3 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_1));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + x))
if ((t_2 - sqrt(y)) <= 1.0d0) then
tmp = (1.0d0 / (t_3 + sqrt(x))) + (t_1 + (1.0d0 / (t_2 + sqrt(y))))
else
tmp = (t_3 - sqrt(x)) + (1.0d0 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + 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 t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if ((t_2 - Math.sqrt(y)) <= 1.0) {
tmp = (1.0 / (t_3 + Math.sqrt(x))) + (t_1 + (1.0 / (t_2 + Math.sqrt(y))));
} else {
tmp = (t_3 - Math.sqrt(x)) + (1.0 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + 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) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if (t_2 - math.sqrt(y)) <= 1.0: tmp = (1.0 / (t_3 + math.sqrt(x))) + (t_1 + (1.0 / (t_2 + math.sqrt(y)))) else: tmp = (t_3 - math.sqrt(x)) + (1.0 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + 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)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_2 - sqrt(y)) <= 1.0) tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(x))) + Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(y))))); else tmp = Float64(Float64(t_3 - sqrt(x)) + Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + 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);
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if ((t_2 - sqrt(y)) <= 1.0)
tmp = (1.0 / (t_3 + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(y))));
else
tmp = (t_3 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + 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]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 1.0], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;t\_2 - \sqrt{y} \leq 1:\\
\;\;\;\;\frac{1}{t\_3 + \sqrt{x}} + \left(t\_1 + \frac{1}{t\_2 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 - \sqrt{x}\right) + \left(1 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t\_1\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 1Initial program 91.7%
associate-+l+91.7%
associate-+l+91.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
Simplified91.7%
flip--91.9%
div-inv91.9%
add-sqr-sqrt76.0%
+-commutative76.0%
add-sqr-sqrt92.4%
associate--l+93.9%
+-commutative93.9%
Applied egg-rr93.9%
+-inverses93.9%
metadata-eval93.9%
*-lft-identity93.9%
Simplified93.9%
flip--93.9%
div-inv93.9%
add-sqr-sqrt77.2%
add-sqr-sqrt94.1%
associate--l+95.1%
Applied egg-rr95.1%
+-inverses95.1%
metadata-eval95.1%
*-lft-identity95.1%
Simplified95.1%
Taylor expanded in t around inf 54.6%
if 1 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 91.7%
associate-+l+91.7%
associate-+l+91.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
Simplified91.7%
flip--93.9%
div-inv93.9%
add-sqr-sqrt77.2%
add-sqr-sqrt94.1%
associate--l+95.1%
Applied egg-rr93.1%
+-inverses95.1%
metadata-eval95.1%
*-lft-identity95.1%
Simplified93.1%
Taylor expanded in y around 0 59.8%
flip--93.7%
div-inv93.7%
add-sqr-sqrt72.5%
add-sqr-sqrt94.3%
associate--l+95.5%
Applied egg-rr60.4%
+-inverses95.5%
metadata-eval95.5%
*-lft-identity95.5%
Simplified60.4%
Final simplification54.6%
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 x)))
(t_3 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= z 2.3e+29)
(+
(- t_2 (sqrt x))
(+ (- t_1 (sqrt y)) (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) t_3)))
(+ (/ 1.0 (+ t_2 (sqrt x))) (+ t_3 (/ 1.0 (+ t_1 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (z <= 2.3e+29) {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3));
} else {
tmp = (1.0 / (t_2 + sqrt(x))) + (t_3 + (1.0 / (t_1 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + z)) - sqrt(z)
if (z <= 2.3d+29) then
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + t_3))
else
tmp = (1.0d0 / (t_2 + sqrt(x))) + (t_3 + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (z <= 2.3e+29) {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_3));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + (t_3 + (1.0 / (t_1 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if z <= 2.3e+29: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_3)) else: tmp = (1.0 / (t_2 + math.sqrt(x))) + (t_3 + (1.0 / (t_1 + math.sqrt(y)))) 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 + x)) t_3 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (z <= 2.3e+29) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_3))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(t_3 + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (z <= 2.3e+29)
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3));
else
tmp = (1.0 / (t_2 + sqrt(x))) + (t_3 + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.3e+29], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $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 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;z \leq 2.3 \cdot 10^{+29}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t\_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_2 + \sqrt{x}} + \left(t\_3 + \frac{1}{t\_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if z < 2.3000000000000001e29Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
Simplified95.3%
flip--96.8%
div-inv96.8%
add-sqr-sqrt72.6%
add-sqr-sqrt96.9%
associate--l+97.5%
Applied egg-rr96.1%
+-inverses97.5%
metadata-eval97.5%
*-lft-identity97.5%
Simplified96.1%
if 2.3000000000000001e29 < z Initial program 87.3%
associate-+l+87.3%
associate-+l+87.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
Simplified87.3%
flip--87.2%
div-inv87.2%
add-sqr-sqrt75.4%
+-commutative75.4%
add-sqr-sqrt87.9%
associate--l+90.5%
+-commutative90.5%
Applied egg-rr90.5%
+-inverses90.5%
metadata-eval90.5%
*-lft-identity90.5%
Simplified90.5%
flip--90.4%
div-inv90.4%
add-sqr-sqrt71.1%
add-sqr-sqrt90.4%
associate--l+92.2%
Applied egg-rr92.2%
+-inverses92.2%
metadata-eval92.2%
*-lft-identity92.2%
Simplified92.2%
Taylor expanded in t around inf 46.9%
Final simplification74.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))) (t_3 (sqrt (+ 1.0 x))))
(if (<= z 2.35e+29)
(+
(- t_3 (sqrt x))
(+
(- t_1 (sqrt y))
(+ (/ 1.0 (+ t_2 (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))))
(+
(/ 1.0 (+ t_3 (sqrt x)))
(+ (- t_2 (sqrt z)) (/ 1.0 (+ t_1 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + x));
double tmp;
if (z <= 2.35e+29) {
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))));
} else {
tmp = (1.0 / (t_3 + sqrt(x))) + ((t_2 - sqrt(z)) + (1.0 / (t_1 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + x))
if (z <= 2.35d+29) then
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0d0 / (t_2 + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t))))
else
tmp = (1.0d0 / (t_3 + sqrt(x))) + ((t_2 - sqrt(z)) + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 2.35e+29) {
tmp = (t_3 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((1.0 / (t_2 + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else {
tmp = (1.0 / (t_3 + Math.sqrt(x))) + ((t_2 - Math.sqrt(z)) + (1.0 / (t_1 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + x)) tmp = 0 if z <= 2.35e+29: tmp = (t_3 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((1.0 / (t_2 + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))) else: tmp = (1.0 / (t_3 + math.sqrt(x))) + ((t_2 - math.sqrt(z)) + (1.0 / (t_1 + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 2.35e+29) tmp = Float64(Float64(t_3 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(x))) + Float64(Float64(t_2 - sqrt(z)) + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 2.35e+29)
tmp = (t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))));
else
tmp = (1.0 / (t_3 + sqrt(x))) + ((t_2 - sqrt(z)) + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.35e+29], N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $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 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 2.35 \cdot 10^{+29}:\\
\;\;\;\;\left(t\_3 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(\frac{1}{t\_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_3 + \sqrt{x}} + \left(\left(t\_2 - \sqrt{z}\right) + \frac{1}{t\_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if z < 2.3500000000000001e29Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
add095.3%
+-commutative95.3%
Simplified95.3%
add-sqr-sqrt93.3%
fma-neg92.5%
pow1/292.5%
sqrt-pow192.7%
metadata-eval92.7%
pow1/292.7%
sqrt-pow192.5%
metadata-eval92.5%
Applied egg-rr92.5%
fma-undefine93.3%
pow-prod-up95.3%
metadata-eval95.3%
pow1/295.3%
sub-neg95.3%
flip--95.5%
add-sqr-sqrt93.5%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
Simplified96.6%
if 2.3500000000000001e29 < z Initial program 87.3%
associate-+l+87.3%
associate-+l+87.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
add087.3%
+-commutative87.3%
Simplified87.3%
flip--87.2%
div-inv87.2%
add-sqr-sqrt75.4%
+-commutative75.4%
add-sqr-sqrt87.9%
associate--l+90.5%
+-commutative90.5%
Applied egg-rr90.5%
+-inverses90.5%
metadata-eval90.5%
*-lft-identity90.5%
Simplified90.5%
flip--90.4%
div-inv90.4%
add-sqr-sqrt71.1%
add-sqr-sqrt90.4%
associate--l+92.2%
Applied egg-rr92.2%
+-inverses92.2%
metadata-eval92.2%
*-lft-identity92.2%
Simplified92.2%
Taylor expanded in t around inf 46.9%
Final simplification74.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 (<= z 5e+23)
(+
(- t_1 (sqrt x))
(+
1.0
(+
(/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(- (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (z <= 5e+23) {
tmp = (t_1 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (sqrt((1.0 + z)) - sqrt(z))));
} else {
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (z <= 5d+23) then
tmp = (t_1 - sqrt(x)) + (1.0d0 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (sqrt((1.0d0 + z)) - sqrt(z))))
else
tmp = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 5e+23) {
tmp = (t_1 - Math.sqrt(x)) + (1.0 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z))));
} else {
tmp = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if z <= 5e+23: tmp = (t_1 - math.sqrt(x)) + (1.0 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (math.sqrt((1.0 + z)) - math.sqrt(z)))) else: tmp = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 5e+23) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 5e+23)
tmp = (t_1 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (sqrt((1.0 + z)) - sqrt(z))));
else
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5e+23], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + 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}\;z \leq 5 \cdot 10^{+23}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(1 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 4.9999999999999999e23Initial program 95.8%
associate-+l+95.8%
associate-+l+95.8%
+-commutative95.8%
add095.8%
+-commutative95.8%
add095.8%
+-commutative95.8%
Simplified95.8%
flip--97.2%
div-inv97.2%
add-sqr-sqrt82.0%
add-sqr-sqrt97.6%
associate--l+98.0%
Applied egg-rr96.6%
+-inverses98.0%
metadata-eval98.0%
*-lft-identity98.0%
Simplified96.6%
Taylor expanded in y around 0 60.0%
flip--97.0%
div-inv97.0%
add-sqr-sqrt73.5%
add-sqr-sqrt97.0%
associate--l+97.6%
Applied egg-rr60.6%
+-inverses97.6%
metadata-eval97.6%
*-lft-identity97.6%
Simplified60.6%
if 4.9999999999999999e23 < z Initial program 87.1%
associate-+l+87.1%
associate-+l+87.1%
+-commutative87.1%
add087.1%
+-commutative87.1%
add087.1%
+-commutative87.1%
Simplified87.1%
flip--87.1%
div-inv87.1%
add-sqr-sqrt74.5%
+-commutative74.5%
add-sqr-sqrt87.8%
associate--l+90.2%
+-commutative90.2%
Applied egg-rr90.2%
+-inverses90.2%
metadata-eval90.2%
*-lft-identity90.2%
Simplified90.2%
Taylor expanded in t around inf 6.2%
Taylor expanded in z around inf 32.5%
+-commutative32.5%
associate-+r-46.4%
Simplified46.4%
Final simplification54.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= z 3.1e+16)
(+
(- t_1 (sqrt x))
(+ 1.0 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (z <= 3.1e+16) {
tmp = (t_1 - sqrt(x)) + (1.0 + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))));
} else {
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (z <= 3.1d+16) then
tmp = (t_1 - sqrt(x)) + (1.0d0 + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))))
else
tmp = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 3.1e+16) {
tmp = (t_1 - Math.sqrt(x)) + (1.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else {
tmp = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if z <= 3.1e+16: tmp = (t_1 - math.sqrt(x)) + (1.0 + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))) else: tmp = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 3.1e+16) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 3.1e+16)
tmp = (t_1 - sqrt(x)) + (1.0 + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))));
else
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.1e+16], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + 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}\;z \leq 3.1 \cdot 10^{+16}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(1 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 3.1e16Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
Simplified96.6%
flip--98.0%
div-inv98.0%
add-sqr-sqrt82.8%
add-sqr-sqrt98.4%
associate--l+98.9%
Applied egg-rr97.4%
+-inverses98.9%
metadata-eval98.9%
*-lft-identity98.9%
Simplified97.4%
Taylor expanded in y around 0 60.4%
if 3.1e16 < z Initial program 86.6%
associate-+l+86.6%
associate-+l+86.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
Simplified86.6%
flip--86.5%
div-inv86.5%
add-sqr-sqrt74.4%
+-commutative74.4%
add-sqr-sqrt87.2%
associate--l+89.5%
+-commutative89.5%
Applied egg-rr89.5%
+-inverses89.5%
metadata-eval89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in t around inf 6.9%
Taylor expanded in z around inf 32.3%
+-commutative32.3%
associate-+r-46.8%
Simplified46.8%
Final simplification53.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (- t_1 (sqrt x))))
(if (<= z 5e-35)
(+ t_2 (+ 1.0 (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= z 5.4e+23)
(+ t_2 (+ 1.0 (/ (+ 1.0 (- z z)) (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = t_1 - sqrt(x);
double tmp;
if (z <= 5e-35) {
tmp = t_2 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (z <= 5.4e+23) {
tmp = t_2 + (1.0 + ((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z))));
} else {
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = t_1 - sqrt(x)
if (z <= 5d-35) then
tmp = t_2 + (1.0d0 + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (z <= 5.4d+23) then
tmp = t_2 + (1.0d0 + ((1.0d0 + (z - z)) / (sqrt((1.0d0 + z)) + sqrt(z))))
else
tmp = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = t_1 - Math.sqrt(x);
double tmp;
if (z <= 5e-35) {
tmp = t_2 + (1.0 + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (z <= 5.4e+23) {
tmp = t_2 + (1.0 + ((1.0 + (z - z)) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))));
} else {
tmp = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = t_1 - math.sqrt(x) tmp = 0 if z <= 5e-35: tmp = t_2 + (1.0 + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif z <= 5.4e+23: tmp = t_2 + (1.0 + ((1.0 + (z - z)) / (math.sqrt((1.0 + z)) + math.sqrt(z)))) else: tmp = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(t_1 - sqrt(x)) tmp = 0.0 if (z <= 5e-35) tmp = Float64(t_2 + Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (z <= 5.4e+23) tmp = Float64(t_2 + Float64(1.0 + Float64(Float64(1.0 + Float64(z - z)) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = t_1 - sqrt(x);
tmp = 0.0;
if (z <= 5e-35)
tmp = t_2 + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (z <= 5.4e+23)
tmp = t_2 + (1.0 + ((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z))));
else
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e-35], N[(t$95$2 + N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e+23], N[(t$95$2 + N[(1.0 + N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + 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}\\
t_2 := t\_1 - \sqrt{x}\\
\mathbf{if}\;z \leq 5 \cdot 10^{-35}:\\
\;\;\;\;t\_2 + \left(1 + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+23}:\\
\;\;\;\;t\_2 + \left(1 + \frac{1 + \left(z - z\right)}{\sqrt{1 + z} + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 4.99999999999999964e-35Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
Simplified97.0%
flip--98.3%
div-inv98.3%
add-sqr-sqrt84.3%
add-sqr-sqrt98.4%
associate--l+99.0%
Applied egg-rr97.6%
+-inverses99.0%
metadata-eval99.0%
*-lft-identity99.0%
Simplified97.6%
Taylor expanded in y around 0 62.1%
Taylor expanded in z around 0 57.0%
associate--l+62.1%
Simplified62.1%
if 4.99999999999999964e-35 < z < 5.3999999999999997e23Initial program 89.1%
associate-+l+89.1%
associate-+l+89.1%
+-commutative89.1%
add089.1%
+-commutative89.1%
add089.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in t around 0 48.3%
Taylor expanded in y around inf 61.8%
associate-+r-61.8%
Simplified61.8%
flip--35.7%
div-inv35.7%
add-sqr-sqrt34.6%
+-commutative34.6%
add-sqr-sqrt35.7%
associate--l+35.7%
Applied egg-rr62.6%
associate-*r/35.7%
*-rgt-identity35.7%
associate-+r-35.7%
+-commutative35.7%
associate-+r-39.1%
Simplified62.7%
if 5.3999999999999997e23 < z Initial program 87.1%
associate-+l+87.1%
associate-+l+87.1%
+-commutative87.1%
add087.1%
+-commutative87.1%
add087.1%
+-commutative87.1%
Simplified87.1%
flip--87.1%
div-inv87.1%
add-sqr-sqrt74.5%
+-commutative74.5%
add-sqr-sqrt87.8%
associate--l+90.2%
+-commutative90.2%
Applied egg-rr90.2%
+-inverses90.2%
metadata-eval90.2%
*-lft-identity90.2%
Simplified90.2%
Taylor expanded in t around inf 6.2%
Taylor expanded in z around inf 32.5%
+-commutative32.5%
associate-+r-46.4%
Simplified46.4%
Final simplification54.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.35e-34)
(+ (- t_1 (sqrt x)) (+ 1.0 (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= z 3e+16)
(- (+ 1.0 (+ (sqrt (+ 1.0 z)) t_2)) (+ (sqrt y) (sqrt z)))
(+ (- t_2 (sqrt y)) (/ 1.0 (+ t_1 (sqrt x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 1.35e-34) {
tmp = (t_1 - sqrt(x)) + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (z <= 3e+16) {
tmp = (1.0 + (sqrt((1.0 + z)) + t_2)) - (sqrt(y) + sqrt(z));
} else {
tmp = (t_2 - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (z <= 1.35d-34) then
tmp = (t_1 - sqrt(x)) + (1.0d0 + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (z <= 3d+16) then
tmp = (1.0d0 + (sqrt((1.0d0 + z)) + t_2)) - (sqrt(y) + sqrt(z))
else
tmp = (t_2 - sqrt(y)) + (1.0d0 / (t_1 + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.35e-34) {
tmp = (t_1 - Math.sqrt(x)) + (1.0 + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (z <= 3e+16) {
tmp = (1.0 + (Math.sqrt((1.0 + z)) + t_2)) - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = (t_2 - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.35e-34: tmp = (t_1 - math.sqrt(x)) + (1.0 + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif z <= 3e+16: tmp = (1.0 + (math.sqrt((1.0 + z)) + t_2)) - (math.sqrt(y) + math.sqrt(z)) else: tmp = (t_2 - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.35e-34) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (z <= 3e+16) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + t_2)) - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(Float64(t_2 - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.35e-34)
tmp = (t_1 - sqrt(x)) + (1.0 + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
elseif (z <= 3e+16)
tmp = (1.0 + (sqrt((1.0 + z)) + t_2)) - (sqrt(y) + sqrt(z));
else
tmp = (t_2 - sqrt(y)) + (1.0 / (t_1 + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.35e-34], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+16], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + 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}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.35 \cdot 10^{-34}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(1 + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + z} + t\_2\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{x}}\\
\end{array}
\end{array}
if z < 1.35000000000000008e-34Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
Simplified97.0%
flip--98.3%
div-inv98.3%
add-sqr-sqrt84.3%
add-sqr-sqrt98.4%
associate--l+99.0%
Applied egg-rr97.6%
+-inverses99.0%
metadata-eval99.0%
*-lft-identity99.0%
Simplified97.6%
Taylor expanded in y around 0 62.1%
Taylor expanded in z around 0 57.0%
associate--l+62.1%
Simplified62.1%
if 1.35000000000000008e-34 < z < 3e16Initial program 93.8%
associate-+l+93.8%
associate-+l+93.8%
+-commutative93.8%
add093.8%
+-commutative93.8%
add093.8%
+-commutative93.8%
Simplified93.8%
flip--94.8%
div-inv94.8%
add-sqr-sqrt76.9%
+-commutative76.9%
add-sqr-sqrt94.8%
associate--l+95.8%
+-commutative95.8%
Applied egg-rr95.8%
+-inverses95.8%
metadata-eval95.8%
*-lft-identity95.8%
Simplified95.8%
Taylor expanded in t around inf 38.3%
Taylor expanded in x around 0 32.7%
if 3e16 < z Initial program 86.6%
associate-+l+86.6%
associate-+l+86.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
Simplified86.6%
flip--86.5%
div-inv86.5%
add-sqr-sqrt74.4%
+-commutative74.4%
add-sqr-sqrt87.2%
associate--l+89.5%
+-commutative89.5%
Applied egg-rr89.5%
+-inverses89.5%
metadata-eval89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in t around inf 6.9%
Taylor expanded in z around inf 32.3%
+-commutative32.3%
associate-+r-46.8%
Simplified46.8%
Final simplification52.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))))
(if (<= y 0.74)
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (+ 1.0 (- t_1 (sqrt z))))
(+ 1.0 (/ (+ 1.0 (- z z)) (+ 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 <= 0.74) {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 + (t_1 - sqrt(z)));
} else {
tmp = 1.0 + ((1.0 + (z - z)) / (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 <= 0.74d0) then
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (1.0d0 + (t_1 - sqrt(z)))
else
tmp = 1.0d0 + ((1.0d0 + (z - z)) / (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 <= 0.74) {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (1.0 + (t_1 - Math.sqrt(z)));
} else {
tmp = 1.0 + ((1.0 + (z - z)) / (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 <= 0.74: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (1.0 + (t_1 - math.sqrt(z))) else: tmp = 1.0 + ((1.0 + (z - z)) / (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 <= 0.74) tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(1.0 + Float64(t_1 - sqrt(z)))); else tmp = Float64(1.0 + Float64(Float64(1.0 + Float64(z - z)) / 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 <= 0.74)
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (1.0 + (t_1 - sqrt(z)));
else
tmp = 1.0 + ((1.0 + (z - z)) / (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, 0.74], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 0.74:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \left(1 + \left(t\_1 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1 + \left(z - z\right)}{t\_1 + \sqrt{z}}\\
\end{array}
\end{array}
if y < 0.73999999999999999Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.3%
Taylor expanded in y around inf 40.1%
associate-+r-57.5%
Simplified57.5%
if 0.73999999999999999 < y Initial program 85.4%
associate-+l+85.4%
associate-+l+85.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around 0 53.8%
Taylor expanded in y around inf 43.3%
associate-+r-53.5%
Simplified53.5%
Taylor expanded in x around inf 30.8%
associate-+r-52.8%
Simplified52.8%
flip--52.8%
div-inv52.8%
add-sqr-sqrt42.1%
+-commutative42.1%
add-sqr-sqrt52.8%
associate--l+52.8%
Applied egg-rr52.8%
associate-*r/52.8%
*-rgt-identity52.8%
associate-+r-52.8%
+-commutative52.8%
associate-+r-53.4%
Simplified53.4%
Final simplification55.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- (sqrt (+ 1.0 x)) (sqrt x))))
(if (<= y 3.35)
(+ t_2 (+ 1.0 (- t_1 (sqrt z))))
(+ t_2 (- (+ t_1 2.0) (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 t_2 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 3.35) {
tmp = t_2 + (1.0 + (t_1 - sqrt(z)));
} else {
tmp = t_2 + ((t_1 + 2.0) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 3.35d0) then
tmp = t_2 + (1.0d0 + (t_1 - sqrt(z)))
else
tmp = t_2 + ((t_1 + 2.0d0) - 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 t_2 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 3.35) {
tmp = t_2 + (1.0 + (t_1 - Math.sqrt(z)));
} else {
tmp = t_2 + ((t_1 + 2.0) - 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)) t_2 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 3.35: tmp = t_2 + (1.0 + (t_1 - math.sqrt(z))) else: tmp = t_2 + ((t_1 + 2.0) - 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)) t_2 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 3.35) tmp = Float64(t_2 + Float64(1.0 + Float64(t_1 - sqrt(z)))); else tmp = Float64(t_2 + Float64(Float64(t_1 + 2.0) - 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));
t_2 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 3.35)
tmp = t_2 + (1.0 + (t_1 - sqrt(z)));
else
tmp = t_2 + ((t_1 + 2.0) - 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]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.35], N[(t$95$2 + N[(1.0 + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(t$95$1 + 2.0), $MachinePrecision] - 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}\\
t_2 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 3.35:\\
\;\;\;\;t\_2 + \left(1 + \left(t\_1 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(t\_1 + 2\right) - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 3.35000000000000009Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.3%
Taylor expanded in y around inf 40.1%
associate-+r-57.5%
Simplified57.5%
if 3.35000000000000009 < y Initial program 85.4%
associate-+l+85.4%
associate-+l+85.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around 0 53.8%
Taylor expanded in y around 0 23.9%
Final simplification42.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 3e+16) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3e+16) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 3d+16) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3e+16) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3e+16: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3e+16) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 3e+16)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 3e+16], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 3e16Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around 0 55.0%
Taylor expanded in y around inf 59.3%
associate-+r-59.3%
Simplified59.3%
Taylor expanded in x around 0 50.6%
associate--l+50.6%
Simplified50.6%
if 3e16 < z Initial program 86.6%
associate-+l+86.6%
associate-+l+86.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
Simplified86.6%
flip--86.5%
div-inv86.5%
add-sqr-sqrt74.4%
+-commutative74.4%
add-sqr-sqrt87.2%
associate--l+89.5%
+-commutative89.5%
Applied egg-rr89.5%
+-inverses89.5%
metadata-eval89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in t around inf 6.9%
Taylor expanded in z around inf 32.3%
+-commutative32.3%
associate-+r-46.8%
Simplified46.8%
Final simplification48.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))))
(if (<= z 3e+16)
(- (+ 1.0 (+ (sqrt (+ 1.0 z)) t_1)) (+ (sqrt y) (sqrt z)))
(+ (- t_1 (sqrt y)) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 3e+16) {
tmp = (1.0 + (sqrt((1.0 + z)) + t_1)) - (sqrt(y) + sqrt(z));
} else {
tmp = (t_1 - sqrt(y)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 3d+16) then
tmp = (1.0d0 + (sqrt((1.0d0 + z)) + t_1)) - (sqrt(y) + sqrt(z))
else
tmp = (t_1 - sqrt(y)) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 3e+16) {
tmp = (1.0 + (Math.sqrt((1.0 + z)) + t_1)) - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = (t_1 - Math.sqrt(y)) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 3e+16: tmp = (1.0 + (math.sqrt((1.0 + z)) + t_1)) - (math.sqrt(y) + math.sqrt(z)) else: tmp = (t_1 - math.sqrt(y)) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 3e+16) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + t_1)) - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 3e+16)
tmp = (1.0 + (sqrt((1.0 + z)) + t_1)) - (sqrt(y) + sqrt(z));
else
tmp = (t_1 - sqrt(y)) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3e+16], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + z} + t\_1\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{y}\right) + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 3e16Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
add096.6%
+-commutative96.6%
Simplified96.6%
flip--97.0%
div-inv97.0%
add-sqr-sqrt77.6%
+-commutative77.6%
add-sqr-sqrt97.4%
associate--l+98.0%
+-commutative98.0%
Applied egg-rr98.0%
+-inverses98.0%
metadata-eval98.0%
*-lft-identity98.0%
Simplified98.0%
Taylor expanded in t around inf 38.3%
Taylor expanded in x around 0 38.4%
if 3e16 < z Initial program 86.6%
associate-+l+86.6%
associate-+l+86.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
add086.6%
+-commutative86.6%
Simplified86.6%
flip--86.5%
div-inv86.5%
add-sqr-sqrt74.4%
+-commutative74.4%
add-sqr-sqrt87.2%
associate--l+89.5%
+-commutative89.5%
Applied egg-rr89.5%
+-inverses89.5%
metadata-eval89.5%
*-lft-identity89.5%
Simplified89.5%
Taylor expanded in t around inf 6.9%
Taylor expanded in z around inf 32.3%
+-commutative32.3%
associate-+r-46.8%
Simplified46.8%
Final simplification42.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 0.6)
(+ (- t_1 (sqrt z)) 2.0)
(+ 1.0 (/ (+ 1.0 (- z z)) (+ 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 <= 0.6) {
tmp = (t_1 - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + ((1.0 + (z - z)) / (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 <= 0.6d0) then
tmp = (t_1 - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + ((1.0d0 + (z - z)) / (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 <= 0.6) {
tmp = (t_1 - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + ((1.0 + (z - z)) / (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 <= 0.6: tmp = (t_1 - math.sqrt(z)) + 2.0 else: tmp = 1.0 + ((1.0 + (z - z)) / (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 <= 0.6) tmp = Float64(Float64(t_1 - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(Float64(1.0 + Float64(z - z)) / 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 <= 0.6)
tmp = (t_1 - sqrt(z)) + 2.0;
else
tmp = 1.0 + ((1.0 + (z - z)) / (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, 0.6], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 0.6:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1 + \left(z - z\right)}{t\_1 + \sqrt{z}}\\
\end{array}
\end{array}
if y < 0.599999999999999978Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.3%
Taylor expanded in y around inf 40.1%
associate-+r-57.5%
Simplified57.5%
Taylor expanded in x around 0 34.6%
associate--l+57.6%
Simplified57.6%
if 0.599999999999999978 < y Initial program 85.4%
associate-+l+85.4%
associate-+l+85.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around 0 53.8%
Taylor expanded in y around inf 43.3%
associate-+r-53.5%
Simplified53.5%
Taylor expanded in x around inf 30.8%
associate-+r-52.8%
Simplified52.8%
flip--52.8%
div-inv52.8%
add-sqr-sqrt42.1%
+-commutative42.1%
add-sqr-sqrt52.8%
associate--l+52.8%
Applied egg-rr52.8%
associate-*r/52.8%
*-rgt-identity52.8%
associate-+r-52.8%
+-commutative52.8%
associate-+r-53.4%
Simplified53.4%
Final simplification55.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 3.85) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.85) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.85d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.85) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.85: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3.85) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3.85)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3.85], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], 1.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.85:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < 3.85000000000000009Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.3%
Taylor expanded in y around inf 40.1%
associate-+r-57.5%
Simplified57.5%
Taylor expanded in x around 0 34.6%
associate--l+57.6%
Simplified57.6%
if 3.85000000000000009 < y Initial program 85.4%
associate-+l+85.4%
associate-+l+85.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around 0 53.8%
Taylor expanded in y around inf 43.3%
associate-+r-53.5%
Simplified53.5%
Taylor expanded in x around inf 30.8%
associate-+r-52.8%
Simplified52.8%
Taylor expanded in z around inf 41.0%
Final simplification50.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.1) 2.0 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.1) {
tmp = 2.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.1d0) then
tmp = 2.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.1) {
tmp = 2.0;
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.1: tmp = 2.0 else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.1) tmp = 2.0; else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.1)
tmp = 2.0;
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.1], 2.0, 1.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < 2.10000000000000009Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
add097.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.3%
Taylor expanded in y around inf 40.1%
associate-+r-57.5%
Simplified57.5%
Taylor expanded in x around inf 21.0%
associate-+r-33.4%
Simplified33.4%
Taylor expanded in z around 0 43.2%
if 2.10000000000000009 < y Initial program 85.4%
associate-+l+85.4%
associate-+l+85.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
add085.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in t around 0 53.8%
Taylor expanded in y around inf 43.3%
associate-+r-53.5%
Simplified53.5%
Taylor expanded in x around inf 30.8%
associate-+r-52.8%
Simplified52.8%
Taylor expanded in z around inf 41.0%
Final simplification42.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)
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 91.7%
associate-+l+91.7%
associate-+l+91.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
add091.7%
+-commutative91.7%
Simplified91.7%
Taylor expanded in t around 0 55.2%
Taylor expanded in y around inf 41.6%
associate-+r-55.6%
Simplified55.6%
Taylor expanded in x around inf 25.4%
associate-+r-42.2%
Simplified42.2%
Taylor expanded in z around inf 32.5%
Final simplification32.5%
(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 2024034
(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))))