
(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 23 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 z)))
(t_2 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (+ (+ t_2 (- t_3 (sqrt y))) (- t_1 (sqrt z))))
(t_5 (sqrt (+ 1.0 t))))
(if (<= t_4 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(+
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y)))))
(* 0.0625 (sqrt (/ 1.0 (pow x 5.0))))))
(if (<= t_4 2.00005)
(+
t_2
(+
(/ (- (+ 1.0 y) y) (+ (sqrt y) t_3))
(+ (* 0.5 (sqrt (/ 1.0 z))) (- t_5 (sqrt t)))))
(+
1.0
(-
(+ t_3 (+ t_1 (/ 1.0 (+ t_5 (sqrt t)))))
(+ (sqrt x) (+ (sqrt y) (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((x + 1.0)) - sqrt(x);
double t_3 = sqrt((1.0 + y));
double t_4 = (t_2 + (t_3 - sqrt(y))) + (t_1 - sqrt(z));
double t_5 = sqrt((1.0 + t));
double tmp;
if (t_4 <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / pow(x, 5.0)))));
} else if (t_4 <= 2.00005) {
tmp = t_2 + ((((1.0 + y) - y) / (sqrt(y) + t_3)) + ((0.5 * sqrt((1.0 / z))) + (t_5 - sqrt(t))));
} else {
tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_5 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + 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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((x + 1.0d0)) - sqrt(x)
t_3 = sqrt((1.0d0 + y))
t_4 = (t_2 + (t_3 - sqrt(y))) + (t_1 - sqrt(z))
t_5 = sqrt((1.0d0 + t))
if (t_4 <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + ((0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / y))))) + (0.0625d0 * sqrt((1.0d0 / (x ** 5.0d0)))))
else if (t_4 <= 2.00005d0) then
tmp = t_2 + ((((1.0d0 + y) - y) / (sqrt(y) + t_3)) + ((0.5d0 * sqrt((1.0d0 / z))) + (t_5 - sqrt(t))))
else
tmp = 1.0d0 + ((t_3 + (t_1 + (1.0d0 / (t_5 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + 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((x + 1.0)) - Math.sqrt(x);
double t_3 = Math.sqrt((1.0 + y));
double t_4 = (t_2 + (t_3 - Math.sqrt(y))) + (t_1 - Math.sqrt(z));
double t_5 = Math.sqrt((1.0 + t));
double tmp;
if (t_4 <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y))))) + (0.0625 * Math.sqrt((1.0 / Math.pow(x, 5.0)))));
} else if (t_4 <= 2.00005) {
tmp = t_2 + ((((1.0 + y) - y) / (Math.sqrt(y) + t_3)) + ((0.5 * Math.sqrt((1.0 / z))) + (t_5 - Math.sqrt(t))));
} else {
tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_5 + Math.sqrt(t))))) - (Math.sqrt(x) + (Math.sqrt(y) + 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((x + 1.0)) - math.sqrt(x) t_3 = math.sqrt((1.0 + y)) t_4 = (t_2 + (t_3 - math.sqrt(y))) + (t_1 - math.sqrt(z)) t_5 = math.sqrt((1.0 + t)) tmp = 0 if t_4 <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / y))))) + (0.0625 * math.sqrt((1.0 / math.pow(x, 5.0))))) elif t_4 <= 2.00005: tmp = t_2 + ((((1.0 + y) - y) / (math.sqrt(y) + t_3)) + ((0.5 * math.sqrt((1.0 / z))) + (t_5 - math.sqrt(t)))) else: tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_5 + math.sqrt(t))))) - (math.sqrt(x) + (math.sqrt(y) + 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(x + 1.0)) - sqrt(x)) t_3 = sqrt(Float64(1.0 + y)) t_4 = Float64(Float64(t_2 + Float64(t_3 - sqrt(y))) + Float64(t_1 - sqrt(z))) t_5 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (t_4 <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y))))) + Float64(0.0625 * sqrt(Float64(1.0 / (x ^ 5.0)))))); elseif (t_4 <= 2.00005) tmp = Float64(t_2 + Float64(Float64(Float64(Float64(1.0 + y) - y) / Float64(sqrt(y) + t_3)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(t_5 - sqrt(t))))); else tmp = Float64(1.0 + Float64(Float64(t_3 + Float64(t_1 + Float64(1.0 / Float64(t_5 + sqrt(t))))) - Float64(sqrt(x) + Float64(sqrt(y) + 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((x + 1.0)) - sqrt(x);
t_3 = sqrt((1.0 + y));
t_4 = (t_2 + (t_3 - sqrt(y))) + (t_1 - sqrt(z));
t_5 = sqrt((1.0 + t));
tmp = 0.0;
if (t_4 <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / (x ^ 5.0)))));
elseif (t_4 <= 2.00005)
tmp = t_2 + ((((1.0 + y) - y) / (sqrt(y) + t_3)) + ((0.5 * sqrt((1.0 / z))) + (t_5 - sqrt(t))));
else
tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_5 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0625 * N[Sqrt[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2.00005], N[(t$95$2 + N[(N[(N[(N[(1.0 + y), $MachinePrecision] - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$5 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(t$95$3 + N[(t$95$1 + N[(1.0 / N[(t$95$5 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $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 + z}\\
t_2 := \sqrt{x + 1} - \sqrt{x}\\
t_3 := \sqrt{1 + y}\\
t_4 := \left(t\_2 + \left(t\_3 - \sqrt{y}\right)\right) + \left(t\_1 - \sqrt{z}\right)\\
t_5 := \sqrt{1 + t}\\
\mathbf{if}\;t\_4 \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + \left(0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\right)\right) + 0.0625 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)\\
\mathbf{elif}\;t\_4 \leq 2.00005:\\
\;\;\;\;t\_2 + \left(\frac{\left(1 + y\right) - y}{\sqrt{y} + t\_3} + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \left(t\_5 - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(t\_3 + \left(t\_1 + \frac{1}{t\_5 + \sqrt{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1e-3Initial program 41.6%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6439.8%
Simplified39.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f644.9%
Simplified4.9%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f643.6%
Simplified3.6%
Taylor expanded in x around inf
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified51.9%
if 1e-3 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.0000499999999999Initial program 96.1%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified67.1%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6455.6%
Simplified55.6%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6455.8%
Applied egg-rr55.8%
if 2.0000499999999999 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 97.2%
flip--N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6497.8%
Applied egg-rr97.8%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified94.0%
Final simplification60.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 z)))
(t_2 (sqrt (+ 1.0 t)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- t_3 (sqrt y))))
(t_5 (+ t_4 (- t_1 (sqrt z)))))
(if (<= t_5 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(+
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y)))))
(* 0.0625 (sqrt (/ 1.0 (pow x 5.0))))))
(if (<= t_5 2.00005)
(+ (+ t_4 (* 0.5 (sqrt (/ 1.0 z)))) (- t_2 (sqrt t)))
(+
1.0
(-
(+ t_3 (+ t_1 (/ 1.0 (+ t_2 (sqrt t)))))
(+ (sqrt x) (+ (sqrt y) (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 + t));
double t_3 = sqrt((1.0 + y));
double t_4 = (sqrt((x + 1.0)) - sqrt(x)) + (t_3 - sqrt(y));
double t_5 = t_4 + (t_1 - sqrt(z));
double tmp;
if (t_5 <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / pow(x, 5.0)))));
} else if (t_5 <= 2.00005) {
tmp = (t_4 + (0.5 * sqrt((1.0 / z)))) + (t_2 - sqrt(t));
} else {
tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_2 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + 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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + t))
t_3 = sqrt((1.0d0 + y))
t_4 = (sqrt((x + 1.0d0)) - sqrt(x)) + (t_3 - sqrt(y))
t_5 = t_4 + (t_1 - sqrt(z))
if (t_5 <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + ((0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / y))))) + (0.0625d0 * sqrt((1.0d0 / (x ** 5.0d0)))))
else if (t_5 <= 2.00005d0) then
tmp = (t_4 + (0.5d0 * sqrt((1.0d0 / z)))) + (t_2 - sqrt(t))
else
tmp = 1.0d0 + ((t_3 + (t_1 + (1.0d0 / (t_2 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + 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 + t));
double t_3 = Math.sqrt((1.0 + y));
double t_4 = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (t_3 - Math.sqrt(y));
double t_5 = t_4 + (t_1 - Math.sqrt(z));
double tmp;
if (t_5 <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y))))) + (0.0625 * Math.sqrt((1.0 / Math.pow(x, 5.0)))));
} else if (t_5 <= 2.00005) {
tmp = (t_4 + (0.5 * Math.sqrt((1.0 / z)))) + (t_2 - Math.sqrt(t));
} else {
tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_2 + Math.sqrt(t))))) - (Math.sqrt(x) + (Math.sqrt(y) + 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 + t)) t_3 = math.sqrt((1.0 + y)) t_4 = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (t_3 - math.sqrt(y)) t_5 = t_4 + (t_1 - math.sqrt(z)) tmp = 0 if t_5 <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / y))))) + (0.0625 * math.sqrt((1.0 / math.pow(x, 5.0))))) elif t_5 <= 2.00005: tmp = (t_4 + (0.5 * math.sqrt((1.0 / z)))) + (t_2 - math.sqrt(t)) else: tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_2 + math.sqrt(t))))) - (math.sqrt(x) + (math.sqrt(y) + 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 = sqrt(Float64(1.0 + t)) t_3 = sqrt(Float64(1.0 + y)) t_4 = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(t_3 - sqrt(y))) t_5 = Float64(t_4 + Float64(t_1 - sqrt(z))) tmp = 0.0 if (t_5 <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y))))) + Float64(0.0625 * sqrt(Float64(1.0 / (x ^ 5.0)))))); elseif (t_5 <= 2.00005) tmp = Float64(Float64(t_4 + Float64(0.5 * sqrt(Float64(1.0 / z)))) + Float64(t_2 - sqrt(t))); else tmp = Float64(1.0 + Float64(Float64(t_3 + Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(t))))) - Float64(sqrt(x) + Float64(sqrt(y) + 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 + t));
t_3 = sqrt((1.0 + y));
t_4 = (sqrt((x + 1.0)) - sqrt(x)) + (t_3 - sqrt(y));
t_5 = t_4 + (t_1 - sqrt(z));
tmp = 0.0;
if (t_5 <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / (x ^ 5.0)))));
elseif (t_5 <= 2.00005)
tmp = (t_4 + (0.5 * sqrt((1.0 / z)))) + (t_2 - sqrt(t));
else
tmp = 1.0 + ((t_3 + (t_1 + (1.0 / (t_2 + sqrt(t))))) - (sqrt(x) + (sqrt(y) + 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[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0625 * N[Sqrt[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2.00005], N[(N[(t$95$4 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(t$95$3 + N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $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 + z}\\
t_2 := \sqrt{1 + t}\\
t_3 := \sqrt{1 + y}\\
t_4 := \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\\
t_5 := t\_4 + \left(t\_1 - \sqrt{z}\right)\\
\mathbf{if}\;t\_5 \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + \left(0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\right)\right) + 0.0625 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)\\
\mathbf{elif}\;t\_5 \leq 2.00005:\\
\;\;\;\;\left(t\_4 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) + \left(t\_2 - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(t\_3 + \left(t\_1 + \frac{1}{t\_2 + \sqrt{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1e-3Initial program 41.6%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6439.8%
Simplified39.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f644.9%
Simplified4.9%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f643.6%
Simplified3.6%
Taylor expanded in x around inf
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified51.9%
if 1e-3 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.0000499999999999Initial program 96.1%
Taylor expanded in z around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6455.6%
Simplified55.6%
if 2.0000499999999999 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 97.2%
flip--N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-commutativeN/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f6497.8%
Applied egg-rr97.8%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified94.0%
Final simplification60.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0)))
(t_2 (- t_1 (sqrt x)))
(t_3 (+ t_2 (- (sqrt (+ 1.0 y)) (sqrt y)))))
(if (<= t_3 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(+
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y)))))
(* 0.0625 (sqrt (/ 1.0 (pow x 5.0))))))
(if (<= t_3 1.99998)
(/
(+
(* 0.5 (sqrt t))
(*
t
(+
t_1
(- (/ (- (+ 1.0 y) y) (+ (sqrt y) (pow (+ 1.0 y) 0.5))) (sqrt x)))))
t)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ t_2 (- 1.0 (sqrt y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = t_1 - sqrt(x);
double t_3 = t_2 + (sqrt((1.0 + y)) - sqrt(y));
double tmp;
if (t_3 <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / pow(x, 5.0)))));
} else if (t_3 <= 1.99998) {
tmp = ((0.5 * sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (sqrt(y) + pow((1.0 + y), 0.5))) - sqrt(x))))) / t;
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_2 + (1.0 - sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = t_1 - sqrt(x)
t_3 = t_2 + (sqrt((1.0d0 + y)) - sqrt(y))
if (t_3 <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + ((0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / y))))) + (0.0625d0 * sqrt((1.0d0 / (x ** 5.0d0)))))
else if (t_3 <= 1.99998d0) then
tmp = ((0.5d0 * sqrt(t)) + (t * (t_1 + ((((1.0d0 + y) - y) / (sqrt(y) + ((1.0d0 + y) ** 0.5d0))) - sqrt(x))))) / t
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (t_2 + (1.0d0 - sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = t_2 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
double tmp;
if (t_3 <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y))))) + (0.0625 * Math.sqrt((1.0 / Math.pow(x, 5.0)))));
} else if (t_3 <= 1.99998) {
tmp = ((0.5 * Math.sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (Math.sqrt(y) + Math.pow((1.0 + y), 0.5))) - Math.sqrt(x))))) / t;
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (t_2 + (1.0 - Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = t_1 - math.sqrt(x) t_3 = t_2 + (math.sqrt((1.0 + y)) - math.sqrt(y)) tmp = 0 if t_3 <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / y))))) + (0.0625 * math.sqrt((1.0 / math.pow(x, 5.0))))) elif t_3 <= 1.99998: tmp = ((0.5 * math.sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (math.sqrt(y) + math.pow((1.0 + y), 0.5))) - math.sqrt(x))))) / t else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (t_2 + (1.0 - math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = Float64(t_1 - sqrt(x)) t_3 = Float64(t_2 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) tmp = 0.0 if (t_3 <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y))))) + Float64(0.0625 * sqrt(Float64(1.0 / (x ^ 5.0)))))); elseif (t_3 <= 1.99998) tmp = Float64(Float64(Float64(0.5 * sqrt(t)) + Float64(t * Float64(t_1 + Float64(Float64(Float64(Float64(1.0 + y) - y) / Float64(sqrt(y) + (Float64(1.0 + y) ^ 0.5))) - sqrt(x))))) / t); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(t_2 + Float64(1.0 - sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = t_1 - sqrt(x);
t_3 = t_2 + (sqrt((1.0 + y)) - sqrt(y));
tmp = 0.0;
if (t_3 <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / (x ^ 5.0)))));
elseif (t_3 <= 1.99998)
tmp = ((0.5 * sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (sqrt(y) + ((1.0 + y) ^ 0.5))) - sqrt(x))))) / t;
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((sqrt((1.0 + z)) - sqrt(z)) + (t_2 + (1.0 - sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0625 * N[Sqrt[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1.99998], N[(N[(N[(0.5 * N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t * N[(t$95$1 + N[(N[(N[(N[(1.0 + y), $MachinePrecision] - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] + N[Power[N[(1.0 + y), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 - 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{x + 1}\\
t_2 := t\_1 - \sqrt{x}\\
t_3 := t\_2 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{if}\;t\_3 \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + \left(0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\right)\right) + 0.0625 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)\\
\mathbf{elif}\;t\_3 \leq 1.99998:\\
\;\;\;\;\frac{0.5 \cdot \sqrt{t} + t \cdot \left(t\_1 + \left(\frac{\left(1 + y\right) - y}{\sqrt{y} + {\left(1 + y\right)}^{0.5}} - \sqrt{x}\right)\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_2 + \left(1 - \sqrt{y}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1e-3Initial program 68.8%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6424.8%
Simplified24.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.4%
Simplified5.4%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.0%
Simplified4.0%
Taylor expanded in x around inf
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified29.7%
if 1e-3 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.99998000000000009Initial program 96.5%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6437.7%
Simplified37.7%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6421.4%
Simplified21.4%
Taylor expanded in t around 0
/-lowering-/.f64N/A
Simplified21.8%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6421.9%
Applied egg-rr21.9%
if 1.99998000000000009 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 96.5%
Taylor expanded in y around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6496.5%
Simplified96.5%
Final simplification40.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y))))
(t_2 (sqrt (+ x 1.0)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (+ (- t_2 (sqrt x)) (- t_3 (sqrt y)))))
(if (<= t_4 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(+
(* 0.5 (+ (sqrt (/ 1.0 x)) t_1))
(* 0.0625 (sqrt (/ 1.0 (pow x 5.0))))))
(if (<= t_4 1.2)
(+
t_2
(+ (* -0.125 (sqrt (/ 1.0 (* y (* y y))))) (- (* 0.5 t_1) (sqrt x))))
(-
(+ (+ t_3 t_2) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(+ (sqrt x) (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 / t)) + sqrt((1.0 / y));
double t_2 = sqrt((x + 1.0));
double t_3 = sqrt((1.0 + y));
double t_4 = (t_2 - sqrt(x)) + (t_3 - sqrt(y));
double tmp;
if (t_4 <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + t_1)) + (0.0625 * sqrt((1.0 / pow(x, 5.0)))));
} else if (t_4 <= 1.2) {
tmp = t_2 + ((-0.125 * sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_1) - sqrt(x)));
} else {
tmp = ((t_3 + t_2) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (sqrt(x) + 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) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 / t)) + sqrt((1.0d0 / y))
t_2 = sqrt((x + 1.0d0))
t_3 = sqrt((1.0d0 + y))
t_4 = (t_2 - sqrt(x)) + (t_3 - sqrt(y))
if (t_4 <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + ((0.5d0 * (sqrt((1.0d0 / x)) + t_1)) + (0.0625d0 * sqrt((1.0d0 / (x ** 5.0d0)))))
else if (t_4 <= 1.2d0) then
tmp = t_2 + (((-0.125d0) * sqrt((1.0d0 / (y * (y * y))))) + ((0.5d0 * t_1) - sqrt(x)))
else
tmp = ((t_3 + t_2) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) - (sqrt(x) + 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 / t)) + Math.sqrt((1.0 / y));
double t_2 = Math.sqrt((x + 1.0));
double t_3 = Math.sqrt((1.0 + y));
double t_4 = (t_2 - Math.sqrt(x)) + (t_3 - Math.sqrt(y));
double tmp;
if (t_4 <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (Math.sqrt((1.0 / x)) + t_1)) + (0.0625 * Math.sqrt((1.0 / Math.pow(x, 5.0)))));
} else if (t_4 <= 1.2) {
tmp = t_2 + ((-0.125 * Math.sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_1) - Math.sqrt(x)));
} else {
tmp = ((t_3 + t_2) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) - (Math.sqrt(x) + 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 / t)) + math.sqrt((1.0 / y)) t_2 = math.sqrt((x + 1.0)) t_3 = math.sqrt((1.0 + y)) t_4 = (t_2 - math.sqrt(x)) + (t_3 - math.sqrt(y)) tmp = 0 if t_4 <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (math.sqrt((1.0 / x)) + t_1)) + (0.0625 * math.sqrt((1.0 / math.pow(x, 5.0))))) elif t_4 <= 1.2: tmp = t_2 + ((-0.125 * math.sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_1) - math.sqrt(x))) else: tmp = ((t_3 + t_2) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) - (math.sqrt(x) + math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y))) t_2 = sqrt(Float64(x + 1.0)) t_3 = sqrt(Float64(1.0 + y)) t_4 = Float64(Float64(t_2 - sqrt(x)) + Float64(t_3 - sqrt(y))) tmp = 0.0 if (t_4 <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + t_1)) + Float64(0.0625 * sqrt(Float64(1.0 / (x ^ 5.0)))))); elseif (t_4 <= 1.2) tmp = Float64(t_2 + Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(y * Float64(y * y))))) + Float64(Float64(0.5 * t_1) - sqrt(x)))); else tmp = Float64(Float64(Float64(t_3 + t_2) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) - Float64(sqrt(x) + 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 / t)) + sqrt((1.0 / y));
t_2 = sqrt((x + 1.0));
t_3 = sqrt((1.0 + y));
t_4 = (t_2 - sqrt(x)) + (t_3 - sqrt(y));
tmp = 0.0;
if (t_4 <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + t_1)) + (0.0625 * sqrt((1.0 / (x ^ 5.0)))));
elseif (t_4 <= 1.2)
tmp = t_2 + ((-0.125 * sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_1) - sqrt(x)));
else
tmp = ((t_3 + t_2) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (sqrt(x) + 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[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(0.0625 * N[Sqrt[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 1.2], N[(t$95$2 + N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$3 + t$95$2), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{1 + y}\\
t_4 := \left(t\_2 - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\\
\mathbf{if}\;t\_4 \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + \left(0.5 \cdot \left(\sqrt{\frac{1}{x}} + t\_1\right) + 0.0625 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)\\
\mathbf{elif}\;t\_4 \leq 1.2:\\
\;\;\;\;t\_2 + \left(-0.125 \cdot \sqrt{\frac{1}{y \cdot \left(y \cdot y\right)}} + \left(0.5 \cdot t\_1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_3 + t\_2\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1e-3Initial program 68.8%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6424.8%
Simplified24.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.4%
Simplified5.4%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.0%
Simplified4.0%
Taylor expanded in x around inf
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified29.7%
if 1e-3 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.19999999999999996Initial program 96.4%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6437.1%
Simplified37.1%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6420.5%
Simplified20.5%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified17.3%
if 1.19999999999999996 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 96.7%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6498.2%
Applied egg-rr98.2%
Taylor expanded in t around inf
--lowering--.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
Simplified56.0%
Final simplification29.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 (+ x 1.0)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (+ (- t_1 (sqrt x)) (- t_2 (sqrt y))))
(t_4 (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y)))))
(if (<= t_3 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(* 0.5 (+ (sqrt (/ 1.0 x)) t_4)))
(if (<= t_3 1.2)
(+
t_1
(+ (* -0.125 (sqrt (/ 1.0 (* y (* y y))))) (- (* 0.5 t_4) (sqrt x))))
(-
(+ (+ t_2 t_1) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))
(+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((1.0 + y));
double t_3 = (t_1 - sqrt(x)) + (t_2 - sqrt(y));
double t_4 = sqrt((1.0 / t)) + sqrt((1.0 / y));
double tmp;
if (t_3 <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + (0.5 * (sqrt((1.0 / x)) + t_4));
} else if (t_3 <= 1.2) {
tmp = t_1 + ((-0.125 * sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_4) - sqrt(x)));
} else {
tmp = ((t_2 + t_1) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (sqrt(x) + 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) :: t_4
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((1.0d0 + y))
t_3 = (t_1 - sqrt(x)) + (t_2 - sqrt(y))
t_4 = sqrt((1.0d0 / t)) + sqrt((1.0d0 / y))
if (t_3 <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + (0.5d0 * (sqrt((1.0d0 / x)) + t_4))
else if (t_3 <= 1.2d0) then
tmp = t_1 + (((-0.125d0) * sqrt((1.0d0 / (y * (y * y))))) + ((0.5d0 * t_4) - sqrt(x)))
else
tmp = ((t_2 + t_1) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))) - (sqrt(x) + 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((x + 1.0));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = (t_1 - Math.sqrt(x)) + (t_2 - Math.sqrt(y));
double t_4 = Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y));
double tmp;
if (t_3 <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + (0.5 * (Math.sqrt((1.0 / x)) + t_4));
} else if (t_3 <= 1.2) {
tmp = t_1 + ((-0.125 * Math.sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_4) - Math.sqrt(x)));
} else {
tmp = ((t_2 + t_1) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) - (Math.sqrt(x) + Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((1.0 + y)) t_3 = (t_1 - math.sqrt(x)) + (t_2 - math.sqrt(y)) t_4 = math.sqrt((1.0 / t)) + math.sqrt((1.0 / y)) tmp = 0 if t_3 <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + (0.5 * (math.sqrt((1.0 / x)) + t_4)) elif t_3 <= 1.2: tmp = t_1 + ((-0.125 * math.sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_4) - math.sqrt(x))) else: tmp = ((t_2 + t_1) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))) - (math.sqrt(x) + math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(1.0 + y)) t_3 = Float64(Float64(t_1 - sqrt(x)) + Float64(t_2 - sqrt(y))) t_4 = Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y))) tmp = 0.0 if (t_3 <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + t_4))); elseif (t_3 <= 1.2) tmp = Float64(t_1 + Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(y * Float64(y * y))))) + Float64(Float64(0.5 * t_4) - sqrt(x)))); else tmp = Float64(Float64(Float64(t_2 + t_1) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) - Float64(sqrt(x) + 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((x + 1.0));
t_2 = sqrt((1.0 + y));
t_3 = (t_1 - sqrt(x)) + (t_2 - sqrt(y));
t_4 = sqrt((1.0 / t)) + sqrt((1.0 / y));
tmp = 0.0;
if (t_3 <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + (0.5 * (sqrt((1.0 / x)) + t_4));
elseif (t_3 <= 1.2)
tmp = t_1 + ((-0.125 * sqrt((1.0 / (y * (y * y))))) + ((0.5 * t_4) - sqrt(x)));
else
tmp = ((t_2 + t_1) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))) - (sqrt(x) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1.2], N[(t$95$1 + N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * t$95$4), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{1 + y}\\
t_3 := \left(t\_1 - \sqrt{x}\right) + \left(t\_2 - \sqrt{y}\right)\\
t_4 := \sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\\
\mathbf{if}\;t\_3 \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + 0.5 \cdot \left(\sqrt{\frac{1}{x}} + t\_4\right)\\
\mathbf{elif}\;t\_3 \leq 1.2:\\
\;\;\;\;t\_1 + \left(-0.125 \cdot \sqrt{\frac{1}{y \cdot \left(y \cdot y\right)}} + \left(0.5 \cdot t\_4 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_2 + t\_1\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1e-3Initial program 68.8%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6424.8%
Simplified24.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.4%
Simplified5.4%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.0%
Simplified4.0%
Taylor expanded in x around inf
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified29.7%
if 1e-3 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.19999999999999996Initial program 96.4%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6437.1%
Simplified37.1%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6420.5%
Simplified20.5%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified17.3%
if 1.19999999999999996 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 96.7%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f6498.2%
Applied egg-rr98.2%
Taylor expanded in t around inf
--lowering--.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
Simplified56.0%
Final simplification29.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 t))) (t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= (+ (- (sqrt (+ x 1.0)) (sqrt x)) t_2) 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(+
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ t_1 (sqrt (/ 1.0 y)))))
(* 0.0625 (sqrt (/ 1.0 (pow x 5.0))))))
(+
(+
(+ t_2 (+ 1.0 (- (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))) (sqrt x))))
(/ (- (+ 1.0 z) z) (+ (sqrt z) (sqrt (+ 1.0 z)))))
(* 0.5 t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 / t));
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (((sqrt((x + 1.0)) - sqrt(x)) + t_2) <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (t_1 + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / pow(x, 5.0)))));
} else {
tmp = ((t_2 + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - sqrt(x)))) + (((1.0 + z) - z) / (sqrt(z) + sqrt((1.0 + z))))) + (0.5 * t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 / t))
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (((sqrt((x + 1.0d0)) - sqrt(x)) + t_2) <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + ((0.5d0 * (sqrt((1.0d0 / x)) + (t_1 + sqrt((1.0d0 / y))))) + (0.0625d0 * sqrt((1.0d0 / (x ** 5.0d0)))))
else
tmp = ((t_2 + (1.0d0 + ((x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))) - sqrt(x)))) + (((1.0d0 + z) - z) / (sqrt(z) + sqrt((1.0d0 + z))))) + (0.5d0 * t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / t));
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_2) <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (Math.sqrt((1.0 / x)) + (t_1 + Math.sqrt((1.0 / y))))) + (0.0625 * Math.sqrt((1.0 / Math.pow(x, 5.0)))));
} else {
tmp = ((t_2 + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - Math.sqrt(x)))) + (((1.0 + z) - z) / (Math.sqrt(z) + Math.sqrt((1.0 + z))))) + (0.5 * t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 / t)) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if ((math.sqrt((x + 1.0)) - math.sqrt(x)) + t_2) <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + ((0.5 * (math.sqrt((1.0 / x)) + (t_1 + math.sqrt((1.0 / y))))) + (0.0625 * math.sqrt((1.0 / math.pow(x, 5.0))))) else: tmp = ((t_2 + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - math.sqrt(x)))) + (((1.0 + z) - z) / (math.sqrt(z) + math.sqrt((1.0 + z))))) + (0.5 * 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 / t)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_2) <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(t_1 + sqrt(Float64(1.0 / y))))) + Float64(0.0625 * sqrt(Float64(1.0 / (x ^ 5.0)))))); else tmp = Float64(Float64(Float64(t_2 + Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) - sqrt(x)))) + Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))) + Float64(0.5 * t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / t));
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (((sqrt((x + 1.0)) - sqrt(x)) + t_2) <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + ((0.5 * (sqrt((1.0 / x)) + (t_1 + sqrt((1.0 / y))))) + (0.0625 * sqrt((1.0 / (x ^ 5.0)))));
else
tmp = ((t_2 + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - sqrt(x)))) + (((1.0 + z) - z) / (sqrt(z) + sqrt((1.0 + z))))) + (0.5 * 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 / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.0625 * N[Sqrt[N[(1.0 / N[Power[x, 5.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 + N[(1.0 + N[(N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{t}}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;\left(\sqrt{x + 1} - \sqrt{x}\right) + t\_2 \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + \left(0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(t\_1 + \sqrt{\frac{1}{y}}\right)\right) + 0.0625 \cdot \sqrt{\frac{1}{{x}^{5}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_2 + \left(1 + \left(x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right) - \sqrt{x}\right)\right)\right) + \frac{\left(1 + z\right) - z}{\sqrt{z} + \sqrt{1 + z}}\right) + 0.5 \cdot t\_1\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1e-3Initial program 68.8%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6424.8%
Simplified24.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.4%
Simplified5.4%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.0%
Simplified4.0%
Taylor expanded in x around inf
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified29.7%
if 1e-3 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) Initial program 96.5%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6454.1%
Simplified54.1%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6435.2%
Simplified35.2%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6435.5%
Applied egg-rr35.5%
Final simplification34.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 (+ x 1.0)) (sqrt x))))
(if (<= t_1 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y))))))
(+ t_1 (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- (sqrt (+ 1.0 z)) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double tmp;
if (t_1 <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + (0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y)))));
} else {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + (sqrt((1.0 + z)) - 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((x + 1.0d0)) - sqrt(x)
if (t_1 <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + (0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / y)))))
else
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) + (sqrt((1.0d0 + z)) - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double tmp;
if (t_1 <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + (0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y)))));
} else {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) tmp = 0 if t_1 <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + (0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / y))))) else: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) tmp = 0.0 if (t_1 <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y)))))); else tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0)) - sqrt(x);
tmp = 0.0;
if (t_1 <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + (0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y)))));
else
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
\mathbf{if}\;t\_1 \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + 0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1e-3Initial program 83.2%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6443.4%
Simplified43.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.9%
Simplified5.9%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.5%
Simplified4.5%
Taylor expanded in x around inf
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified17.3%
if 1e-3 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.6%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified70.1%
Taylor expanded in t around inf
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6455.0%
Simplified55.0%
Final simplification37.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 z))))
(if (<= t 315000.0)
(+
1.0
(-
(+ (sqrt (+ 1.0 t)) (+ t_1 (sqrt (+ x 1.0))))
(+ (sqrt t) (+ (sqrt y) (+ (sqrt x) (sqrt z))))))
(+
(+
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(+ 1.0 (- (* x (+ 0.5 (* x (+ -0.125 (* x 0.0625))))) (sqrt x))))
(/ (- (+ 1.0 z) z) (+ (sqrt z) t_1)))
(* 0.5 (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 + z));
double tmp;
if (t <= 315000.0) {
tmp = 1.0 + ((sqrt((1.0 + t)) + (t_1 + sqrt((x + 1.0)))) - (sqrt(t) + (sqrt(y) + (sqrt(x) + sqrt(z)))));
} else {
tmp = (((sqrt((1.0 + y)) - sqrt(y)) + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - sqrt(x)))) + (((1.0 + z) - z) / (sqrt(z) + t_1))) + (0.5 * 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) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 315000.0d0) then
tmp = 1.0d0 + ((sqrt((1.0d0 + t)) + (t_1 + sqrt((x + 1.0d0)))) - (sqrt(t) + (sqrt(y) + (sqrt(x) + sqrt(z)))))
else
tmp = (((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 + ((x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))) - sqrt(x)))) + (((1.0d0 + z) - z) / (sqrt(z) + t_1))) + (0.5d0 * 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 + z));
double tmp;
if (t <= 315000.0) {
tmp = 1.0 + ((Math.sqrt((1.0 + t)) + (t_1 + Math.sqrt((x + 1.0)))) - (Math.sqrt(t) + (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z)))));
} else {
tmp = (((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - Math.sqrt(x)))) + (((1.0 + z) - z) / (Math.sqrt(z) + t_1))) + (0.5 * 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 + z)) tmp = 0 if t <= 315000.0: tmp = 1.0 + ((math.sqrt((1.0 + t)) + (t_1 + math.sqrt((x + 1.0)))) - (math.sqrt(t) + (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z))))) else: tmp = (((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - math.sqrt(x)))) + (((1.0 + z) - z) / (math.sqrt(z) + t_1))) + (0.5 * 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 + z)) tmp = 0.0 if (t <= 315000.0) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 + sqrt(Float64(x + 1.0)))) - Float64(sqrt(t) + Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z)))))); else tmp = Float64(Float64(Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 + Float64(Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) - sqrt(x)))) + Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(z) + t_1))) + Float64(0.5 * 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 + z));
tmp = 0.0;
if (t <= 315000.0)
tmp = 1.0 + ((sqrt((1.0 + t)) + (t_1 + sqrt((x + 1.0)))) - (sqrt(t) + (sqrt(y) + (sqrt(x) + sqrt(z)))));
else
tmp = (((sqrt((1.0 + y)) - sqrt(y)) + (1.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - sqrt(x)))) + (((1.0 + z) - z) / (sqrt(z) + t_1))) + (0.5 * 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 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 315000.0], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / 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 + z}\\
\mathbf{if}\;t \leq 315000:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + t} + \left(t\_1 + \sqrt{x + 1}\right)\right) - \left(\sqrt{t} + \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 + \left(x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right) - \sqrt{x}\right)\right)\right) + \frac{\left(1 + z\right) - z}{\sqrt{z} + t\_1}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\\
\end{array}
\end{array}
if t < 315000Initial program 96.8%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
Simplified28.5%
if 315000 < t Initial program 85.0%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6490.6%
Simplified90.6%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6448.5%
Simplified48.5%
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6448.9%
Applied egg-rr48.9%
Final simplification39.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (/ 1.0 t))))
(if (<= y 8.2e-11)
(+
(* 0.5 t_1)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+
2.0
(-
(* x (+ 0.5 (* x (+ -0.125 (* x 0.0625)))))
(+ (sqrt x) (sqrt y))))))
(if (<= y 1.05e+145)
(/
(+
(* 0.5 (sqrt t))
(*
t
(+
(sqrt (+ x 1.0))
(- (/ (- (+ 1.0 y) y) (+ (sqrt y) (pow (+ 1.0 y) 0.5))) (sqrt x)))))
t)
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ t_1 (sqrt (/ 1.0 y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 / t));
double tmp;
if (y <= 8.2e-11) {
tmp = (0.5 * t_1) + ((sqrt((1.0 + z)) - sqrt(z)) + (2.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - (sqrt(x) + sqrt(y)))));
} else if (y <= 1.05e+145) {
tmp = ((0.5 * sqrt(t)) + (t * (sqrt((x + 1.0)) + ((((1.0 + y) - y) / (sqrt(y) + pow((1.0 + y), 0.5))) - sqrt(x))))) / t;
} else {
tmp = 0.5 * (sqrt((1.0 / x)) + (t_1 + sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 / t))
if (y <= 8.2d-11) then
tmp = (0.5d0 * t_1) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (2.0d0 + ((x * (0.5d0 + (x * ((-0.125d0) + (x * 0.0625d0))))) - (sqrt(x) + sqrt(y)))))
else if (y <= 1.05d+145) then
tmp = ((0.5d0 * sqrt(t)) + (t * (sqrt((x + 1.0d0)) + ((((1.0d0 + y) - y) / (sqrt(y) + ((1.0d0 + y) ** 0.5d0))) - sqrt(x))))) / t
else
tmp = 0.5d0 * (sqrt((1.0d0 / x)) + (t_1 + sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / t));
double tmp;
if (y <= 8.2e-11) {
tmp = (0.5 * t_1) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (2.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - (Math.sqrt(x) + Math.sqrt(y)))));
} else if (y <= 1.05e+145) {
tmp = ((0.5 * Math.sqrt(t)) + (t * (Math.sqrt((x + 1.0)) + ((((1.0 + y) - y) / (Math.sqrt(y) + Math.pow((1.0 + y), 0.5))) - Math.sqrt(x))))) / t;
} else {
tmp = 0.5 * (Math.sqrt((1.0 / x)) + (t_1 + Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 / t)) tmp = 0 if y <= 8.2e-11: tmp = (0.5 * t_1) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (2.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - (math.sqrt(x) + math.sqrt(y))))) elif y <= 1.05e+145: tmp = ((0.5 * math.sqrt(t)) + (t * (math.sqrt((x + 1.0)) + ((((1.0 + y) - y) / (math.sqrt(y) + math.pow((1.0 + y), 0.5))) - math.sqrt(x))))) / t else: tmp = 0.5 * (math.sqrt((1.0 / x)) + (t_1 + math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 / t)) tmp = 0.0 if (y <= 8.2e-11) tmp = Float64(Float64(0.5 * t_1) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(2.0 + Float64(Float64(x * Float64(0.5 + Float64(x * Float64(-0.125 + Float64(x * 0.0625))))) - Float64(sqrt(x) + sqrt(y)))))); elseif (y <= 1.05e+145) tmp = Float64(Float64(Float64(0.5 * sqrt(t)) + Float64(t * Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(Float64(Float64(1.0 + y) - y) / Float64(sqrt(y) + (Float64(1.0 + y) ^ 0.5))) - sqrt(x))))) / t); else tmp = Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(t_1 + sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / t));
tmp = 0.0;
if (y <= 8.2e-11)
tmp = (0.5 * t_1) + ((sqrt((1.0 + z)) - sqrt(z)) + (2.0 + ((x * (0.5 + (x * (-0.125 + (x * 0.0625))))) - (sqrt(x) + sqrt(y)))));
elseif (y <= 1.05e+145)
tmp = ((0.5 * sqrt(t)) + (t * (sqrt((x + 1.0)) + ((((1.0 + y) - y) / (sqrt(y) + ((1.0 + y) ^ 0.5))) - sqrt(x))))) / t;
else
tmp = 0.5 * (sqrt((1.0 / x)) + (t_1 + sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 8.2e-11], N[(N[(0.5 * t$95$1), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(x * N[(0.5 + N[(x * N[(-0.125 + N[(x * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+145], N[(N[(N[(0.5 * N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(N[(1.0 + y), $MachinePrecision] - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] + N[Power[N[(1.0 + y), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[Sqrt[N[(1.0 / 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{\frac{1}{t}}\\
\mathbf{if}\;y \leq 8.2 \cdot 10^{-11}:\\
\;\;\;\;0.5 \cdot t\_1 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(2 + \left(x \cdot \left(0.5 + x \cdot \left(-0.125 + x \cdot 0.0625\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+145}:\\
\;\;\;\;\frac{0.5 \cdot \sqrt{t} + t \cdot \left(\sqrt{x + 1} + \left(\frac{\left(1 + y\right) - y}{\sqrt{y} + {\left(1 + y\right)}^{0.5}} - \sqrt{x}\right)\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(t\_1 + \sqrt{\frac{1}{y}}\right)\right)\\
\end{array}
\end{array}
if y < 8.2000000000000001e-11Initial program 96.2%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6455.8%
Simplified55.8%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6426.2%
Simplified26.2%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6426.2%
Simplified26.2%
if 8.2000000000000001e-11 < y < 1.04999999999999995e145Initial program 90.7%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6425.0%
Simplified25.0%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6423.1%
Simplified23.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
Simplified24.2%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6424.4%
Applied egg-rr24.4%
if 1.04999999999999995e145 < y Initial program 79.9%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6418.8%
Simplified18.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6419.6%
Simplified19.6%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6417.1%
Simplified17.1%
Taylor expanded in x around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6421.0%
Simplified21.0%
Final simplification24.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 (+ x 1.0))) (t_2 (sqrt (/ 1.0 t))))
(if (<= z 0.25)
(+ (* 0.5 t_2) (- (+ t_1 2.0) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= z 5.2e+27)
(-
(+ (+ 1.0 t_1) (* 0.5 (+ y (+ t_2 (sqrt (/ 1.0 z))))))
(+ (sqrt x) (sqrt y)))
(/
(+
(* 0.5 (sqrt t))
(*
t
(+
t_1
(- (/ (- (+ 1.0 y) y) (+ (sqrt y) (pow (+ 1.0 y) 0.5))) (sqrt x)))))
t)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((1.0 / t));
double tmp;
if (z <= 0.25) {
tmp = (0.5 * t_2) + ((t_1 + 2.0) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (z <= 5.2e+27) {
tmp = ((1.0 + t_1) + (0.5 * (y + (t_2 + sqrt((1.0 / z)))))) - (sqrt(x) + sqrt(y));
} else {
tmp = ((0.5 * sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (sqrt(y) + pow((1.0 + y), 0.5))) - sqrt(x))))) / t;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((1.0d0 / t))
if (z <= 0.25d0) then
tmp = (0.5d0 * t_2) + ((t_1 + 2.0d0) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (z <= 5.2d+27) then
tmp = ((1.0d0 + t_1) + (0.5d0 * (y + (t_2 + sqrt((1.0d0 / z)))))) - (sqrt(x) + sqrt(y))
else
tmp = ((0.5d0 * sqrt(t)) + (t * (t_1 + ((((1.0d0 + y) - y) / (sqrt(y) + ((1.0d0 + y) ** 0.5d0))) - sqrt(x))))) / t
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = Math.sqrt((1.0 / t));
double tmp;
if (z <= 0.25) {
tmp = (0.5 * t_2) + ((t_1 + 2.0) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (z <= 5.2e+27) {
tmp = ((1.0 + t_1) + (0.5 * (y + (t_2 + Math.sqrt((1.0 / z)))))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = ((0.5 * Math.sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (Math.sqrt(y) + Math.pow((1.0 + y), 0.5))) - Math.sqrt(x))))) / t;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((1.0 / t)) tmp = 0 if z <= 0.25: tmp = (0.5 * t_2) + ((t_1 + 2.0) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif z <= 5.2e+27: tmp = ((1.0 + t_1) + (0.5 * (y + (t_2 + math.sqrt((1.0 / z)))))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = ((0.5 * math.sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (math.sqrt(y) + math.pow((1.0 + y), 0.5))) - math.sqrt(x))))) / t return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(1.0 / t)) tmp = 0.0 if (z <= 0.25) tmp = Float64(Float64(0.5 * t_2) + Float64(Float64(t_1 + 2.0) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (z <= 5.2e+27) tmp = Float64(Float64(Float64(1.0 + t_1) + Float64(0.5 * Float64(y + Float64(t_2 + sqrt(Float64(1.0 / z)))))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(Float64(0.5 * sqrt(t)) + Float64(t * Float64(t_1 + Float64(Float64(Float64(Float64(1.0 + y) - y) / Float64(sqrt(y) + (Float64(1.0 + y) ^ 0.5))) - sqrt(x))))) / t); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = sqrt((1.0 / t));
tmp = 0.0;
if (z <= 0.25)
tmp = (0.5 * t_2) + ((t_1 + 2.0) - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (z <= 5.2e+27)
tmp = ((1.0 + t_1) + (0.5 * (y + (t_2 + sqrt((1.0 / z)))))) - (sqrt(x) + sqrt(y));
else
tmp = ((0.5 * sqrt(t)) + (t * (t_1 + ((((1.0 + y) - y) / (sqrt(y) + ((1.0 + y) ^ 0.5))) - sqrt(x))))) / 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.25], N[(N[(0.5 * t$95$2), $MachinePrecision] + N[(N[(t$95$1 + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+27], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] + N[(0.5 * N[(y + N[(t$95$2 + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t * N[(t$95$1 + N[(N[(N[(N[(1.0 + y), $MachinePrecision] - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] + N[Power[N[(1.0 + y), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{\frac{1}{t}}\\
\mathbf{if}\;z \leq 0.25:\\
\;\;\;\;0.5 \cdot t\_2 + \left(\left(t\_1 + 2\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(1 + t\_1\right) + 0.5 \cdot \left(y + \left(t\_2 + \sqrt{\frac{1}{z}}\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \sqrt{t} + t \cdot \left(t\_1 + \left(\frac{\left(1 + y\right) - y}{\sqrt{y} + {\left(1 + y\right)}^{0.5}} - \sqrt{x}\right)\right)}{t}\\
\end{array}
\end{array}
if z < 0.25Initial program 96.5%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6453.3%
Simplified53.3%
Taylor expanded in z around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6452.9%
Simplified52.9%
Taylor expanded in y around 0
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6418.0%
Simplified18.0%
if 0.25 < z < 5.20000000000000018e27Initial program 76.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified53.3%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6491.0%
Simplified91.0%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
Simplified18.9%
Taylor expanded in y around 0
--lowering--.f64N/A
Simplified18.8%
if 5.20000000000000018e27 < z Initial program 85.8%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6462.6%
Simplified62.6%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6430.4%
Simplified30.4%
Taylor expanded in t around 0
/-lowering-/.f64N/A
Simplified35.8%
+-commutativeN/A
flip--N/A
/-lowering-/.f64N/A
rem-square-sqrtN/A
rem-square-sqrtN/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6435.9%
Applied egg-rr35.9%
Final simplification26.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 (+ x 1.0))))
(if (<= z 0.0145)
(+
(* 0.5 (sqrt (/ 1.0 t)))
(- (+ t_1 2.0) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+
t_1
(-
(+ (sqrt (+ 1.0 y)) (* 0.5 (sqrt (/ 1.0 z))))
(+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (z <= 0.0145) {
tmp = (0.5 * sqrt((1.0 / t))) + ((t_1 + 2.0) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = t_1 + ((sqrt((1.0 + y)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + 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) :: tmp
t_1 = sqrt((x + 1.0d0))
if (z <= 0.0145d0) then
tmp = (0.5d0 * sqrt((1.0d0 / t))) + ((t_1 + 2.0d0) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = t_1 + ((sqrt((1.0d0 + y)) + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(x) + 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((x + 1.0));
double tmp;
if (z <= 0.0145) {
tmp = (0.5 * Math.sqrt((1.0 / t))) + ((t_1 + 2.0) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = t_1 + ((Math.sqrt((1.0 + y)) + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if z <= 0.0145: tmp = (0.5 * math.sqrt((1.0 / t))) + ((t_1 + 2.0) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = t_1 + ((math.sqrt((1.0 + y)) + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 0.0145) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + Float64(Float64(t_1 + 2.0) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(x) + 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((x + 1.0));
tmp = 0.0;
if (z <= 0.0145)
tmp = (0.5 * sqrt((1.0 / t))) + ((t_1 + 2.0) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = t_1 + ((sqrt((1.0 + y)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.0145], N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 0.0145:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{t}} + \left(\left(t\_1 + 2\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 0.0145000000000000007Initial program 96.5%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6453.3%
Simplified53.3%
Taylor expanded in z around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6452.9%
Simplified52.9%
Taylor expanded in y around 0
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6418.0%
Simplified18.0%
if 0.0145000000000000007 < z Initial program 84.8%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified35.7%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6487.7%
Simplified87.7%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6431.6%
Simplified31.6%
Final simplification24.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 (+ x 1.0))))
(if (<= z 0.022)
(+
2.0
(- (+ t_1 (* 0.5 (sqrt (/ 1.0 t)))) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+
t_1
(-
(+ (sqrt (+ 1.0 y)) (* 0.5 (sqrt (/ 1.0 z))))
(+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (z <= 0.022) {
tmp = 2.0 + ((t_1 + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = t_1 + ((sqrt((1.0 + y)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + 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) :: tmp
t_1 = sqrt((x + 1.0d0))
if (z <= 0.022d0) then
tmp = 2.0d0 + ((t_1 + (0.5d0 * sqrt((1.0d0 / t)))) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = t_1 + ((sqrt((1.0d0 + y)) + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(x) + 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((x + 1.0));
double tmp;
if (z <= 0.022) {
tmp = 2.0 + ((t_1 + (0.5 * Math.sqrt((1.0 / t)))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = t_1 + ((Math.sqrt((1.0 + y)) + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if z <= 0.022: tmp = 2.0 + ((t_1 + (0.5 * math.sqrt((1.0 / t)))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = t_1 + ((math.sqrt((1.0 + y)) + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 0.022) tmp = Float64(2.0 + Float64(Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / t)))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(x) + 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((x + 1.0));
tmp = 0.0;
if (z <= 0.022)
tmp = 2.0 + ((t_1 + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = t_1 + ((sqrt((1.0 + y)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(x) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.022], N[(2.0 + N[(N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 0.022:\\
\;\;\;\;2 + \left(\left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 0.021999999999999999Initial program 96.5%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6453.3%
Simplified53.3%
Taylor expanded in z around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6452.9%
Simplified52.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6428.3%
Simplified28.3%
if 0.021999999999999999 < z Initial program 84.8%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified35.7%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6487.7%
Simplified87.7%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6431.6%
Simplified31.6%
Final simplification30.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 (* 0.5 (sqrt (/ 1.0 t)))) (t_2 (sqrt (+ x 1.0))))
(if (<= z 0.062)
(+ 2.0 (- (+ t_2 t_1) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+ t_2 (- (+ (sqrt (+ 1.0 y)) t_1) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * sqrt((1.0 / t));
double t_2 = sqrt((x + 1.0));
double tmp;
if (z <= 0.062) {
tmp = 2.0 + ((t_2 + t_1) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = t_2 + ((sqrt((1.0 + y)) + t_1) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.5d0 * sqrt((1.0d0 / t))
t_2 = sqrt((x + 1.0d0))
if (z <= 0.062d0) then
tmp = 2.0d0 + ((t_2 + t_1) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = t_2 + ((sqrt((1.0d0 + y)) + t_1) - (sqrt(x) + 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 = 0.5 * Math.sqrt((1.0 / t));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (z <= 0.062) {
tmp = 2.0 + ((t_2 + t_1) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = t_2 + ((Math.sqrt((1.0 + y)) + t_1) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 0.5 * math.sqrt((1.0 / t)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if z <= 0.062: tmp = 2.0 + ((t_2 + t_1) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = t_2 + ((math.sqrt((1.0 + y)) + t_1) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(0.5 * sqrt(Float64(1.0 / t))) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 0.062) tmp = Float64(2.0 + Float64(Float64(t_2 + t_1) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + y)) + t_1) - Float64(sqrt(x) + 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 = 0.5 * sqrt((1.0 / t));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (z <= 0.062)
tmp = 2.0 + ((t_2 + t_1) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = t_2 + ((sqrt((1.0 + y)) + t_1) - (sqrt(x) + 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[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.062], N[(2.0 + N[(N[(t$95$2 + t$95$1), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 0.5 \cdot \sqrt{\frac{1}{t}}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 0.062:\\
\;\;\;\;2 + \left(\left(t\_2 + t\_1\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(\sqrt{1 + y} + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 0.062Initial program 96.5%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6453.3%
Simplified53.3%
Taylor expanded in z around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6452.9%
Simplified52.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6428.3%
Simplified28.3%
if 0.062 < z Initial program 84.8%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6460.9%
Simplified60.9%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6428.4%
Simplified28.4%
Final simplification28.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 (+ x 1.0))))
(if (<= z 0.085)
(+
2.0
(- (+ t_1 (* 0.5 (sqrt (/ 1.0 t)))) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (z <= 0.085) {
tmp = 2.0 + ((t_1 + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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) :: tmp
t_1 = sqrt((x + 1.0d0))
if (z <= 0.085d0) then
tmp = 2.0d0 + ((t_1 + (0.5d0 * sqrt((1.0d0 / t)))) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + 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((x + 1.0));
double tmp;
if (z <= 0.085) {
tmp = 2.0 + ((t_1 + (0.5 * Math.sqrt((1.0 / t)))) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if z <= 0.085: tmp = 2.0 + ((t_1 + (0.5 * math.sqrt((1.0 / t)))) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 0.085) tmp = Float64(2.0 + Float64(Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / t)))) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + 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((x + 1.0));
tmp = 0.0;
if (z <= 0.085)
tmp = 2.0 + ((t_1 + (0.5 * sqrt((1.0 / t)))) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 0.085], N[(2.0 + N[(N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 0.085:\\
\;\;\;\;2 + \left(\left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 0.0850000000000000061Initial program 96.5%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6453.3%
Simplified53.3%
Taylor expanded in z around 0
--lowering--.f64N/A
sqrt-lowering-sqrt.f6452.9%
Simplified52.9%
Taylor expanded in y around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6428.3%
Simplified28.3%
if 0.0850000000000000061 < z Initial program 84.8%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6460.9%
Simplified60.9%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6430.9%
Simplified30.9%
Final simplification29.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 520000.0)
(+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(+
(* -0.125 (sqrt (/ 1.0 (* x (* x x)))))
(* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 520000.0) {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + (0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 520000.0d0) then
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = ((-0.125d0) * sqrt((1.0d0 / (x * (x * x))))) + (0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / y)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 520000.0) {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (-0.125 * Math.sqrt((1.0 / (x * (x * x))))) + (0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 520000.0: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (-0.125 * math.sqrt((1.0 / (x * (x * x))))) + (0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / y))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 520000.0) tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / Float64(x * Float64(x * x))))) + Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 520000.0)
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
else
tmp = (-0.125 * sqrt((1.0 / (x * (x * x))))) + (0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 520000.0], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 520000:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{x \cdot \left(x \cdot x\right)}} + 0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\right)\right)\\
\end{array}
\end{array}
if x < 5.2e5Initial program 96.6%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6434.4%
Simplified34.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6435.7%
Simplified35.7%
if 5.2e5 < x Initial program 83.2%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6443.4%
Simplified43.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.9%
Simplified5.9%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.5%
Simplified4.5%
Taylor expanded in x around inf
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified17.3%
Final simplification27.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 460000.0) (+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y)))) (* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 460000.0) {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 460000.0d0) then
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = 0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 460000.0) {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 460000.0: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 460000.0) tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 460000.0)
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
else
tmp = 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 460000.0], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 460000:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\right)\right)\\
\end{array}
\end{array}
if x < 4.6e5Initial program 96.6%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6434.4%
Simplified34.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6435.7%
Simplified35.7%
if 4.6e5 < x Initial program 83.2%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6443.4%
Simplified43.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.9%
Simplified5.9%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.5%
Simplified4.5%
Taylor expanded in x around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6417.3%
Simplified17.3%
Final simplification27.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 320000000.0) (- (sqrt (+ x 1.0)) (sqrt x)) (* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 y)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 320000000.0) {
tmp = sqrt((x + 1.0)) - sqrt(x);
} else {
tmp = 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 320000000.0d0) then
tmp = sqrt((x + 1.0d0)) - sqrt(x)
else
tmp = 0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 320000000.0) {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
} else {
tmp = 0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 320000000.0: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) else: tmp = 0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 320000000.0) tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); else tmp = Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 320000000.0)
tmp = sqrt((x + 1.0)) - sqrt(x);
else
tmp = 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 320000000.0], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 320000000:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{y}}\right)\right)\\
\end{array}
\end{array}
if x < 3.2e8Initial program 96.5%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6434.7%
Simplified34.7%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6430.4%
Simplified30.4%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f6427.3%
Simplified27.3%
if 3.2e8 < x Initial program 83.1%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6443.2%
Simplified43.2%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f645.8%
Simplified5.8%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f644.5%
Simplified4.5%
Taylor expanded in x around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6417.5%
Simplified17.5%
Final simplification23.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 56000000.0) (- (sqrt (+ x 1.0)) (sqrt x)) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 56000000.0) {
tmp = sqrt((x + 1.0)) - sqrt(x);
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 56000000.0d0) then
tmp = sqrt((x + 1.0d0)) - sqrt(x)
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 56000000.0) {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 56000000.0: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 56000000.0) tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 56000000.0)
tmp = sqrt((x + 1.0)) - sqrt(x);
else
tmp = 0.5 * (x ^ -0.5);
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, 56000000.0], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 56000000:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 5.6e7Initial program 96.6%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6434.8%
Simplified34.8%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6430.6%
Simplified30.6%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f6427.5%
Simplified27.5%
if 5.6e7 < x Initial program 83.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6489.0%
Simplified89.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6411.4%
Simplified11.4%
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
pow-flipN/A
pow-lowering-pow.f64N/A
metadata-eval11.4%
Applied egg-rr11.4%
Final simplification20.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 (<= x 7.2e-84) (* 0.5 (sqrt (/ 1.0 z))) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 7.2e-84) {
tmp = 0.5 * sqrt((1.0 / z));
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 7.2d-84) then
tmp = 0.5d0 * sqrt((1.0d0 / z))
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 7.2e-84) {
tmp = 0.5 * Math.sqrt((1.0 / z));
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 7.2e-84: tmp = 0.5 * math.sqrt((1.0 / z)) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 7.2e-84) tmp = Float64(0.5 * sqrt(Float64(1.0 / z))); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 7.2e-84)
tmp = 0.5 * sqrt((1.0 / z));
else
tmp = 0.5 * (x ^ -0.5);
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, 7.2e-84], N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.2 \cdot 10^{-84}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 7.20000000000000007e-84Initial program 96.7%
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
Simplified71.1%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f6446.0%
Simplified46.0%
Taylor expanded in z around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f646.9%
Simplified6.9%
if 7.20000000000000007e-84 < x Initial program 86.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6470.4%
Simplified70.4%
Taylor expanded in x around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6411.1%
Simplified11.1%
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
pow-flipN/A
pow-lowering-pow.f64N/A
metadata-eval11.1%
Applied egg-rr11.1%
Final simplification9.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 2.9e-49) (* 0.5 (sqrt (/ 1.0 y))) (* 0.5 (pow x -0.5))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 2.9e-49) {
tmp = 0.5 * sqrt((1.0 / y));
} else {
tmp = 0.5 * pow(x, -0.5);
}
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 <= 2.9d-49) then
tmp = 0.5d0 * sqrt((1.0d0 / y))
else
tmp = 0.5d0 * (x ** (-0.5d0))
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 <= 2.9e-49) {
tmp = 0.5 * Math.sqrt((1.0 / y));
} else {
tmp = 0.5 * Math.pow(x, -0.5);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 2.9e-49: tmp = 0.5 * math.sqrt((1.0 / y)) else: tmp = 0.5 * math.pow(x, -0.5) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 2.9e-49) tmp = Float64(0.5 * sqrt(Float64(1.0 / y))); else tmp = Float64(0.5 * (x ^ -0.5)); 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 <= 2.9e-49)
tmp = 0.5 * sqrt((1.0 / y));
else
tmp = 0.5 * (x ^ -0.5);
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, 2.9e-49], N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{-49}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{y}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot {x}^{-0.5}\\
\end{array}
\end{array}
if x < 2.9e-49Initial program 97.0%
Taylor expanded in z around inf
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
associate--r+N/A
--lowering--.f64N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6431.4%
Simplified31.4%
Taylor expanded in t around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6426.0%
Simplified26.0%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6417.7%
Simplified17.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f647.3%
Simplified7.3%
if 2.9e-49 < x Initial program 84.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6477.7%
Simplified77.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6411.5%
Simplified11.5%
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
pow-flipN/A
pow-lowering-pow.f64N/A
metadata-eval11.5%
Applied egg-rr11.5%
Final simplification9.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.5 (pow x -0.5)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.5 * pow(x, -0.5);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.5d0 * (x ** (-0.5d0))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.5 * Math.pow(x, -0.5);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 * math.pow(x, -0.5)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 * (x ^ -0.5)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.5 * (x ^ -0.5);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.5 * N[Power[x, -0.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.5 \cdot {x}^{-0.5}
\end{array}
Initial program 90.5%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6444.4%
Simplified44.4%
Taylor expanded in x around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f649.0%
Simplified9.0%
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-divN/A
metadata-evalN/A
pow1/2N/A
pow-flipN/A
pow-lowering-pow.f64N/A
metadata-eval9.0%
Applied egg-rr9.0%
Final simplification9.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ 0.5 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 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 = 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 0.5 / Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 / math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 / sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 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[(0.5 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{0.5}{\sqrt{x}}
\end{array}
Initial program 90.5%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6444.4%
Simplified44.4%
Taylor expanded in x around 0
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f649.0%
Simplified9.0%
sqrt-divN/A
metadata-evalN/A
div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f649.0%
Applied egg-rr9.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* (* x (* x x)) 0.0625))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (x * (x * x)) * 0.0625;
}
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 = (x * (x * x)) * 0.0625d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (x * (x * x)) * 0.0625;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (x * (x * x)) * 0.0625
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(x * Float64(x * x)) * 0.0625) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (x * (x * x)) * 0.0625;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision] * 0.0625), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(x \cdot \left(x \cdot x\right)\right) \cdot 0.0625
\end{array}
Initial program 90.5%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6451.5%
Simplified51.5%
Taylor expanded in x around 0
associate--l+N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6428.4%
Simplified28.4%
Taylor expanded in x around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f643.9%
Simplified3.9%
Final simplification3.9%
(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 2024160
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (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))))