
(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 22 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}
(FPCore (x y z t)
:precision binary64
(+
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ 1.0 x))))
(+
(/ (+ 1.0 (- y y)) (+ (sqrt (+ 1.0 y)) (sqrt y)))
(+
(/ (+ 1.0 (- z z)) (+ (sqrt (+ 1.0 z)) (sqrt z)))
(/ (+ 1.0 (- t t)) (+ (sqrt (+ 1.0 t)) (sqrt t)))))))
double code(double x, double y, double z, double t) {
return ((1.0 + (x - x)) / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (sqrt((1.0 + y)) + sqrt(y))) + (((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + (t - t)) / (sqrt((1.0 + t)) + 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 + (x - x)) / (sqrt(x) + sqrt((1.0d0 + x)))) + (((1.0d0 + (y - y)) / (sqrt((1.0d0 + y)) + sqrt(y))) + (((1.0d0 + (z - z)) / (sqrt((1.0d0 + z)) + sqrt(z))) + ((1.0d0 + (t - t)) / (sqrt((1.0d0 + t)) + sqrt(t)))))
end function
public static double code(double x, double y, double z, double t) {
return ((1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (((1.0 + (z - z)) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + ((1.0 + (t - t)) / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
}
def code(x, y, z, t): return ((1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (((1.0 + (z - z)) / (math.sqrt((1.0 + z)) + math.sqrt(z))) + ((1.0 + (t - t)) / (math.sqrt((1.0 + t)) + math.sqrt(t)))))
function code(x, y, z, t) return Float64(Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(Float64(1.0 + Float64(y - y)) / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(Float64(1.0 + Float64(t - t)) / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))))) end
function tmp = code(x, y, z, t) tmp = ((1.0 + (x - x)) / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (sqrt((1.0 + y)) + sqrt(y))) + (((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + (t - t)) / (sqrt((1.0 + t)) + sqrt(t))))); end
code[x_, y_, z_, t_] := N[(N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(y - y), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1 + \left(z - z\right)}{\sqrt{1 + z} + \sqrt{z}} + \frac{1 + \left(t - t\right)}{\sqrt{1 + t} + \sqrt{t}}\right)\right)
\end{array}
Initial program 91.4%
associate-+l+91.4%
associate-+l+91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
Simplified91.4%
flip--91.3%
rem-square-sqrt74.0%
+-commutative74.0%
rem-square-sqrt91.8%
+-commutative91.8%
+-commutative91.8%
Applied egg-rr91.8%
associate--l+94.1%
Simplified94.1%
flip--94.2%
rem-square-sqrt71.4%
rem-square-sqrt94.5%
+-commutative94.5%
Applied egg-rr94.5%
associate--l+96.0%
+-commutative96.0%
Simplified96.0%
flip--96.0%
rem-square-sqrt74.3%
rem-square-sqrt96.4%
Applied egg-rr96.4%
associate--l+97.5%
Simplified97.5%
flip--97.5%
rem-square-sqrt72.7%
rem-square-sqrt97.7%
Applied egg-rr97.7%
associate--l+99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.0002)
(+
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))
(+ (/ 1.0 (+ t_2 (sqrt z))) (/ 1.0 (+ t_4 (sqrt y)))))
(+
(+
(- t_4 (sqrt y))
(+ (/ (+ 1.0 (- t t)) (+ (sqrt (+ 1.0 t)) (sqrt t))) t_3))
(- t_1 (sqrt x))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.0002) {
tmp = ((1.0 + (x - x)) / (sqrt(x) + t_1)) + ((1.0 / (t_2 + sqrt(z))) + (1.0 / (t_4 + sqrt(y))));
} else {
tmp = ((t_4 - sqrt(y)) + (((1.0 + (t - t)) / (sqrt((1.0 + t)) + sqrt(t))) + t_3)) + (t_1 - sqrt(x));
}
return tmp;
}
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 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.0002d0) then
tmp = ((1.0d0 + (x - x)) / (sqrt(x) + t_1)) + ((1.0d0 / (t_2 + sqrt(z))) + (1.0d0 / (t_4 + sqrt(y))))
else
tmp = ((t_4 - sqrt(y)) + (((1.0d0 + (t - t)) / (sqrt((1.0d0 + t)) + sqrt(t))) + t_3)) + (t_1 - sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.0002) {
tmp = ((1.0 + (x - x)) / (Math.sqrt(x) + t_1)) + ((1.0 / (t_2 + Math.sqrt(z))) + (1.0 / (t_4 + Math.sqrt(y))));
} else {
tmp = ((t_4 - Math.sqrt(y)) + (((1.0 + (t - t)) / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_3)) + (t_1 - Math.sqrt(x));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.0002: tmp = ((1.0 + (x - x)) / (math.sqrt(x) + t_1)) + ((1.0 / (t_2 + math.sqrt(z))) + (1.0 / (t_4 + math.sqrt(y)))) else: tmp = ((t_4 - math.sqrt(y)) + (((1.0 + (t - t)) / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_3)) + (t_1 - math.sqrt(x)) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.0002) tmp = Float64(Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_1)) + Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(1.0 / Float64(t_4 + sqrt(y))))); else tmp = Float64(Float64(Float64(t_4 - sqrt(y)) + Float64(Float64(Float64(1.0 + Float64(t - t)) / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_3)) + Float64(t_1 - sqrt(x))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + x)); t_2 = sqrt((1.0 + z)); t_3 = t_2 - sqrt(z); t_4 = sqrt((1.0 + y)); tmp = 0.0; if (t_3 <= 0.0002) tmp = ((1.0 + (x - x)) / (sqrt(x) + t_1)) + ((1.0 / (t_2 + sqrt(z))) + (1.0 / (t_4 + sqrt(y)))); else tmp = ((t_4 - sqrt(y)) + (((1.0 + (t - t)) / (sqrt((1.0 + t)) + sqrt(t))) + t_3)) + (t_1 - sqrt(x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0002], N[(N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.0002:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1} + \left(\frac{1}{t_2 + \sqrt{z}} + \frac{1}{t_4 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t_4 - \sqrt{y}\right) + \left(\frac{1 + \left(t - t\right)}{\sqrt{1 + t} + \sqrt{t}} + t_3\right)\right) + \left(t_1 - \sqrt{x}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 2.0000000000000001e-4Initial program 86.0%
associate-+l+86.0%
associate-+l+86.0%
+-commutative86.0%
+-commutative86.0%
+-commutative86.0%
Simplified86.0%
flip--86.0%
rem-square-sqrt71.6%
+-commutative71.6%
rem-square-sqrt86.4%
+-commutative86.4%
+-commutative86.4%
Applied egg-rr86.4%
associate--l+90.5%
Simplified90.5%
flip--90.7%
rem-square-sqrt69.9%
rem-square-sqrt91.3%
+-commutative91.3%
Applied egg-rr91.3%
associate--l+93.4%
+-commutative93.4%
Simplified93.4%
flip--93.4%
rem-square-sqrt50.7%
rem-square-sqrt94.3%
Applied egg-rr94.3%
associate--l+96.3%
Simplified96.3%
Taylor expanded in t around inf 51.9%
+-commutative51.9%
Simplified51.9%
if 2.0000000000000001e-4 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
flip--98.7%
rem-square-sqrt71.6%
rem-square-sqrt99.1%
Applied egg-rr97.3%
associate--l+99.9%
Simplified98.1%
Final simplification74.7%
(FPCore (x y z t)
:precision binary64
(+
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ 1.0 x))))
(+
(/ (+ 1.0 (- y y)) (+ (sqrt (+ 1.0 y)) (sqrt y)))
(+
(/ (+ 1.0 (- z z)) (+ (sqrt (+ 1.0 z)) (sqrt z)))
(- (sqrt (+ 1.0 t)) (sqrt t))))))
double code(double x, double y, double z, double t) {
return ((1.0 + (x - x)) / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (sqrt((1.0 + y)) + sqrt(y))) + (((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - 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 + (x - x)) / (sqrt(x) + sqrt((1.0d0 + x)))) + (((1.0d0 + (y - y)) / (sqrt((1.0d0 + y)) + sqrt(y))) + (((1.0d0 + (z - z)) / (sqrt((1.0d0 + z)) + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t))))
end function
public static double code(double x, double y, double z, double t) {
return ((1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (((1.0 + (z - z)) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
}
def code(x, y, z, t): return ((1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (((1.0 + (z - z)) / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))))
function code(x, y, z, t) return Float64(Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(Float64(1.0 + Float64(y - y)) / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))) end
function tmp = code(x, y, z, t) tmp = ((1.0 + (x - x)) / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 + (y - y)) / (sqrt((1.0 + y)) + sqrt(y))) + (((1.0 + (z - z)) / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)))); end
code[x_, y_, z_, t_] := N[(N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(y - y), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1 + \left(z - z\right)}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\end{array}
Initial program 91.4%
associate-+l+91.4%
associate-+l+91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
Simplified91.4%
flip--91.3%
rem-square-sqrt74.0%
+-commutative74.0%
rem-square-sqrt91.8%
+-commutative91.8%
+-commutative91.8%
Applied egg-rr91.8%
associate--l+94.1%
Simplified94.1%
flip--94.2%
rem-square-sqrt71.4%
rem-square-sqrt94.5%
+-commutative94.5%
Applied egg-rr94.5%
associate--l+96.0%
+-commutative96.0%
Simplified96.0%
flip--96.0%
rem-square-sqrt74.3%
rem-square-sqrt96.4%
Applied egg-rr96.4%
associate--l+97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (+ (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (+ (sqrt x) t_1)))
(if (<= y 4.2e-30)
(+
(/ (+ 1.0 (- x x)) t_3)
(+ (/ 1.0 t_2) (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= y 2.15e+23)
(+
(+ t_1 (sqrt (+ 1.0 y)))
(- (/ (+ 1.0 (- z z)) t_2) (+ (sqrt x) (sqrt y))))
(/ 1.0 t_3)))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z)) + sqrt(z);
double t_3 = sqrt(x) + t_1;
double tmp;
if (y <= 4.2e-30) {
tmp = ((1.0 + (x - x)) / t_3) + ((1.0 / t_2) + (1.0 + (sqrt((1.0 + t)) - sqrt(t))));
} else if (y <= 2.15e+23) {
tmp = (t_1 + sqrt((1.0 + y))) + (((1.0 + (z - z)) / t_2) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / t_3;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z)) + sqrt(z)
t_3 = sqrt(x) + t_1
if (y <= 4.2d-30) then
tmp = ((1.0d0 + (x - x)) / t_3) + ((1.0d0 / t_2) + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))))
else if (y <= 2.15d+23) then
tmp = (t_1 + sqrt((1.0d0 + y))) + (((1.0d0 + (z - z)) / t_2) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z)) + Math.sqrt(z);
double t_3 = Math.sqrt(x) + t_1;
double tmp;
if (y <= 4.2e-30) {
tmp = ((1.0 + (x - x)) / t_3) + ((1.0 / t_2) + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else if (y <= 2.15e+23) {
tmp = (t_1 + Math.sqrt((1.0 + y))) + (((1.0 + (z - z)) / t_2) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) + math.sqrt(z) t_3 = math.sqrt(x) + t_1 tmp = 0 if y <= 4.2e-30: tmp = ((1.0 + (x - x)) / t_3) + ((1.0 / t_2) + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)))) elif y <= 2.15e+23: tmp = (t_1 + math.sqrt((1.0 + y))) + (((1.0 + (z - z)) / t_2) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / t_3 return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(1.0 + z)) + sqrt(z)) t_3 = Float64(sqrt(x) + t_1) tmp = 0.0 if (y <= 4.2e-30) tmp = Float64(Float64(Float64(1.0 + Float64(x - x)) / t_3) + Float64(Float64(1.0 / t_2) + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); elseif (y <= 2.15e+23) tmp = Float64(Float64(t_1 + sqrt(Float64(1.0 + y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / t_2) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / t_3); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + x)); t_2 = sqrt((1.0 + z)) + sqrt(z); t_3 = sqrt(x) + t_1; tmp = 0.0; if (y <= 4.2e-30) tmp = ((1.0 + (x - x)) / t_3) + ((1.0 / t_2) + (1.0 + (sqrt((1.0 + t)) - sqrt(t)))); elseif (y <= 2.15e+23) tmp = (t_1 + sqrt((1.0 + y))) + (((1.0 + (z - z)) / t_2) - (sqrt(x) + sqrt(y))); else tmp = 1.0 / t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[y, 4.2e-30], N[(N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision] + N[(N[(1.0 / t$95$2), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+23], N[(N[(t$95$1 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z} + \sqrt{z}\\
t_3 := \sqrt{x} + t_1\\
\mathbf{if}\;y \leq 4.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{t_3} + \left(\frac{1}{t_2} + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+23}:\\
\;\;\;\;\left(t_1 + \sqrt{1 + y}\right) + \left(\frac{1 + \left(z - z\right)}{t_2} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_3}\\
\end{array}
\end{array}
if y < 4.2000000000000004e-30Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--97.0%
rem-square-sqrt80.2%
+-commutative80.2%
rem-square-sqrt97.7%
+-commutative97.7%
+-commutative97.7%
Applied egg-rr97.7%
associate--l+98.3%
Simplified98.3%
flip--98.3%
rem-square-sqrt98.3%
rem-square-sqrt98.3%
+-commutative98.3%
Applied egg-rr98.3%
associate--l+98.3%
+-commutative98.3%
Simplified98.3%
flip--98.3%
rem-square-sqrt72.7%
rem-square-sqrt98.4%
Applied egg-rr98.4%
associate--l+99.1%
Simplified99.1%
Taylor expanded in y around 0 59.4%
associate--l+81.1%
+-commutative81.1%
metadata-eval81.1%
+-inverses81.1%
+-commutative81.1%
associate-+r-99.0%
+-commutative99.0%
associate-+r+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
if 4.2000000000000004e-30 < y < 2.1499999999999999e23Initial program 90.4%
associate-+l+90.4%
+-commutative90.4%
associate-+r-42.5%
associate-+l-33.1%
+-commutative33.1%
associate--l+33.1%
+-commutative33.1%
Simplified22.8%
add-cbrt-cube_binary6422.0%
Applied rewrite-once22.0%
Simplified29.3%
Taylor expanded in t around inf 7.7%
associate-+r+7.7%
+-commutative7.7%
+-commutative7.7%
associate-+r+7.7%
associate--l+12.2%
+-commutative12.2%
+-commutative12.2%
associate--r+25.1%
+-commutative25.1%
Simplified25.1%
flip--98.2%
rem-square-sqrt82.7%
rem-square-sqrt99.5%
Applied egg-rr25.1%
associate--l+99.5%
Simplified25.1%
if 2.1499999999999999e23 < y Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l-66.4%
associate-+r-56.7%
Simplified27.0%
Taylor expanded in t around inf 19.8%
Taylor expanded in z around inf 18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in y around inf 18.0%
flip--18.0%
div-inv18.0%
+-commutative18.0%
+-commutative18.0%
rem-square-sqrt18.5%
+-commutative18.5%
rem-square-sqrt18.0%
Applied egg-rr18.0%
associate-*r/18.0%
*-rgt-identity18.0%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
Simplified23.4%
Final simplification56.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 3.4e+26)
(+
(+
1.0
(+ (/ (+ 1.0 (- t t)) (+ (sqrt (+ 1.0 t)) (sqrt t))) (- t_1 (sqrt z))))
(- t_2 (sqrt x)))
(+
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_2))
(+ (/ 1.0 (+ t_1 (sqrt z))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 3.4e+26) {
tmp = (1.0 + (((1.0 + (t - t)) / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z)))) + (t_2 - sqrt(x));
} else {
tmp = ((1.0 + (x - x)) / (sqrt(x) + t_2)) + ((1.0 / (t_1 + sqrt(z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (t <= 3.4d+26) then
tmp = (1.0d0 + (((1.0d0 + (t - t)) / (sqrt((1.0d0 + t)) + sqrt(t))) + (t_1 - sqrt(z)))) + (t_2 - sqrt(x))
else
tmp = ((1.0d0 + (x - x)) / (sqrt(x) + t_2)) + ((1.0d0 / (t_1 + sqrt(z))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 3.4e+26) {
tmp = (1.0 + (((1.0 + (t - t)) / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (t_1 - Math.sqrt(z)))) + (t_2 - Math.sqrt(x));
} else {
tmp = ((1.0 + (x - x)) / (Math.sqrt(x) + t_2)) + ((1.0 / (t_1 + Math.sqrt(z))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 3.4e+26: tmp = (1.0 + (((1.0 + (t - t)) / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (t_1 - math.sqrt(z)))) + (t_2 - math.sqrt(x)) else: tmp = ((1.0 + (x - x)) / (math.sqrt(x) + t_2)) + ((1.0 / (t_1 + math.sqrt(z))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 3.4e+26) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(1.0 + Float64(t - t)) / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(t_1 - sqrt(z)))) + Float64(t_2 - sqrt(x))); else tmp = Float64(Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_2)) + Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (t <= 3.4e+26) tmp = (1.0 + (((1.0 + (t - t)) / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z)))) + (t_2 - sqrt(x)); else tmp = ((1.0 + (x - x)) / (sqrt(x) + t_2)) + ((1.0 / (t_1 + sqrt(z))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.4e+26], N[(N[(1.0 + N[(N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 3.4 \cdot 10^{+26}:\\
\;\;\;\;\left(1 + \left(\frac{1 + \left(t - t\right)}{\sqrt{1 + t} + \sqrt{t}} + \left(t_1 - \sqrt{z}\right)\right)\right) + \left(t_2 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_2} + \left(\frac{1}{t_1 + \sqrt{z}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\end{array}
\end{array}
if t < 3.4000000000000003e26Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
flip--98.2%
rem-square-sqrt97.8%
rem-square-sqrt98.6%
Applied egg-rr96.4%
associate--l+99.8%
Simplified97.4%
Taylor expanded in y around 0 55.1%
if 3.4000000000000003e26 < t Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
+-commutative85.8%
Simplified85.8%
flip--85.8%
rem-square-sqrt70.9%
+-commutative70.9%
rem-square-sqrt86.3%
+-commutative86.3%
+-commutative86.3%
Applied egg-rr86.3%
associate--l+90.6%
Simplified90.6%
flip--90.6%
rem-square-sqrt71.2%
rem-square-sqrt91.3%
+-commutative91.3%
Applied egg-rr91.3%
associate--l+93.8%
+-commutative93.8%
Simplified93.8%
flip--93.8%
rem-square-sqrt77.0%
rem-square-sqrt94.9%
Applied egg-rr94.9%
associate--l+96.5%
Simplified96.5%
Taylor expanded in t around inf 96.5%
+-commutative96.5%
Simplified96.5%
Final simplification73.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.2e-215)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(if (<= y 2.15e+23)
(+
(+ t_2 (sqrt (+ 1.0 y)))
(- (/ (+ 1.0 (- z z)) (+ t_1 (sqrt z))) (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ (sqrt x) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else if (y <= 2.15e+23) {
tmp = (t_2 + sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + sqrt(z))) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.2d-215) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else if (y <= 2.15d+23) then
tmp = (t_2 + sqrt((1.0d0 + y))) + (((1.0d0 + (z - z)) / (t_1 + sqrt(z))) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else if (y <= 2.15e+23) {
tmp = (t_2 + Math.sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + Math.sqrt(z))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.2e-215: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) elif y <= 2.15e+23: tmp = (t_2 + math.sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + math.sqrt(z))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.2e-215) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); elseif (y <= 2.15e+23) tmp = Float64(Float64(t_2 + sqrt(Float64(1.0 + y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / Float64(t_1 + sqrt(z))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 4.2e-215) tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t)))); elseif (y <= 2.15e+23) tmp = (t_2 + sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + sqrt(z))) - (sqrt(x) + sqrt(y))); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.2e-215], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+23], N[(N[(t$95$2 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.2 \cdot 10^{-215}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+23}:\\
\;\;\;\;\left(t_2 + \sqrt{1 + y}\right) + \left(\frac{1 + \left(z - z\right)}{t_1 + \sqrt{z}} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.2e-215Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l-61.4%
associate-+r-57.9%
Simplified37.6%
Taylor expanded in x around 0 30.4%
associate--l+51.0%
associate--l+52.6%
associate-+r+52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in y around 0 30.4%
+-commutative30.4%
associate--l+64.9%
associate--l+61.2%
+-commutative61.2%
Simplified61.2%
if 4.2e-215 < y < 2.1499999999999999e23Initial program 96.4%
associate-+l+96.4%
+-commutative96.4%
associate-+r-53.3%
associate-+l-46.2%
+-commutative46.2%
associate--l+46.2%
+-commutative46.2%
Simplified32.1%
add-cbrt-cube_binary6431.6%
Applied rewrite-once31.6%
Simplified38.1%
Taylor expanded in t around inf 14.6%
associate-+r+14.6%
+-commutative14.6%
+-commutative14.6%
associate-+r+14.6%
associate--l+25.8%
+-commutative25.8%
+-commutative25.8%
associate--r+28.8%
+-commutative28.8%
Simplified28.8%
flip--98.7%
rem-square-sqrt76.5%
rem-square-sqrt99.1%
Applied egg-rr29.0%
associate--l+99.1%
Simplified29.0%
if 2.1499999999999999e23 < y Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l-66.4%
associate-+r-56.7%
Simplified27.0%
Taylor expanded in t around inf 19.8%
Taylor expanded in z around inf 18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in y around inf 18.0%
flip--18.0%
div-inv18.0%
+-commutative18.0%
+-commutative18.0%
rem-square-sqrt18.5%
+-commutative18.5%
rem-square-sqrt18.0%
Applied egg-rr18.0%
associate-*r/18.0%
*-rgt-identity18.0%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
Simplified23.4%
Final simplification31.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.6e-127)
(+
(+
1.0
(+ (/ (+ 1.0 (- t t)) (+ (sqrt (+ 1.0 t)) (sqrt t))) (- t_1 (sqrt z))))
(- t_2 (sqrt x)))
(if (<= y 2.15e+23)
(+
(+ t_2 (sqrt (+ 1.0 y)))
(- (/ (+ 1.0 (- z z)) (+ t_1 (sqrt z))) (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ (sqrt x) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.6e-127) {
tmp = (1.0 + (((1.0 + (t - t)) / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z)))) + (t_2 - sqrt(x));
} else if (y <= 2.15e+23) {
tmp = (t_2 + sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + sqrt(z))) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.6d-127) then
tmp = (1.0d0 + (((1.0d0 + (t - t)) / (sqrt((1.0d0 + t)) + sqrt(t))) + (t_1 - sqrt(z)))) + (t_2 - sqrt(x))
else if (y <= 2.15d+23) then
tmp = (t_2 + sqrt((1.0d0 + y))) + (((1.0d0 + (z - z)) / (t_1 + sqrt(z))) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.6e-127) {
tmp = (1.0 + (((1.0 + (t - t)) / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (t_1 - Math.sqrt(z)))) + (t_2 - Math.sqrt(x));
} else if (y <= 2.15e+23) {
tmp = (t_2 + Math.sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + Math.sqrt(z))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.6e-127: tmp = (1.0 + (((1.0 + (t - t)) / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (t_1 - math.sqrt(z)))) + (t_2 - math.sqrt(x)) elif y <= 2.15e+23: tmp = (t_2 + math.sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + math.sqrt(z))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.6e-127) tmp = Float64(Float64(1.0 + Float64(Float64(Float64(1.0 + Float64(t - t)) / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(t_1 - sqrt(z)))) + Float64(t_2 - sqrt(x))); elseif (y <= 2.15e+23) tmp = Float64(Float64(t_2 + sqrt(Float64(1.0 + y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / Float64(t_1 + sqrt(z))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 4.6e-127) tmp = (1.0 + (((1.0 + (t - t)) / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z)))) + (t_2 - sqrt(x)); elseif (y <= 2.15e+23) tmp = (t_2 + sqrt((1.0 + y))) + (((1.0 + (z - z)) / (t_1 + sqrt(z))) - (sqrt(x) + sqrt(y))); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.6e-127], N[(N[(1.0 + N[(N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e+23], N[(N[(t$95$2 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.6 \cdot 10^{-127}:\\
\;\;\;\;\left(1 + \left(\frac{1 + \left(t - t\right)}{\sqrt{1 + t} + \sqrt{t}} + \left(t_1 - \sqrt{z}\right)\right)\right) + \left(t_2 - \sqrt{x}\right)\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+23}:\\
\;\;\;\;\left(t_2 + \sqrt{1 + y}\right) + \left(\frac{1 + \left(z - z\right)}{t_1 + \sqrt{z}} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.60000000000000038e-127Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--99.5%
rem-square-sqrt79.0%
rem-square-sqrt99.5%
Applied egg-rr97.1%
associate--l+99.9%
Simplified97.5%
Taylor expanded in y around 0 97.5%
if 4.60000000000000038e-127 < y < 2.1499999999999999e23Initial program 94.6%
associate-+l+94.6%
+-commutative94.6%
associate-+r-47.1%
associate-+l-39.3%
+-commutative39.3%
associate--l+39.3%
+-commutative39.3%
Simplified24.3%
add-cbrt-cube_binary6423.8%
Applied rewrite-once23.8%
Simplified30.9%
Taylor expanded in t around inf 14.3%
associate-+r+14.3%
+-commutative14.3%
+-commutative14.3%
associate-+r+14.3%
associate--l+23.5%
+-commutative23.5%
+-commutative23.5%
associate--r+28.2%
+-commutative28.2%
Simplified28.2%
flip--97.9%
rem-square-sqrt76.5%
rem-square-sqrt98.7%
Applied egg-rr28.5%
associate--l+98.7%
Simplified28.5%
if 2.1499999999999999e23 < y Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l-66.4%
associate-+r-56.7%
Simplified27.0%
Taylor expanded in t around inf 19.8%
Taylor expanded in z around inf 18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in y around inf 18.0%
flip--18.0%
div-inv18.0%
+-commutative18.0%
+-commutative18.0%
rem-square-sqrt18.5%
+-commutative18.5%
rem-square-sqrt18.0%
Applied egg-rr18.0%
associate-*r/18.0%
*-rgt-identity18.0%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
Simplified23.4%
Final simplification46.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.2e-215)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(if (<= y 2.5e+18)
(+
(+ t_2 (sqrt (+ 1.0 y)))
(+ (- t_1 (sqrt z)) (/ (- x y) (- (sqrt y) (sqrt x)))))
(/ 1.0 (+ (sqrt x) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else if (y <= 2.5e+18) {
tmp = (t_2 + sqrt((1.0 + y))) + ((t_1 - sqrt(z)) + ((x - y) / (sqrt(y) - sqrt(x))));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.2d-215) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else if (y <= 2.5d+18) then
tmp = (t_2 + sqrt((1.0d0 + y))) + ((t_1 - sqrt(z)) + ((x - y) / (sqrt(y) - sqrt(x))))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else if (y <= 2.5e+18) {
tmp = (t_2 + Math.sqrt((1.0 + y))) + ((t_1 - Math.sqrt(z)) + ((x - y) / (Math.sqrt(y) - Math.sqrt(x))));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.2e-215: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) elif y <= 2.5e+18: tmp = (t_2 + math.sqrt((1.0 + y))) + ((t_1 - math.sqrt(z)) + ((x - y) / (math.sqrt(y) - math.sqrt(x)))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.2e-215) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); elseif (y <= 2.5e+18) tmp = Float64(Float64(t_2 + sqrt(Float64(1.0 + y))) + Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(x - y) / Float64(sqrt(y) - sqrt(x))))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 4.2e-215) tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t)))); elseif (y <= 2.5e+18) tmp = (t_2 + sqrt((1.0 + y))) + ((t_1 - sqrt(z)) + ((x - y) / (sqrt(y) - sqrt(x)))); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.2e-215], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+18], N[(N[(t$95$2 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(x - y), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.2 \cdot 10^{-215}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+18}:\\
\;\;\;\;\left(t_2 + \sqrt{1 + y}\right) + \left(\left(t_1 - \sqrt{z}\right) + \frac{x - y}{\sqrt{y} - \sqrt{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.2e-215Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l-61.4%
associate-+r-57.9%
Simplified37.6%
Taylor expanded in x around 0 30.4%
associate--l+51.0%
associate--l+52.6%
associate-+r+52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in y around 0 30.4%
+-commutative30.4%
associate--l+64.9%
associate--l+61.2%
+-commutative61.2%
Simplified61.2%
if 4.2e-215 < y < 2.5e18Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
associate-+r-53.0%
associate-+l-45.8%
+-commutative45.8%
associate--l+45.8%
+-commutative45.8%
Simplified32.3%
add-cbrt-cube_binary6431.8%
Applied rewrite-once31.8%
Simplified37.6%
Taylor expanded in t around inf 14.7%
associate-+r+14.7%
+-commutative14.7%
+-commutative14.7%
associate-+r+14.7%
associate--l+25.9%
+-commutative25.9%
+-commutative25.9%
associate--r+28.2%
+-commutative28.2%
Simplified28.2%
flip-+20.2%
div-sub20.2%
rem-square-sqrt20.2%
rem-square-sqrt20.3%
Applied egg-rr27.6%
div-sub20.3%
Simplified27.6%
if 2.5e18 < y Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l-66.5%
associate-+r-56.3%
Simplified26.8%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt19.0%
+-commutative19.0%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.8%
+-inverses23.8%
metadata-eval23.8%
Simplified23.8%
Final simplification31.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.2e-215)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(if (<= y 1.7e+41)
(+ t_2 (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- (- t_1 (sqrt z)) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else if (y <= 1.7e+41) {
tmp = t_2 + ((sqrt((1.0 + y)) - sqrt(y)) + ((t_1 - sqrt(z)) - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.2d-215) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else if (y <= 1.7d+41) then
tmp = t_2 + ((sqrt((1.0d0 + y)) - sqrt(y)) + ((t_1 - sqrt(z)) - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else if (y <= 1.7e+41) {
tmp = t_2 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + ((t_1 - Math.sqrt(z)) - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.2e-215: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) elif y <= 1.7e+41: tmp = t_2 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + ((t_1 - math.sqrt(z)) - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.2e-215) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); elseif (y <= 1.7e+41) tmp = Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(Float64(t_1 - sqrt(z)) - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 4.2e-215) tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t)))); elseif (y <= 1.7e+41) tmp = t_2 + ((sqrt((1.0 + y)) - sqrt(y)) + ((t_1 - sqrt(z)) - sqrt(x))); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.2e-215], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+41], N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.2 \cdot 10^{-215}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+41}:\\
\;\;\;\;t_2 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(t_1 - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.2e-215Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l-61.4%
associate-+r-57.9%
Simplified37.6%
Taylor expanded in x around 0 30.4%
associate--l+51.0%
associate--l+52.6%
associate-+r+52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in y around 0 30.4%
+-commutative30.4%
associate--l+64.9%
associate--l+61.2%
+-commutative61.2%
Simplified61.2%
if 4.2e-215 < y < 1.69999999999999999e41Initial program 95.4%
associate-+l+95.4%
+-commutative95.4%
associate-+r-58.0%
associate-+l-47.5%
+-commutative47.5%
associate--l+47.5%
+-commutative47.5%
Simplified33.3%
Taylor expanded in t around inf 29.0%
associate--l+28.7%
Simplified28.7%
if 1.69999999999999999e41 < y Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l-66.2%
associate-+r-55.6%
Simplified25.1%
Taylor expanded in t around inf 18.9%
Taylor expanded in z around inf 18.8%
+-commutative18.8%
Simplified18.8%
Taylor expanded in y around inf 18.2%
flip--18.2%
div-inv18.2%
+-commutative18.2%
+-commutative18.2%
rem-square-sqrt18.6%
+-commutative18.6%
rem-square-sqrt18.2%
Applied egg-rr18.2%
associate-*r/18.2%
*-rgt-identity18.2%
associate--l+24.0%
+-inverses24.0%
metadata-eval24.0%
Simplified24.0%
Final simplification31.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.8e-215)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(if (<= y 4.4e+18)
(+ (+ t_2 (sqrt (+ 1.0 y))) (- (- t_1 (sqrt z)) (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ (sqrt x) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.8e-215) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else if (y <= 4.4e+18) {
tmp = (t_2 + sqrt((1.0 + y))) + ((t_1 - sqrt(z)) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.8d-215) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else if (y <= 4.4d+18) then
tmp = (t_2 + sqrt((1.0d0 + y))) + ((t_1 - sqrt(z)) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.8e-215) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else if (y <= 4.4e+18) {
tmp = (t_2 + Math.sqrt((1.0 + y))) + ((t_1 - Math.sqrt(z)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.8e-215: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) elif y <= 4.4e+18: tmp = (t_2 + math.sqrt((1.0 + y))) + ((t_1 - math.sqrt(z)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.8e-215) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); elseif (y <= 4.4e+18) tmp = Float64(Float64(t_2 + sqrt(Float64(1.0 + y))) + Float64(Float64(t_1 - sqrt(z)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 4.8e-215) tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t)))); elseif (y <= 4.4e+18) tmp = (t_2 + sqrt((1.0 + y))) + ((t_1 - sqrt(z)) - (sqrt(x) + sqrt(y))); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.8e-215], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+18], N[(N[(t$95$2 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-215}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+18}:\\
\;\;\;\;\left(t_2 + \sqrt{1 + y}\right) + \left(\left(t_1 - \sqrt{z}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.8000000000000002e-215Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l-61.4%
associate-+r-57.9%
Simplified37.6%
Taylor expanded in x around 0 30.4%
associate--l+51.0%
associate--l+52.6%
associate-+r+52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in y around 0 30.4%
+-commutative30.4%
associate--l+64.9%
associate--l+61.2%
+-commutative61.2%
Simplified61.2%
if 4.8000000000000002e-215 < y < 4.4e18Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
associate-+r-53.0%
associate-+l-45.8%
+-commutative45.8%
associate--l+45.8%
+-commutative45.8%
Simplified32.3%
add-cbrt-cube_binary6431.8%
Applied rewrite-once31.8%
Simplified37.6%
Taylor expanded in t around inf 14.7%
associate-+r+14.7%
+-commutative14.7%
+-commutative14.7%
associate-+r+14.7%
associate--l+25.9%
+-commutative25.9%
+-commutative25.9%
associate--r+28.2%
+-commutative28.2%
Simplified28.2%
if 4.4e18 < y Initial program 86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l+86.4%
+-commutative86.4%
associate-+l-66.5%
associate-+r-56.3%
Simplified26.8%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt19.0%
+-commutative19.0%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.8%
+-inverses23.8%
metadata-eval23.8%
Simplified23.8%
Final simplification31.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 1.7e-214)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(if (<= y 42000000000.0)
(+ (+ t_2 (sqrt (+ 1.0 y))) (- (- t_1 (sqrt z)) (sqrt y)))
(/ 1.0 (+ (sqrt x) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 1.7e-214) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else if (y <= 42000000000.0) {
tmp = (t_2 + sqrt((1.0 + y))) + ((t_1 - sqrt(z)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 1.7d-214) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else if (y <= 42000000000.0d0) then
tmp = (t_2 + sqrt((1.0d0 + y))) + ((t_1 - sqrt(z)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 1.7e-214) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else if (y <= 42000000000.0) {
tmp = (t_2 + Math.sqrt((1.0 + y))) + ((t_1 - Math.sqrt(z)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 1.7e-214: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) elif y <= 42000000000.0: tmp = (t_2 + math.sqrt((1.0 + y))) + ((t_1 - math.sqrt(z)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 1.7e-214) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); elseif (y <= 42000000000.0) tmp = Float64(Float64(t_2 + sqrt(Float64(1.0 + y))) + Float64(Float64(t_1 - sqrt(z)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 1.7e-214) tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t)))); elseif (y <= 42000000000.0) tmp = (t_2 + sqrt((1.0 + y))) + ((t_1 - sqrt(z)) - sqrt(y)); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.7e-214], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 42000000000.0], N[(N[(t$95$2 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{-214}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 42000000000:\\
\;\;\;\;\left(t_2 + \sqrt{1 + y}\right) + \left(\left(t_1 - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 1.7e-214Initial program 95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+l-62.3%
associate-+r-58.9%
Simplified37.2%
Taylor expanded in x around 0 29.7%
associate--l+50.2%
associate--l+51.8%
associate-+r+51.8%
+-commutative51.8%
Simplified51.8%
Taylor expanded in y around 0 29.7%
+-commutative29.7%
associate--l+63.8%
associate--l+62.1%
+-commutative62.1%
Simplified62.1%
if 1.7e-214 < y < 4.2e10Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-52.1%
associate-+l-44.7%
+-commutative44.7%
associate--l+44.7%
+-commutative44.7%
Simplified30.7%
add-cbrt-cube_binary6430.2%
Applied rewrite-once30.2%
Simplified36.2%
Taylor expanded in t around inf 14.9%
associate-+r+14.9%
+-commutative14.9%
+-commutative14.9%
associate-+r+14.9%
associate--l+26.2%
+-commutative26.2%
+-commutative26.2%
associate--r+28.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in x around 0 28.5%
if 4.2e10 < y Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l-66.5%
associate-+r-56.5%
Simplified27.3%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt18.9%
+-commutative18.9%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
Simplified23.7%
Final simplification31.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.3e-215)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(if (<= y 1.65e-23)
(+ 2.0 (- t_1 (+ (sqrt y) (sqrt z))))
(if (<= y 3.6e+15)
(+ t_2 (- (sqrt (+ 1.0 y)) (/ (- y x) (- (sqrt y) (sqrt x)))))
(/ 1.0 (+ (sqrt x) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.3e-215) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else if (y <= 1.65e-23) {
tmp = 2.0 + (t_1 - (sqrt(y) + sqrt(z)));
} else if (y <= 3.6e+15) {
tmp = t_2 + (sqrt((1.0 + y)) - ((y - x) / (sqrt(y) - sqrt(x))));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.3d-215) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else if (y <= 1.65d-23) then
tmp = 2.0d0 + (t_1 - (sqrt(y) + sqrt(z)))
else if (y <= 3.6d+15) then
tmp = t_2 + (sqrt((1.0d0 + y)) - ((y - x) / (sqrt(y) - sqrt(x))))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.3e-215) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else if (y <= 1.65e-23) {
tmp = 2.0 + (t_1 - (Math.sqrt(y) + Math.sqrt(z)));
} else if (y <= 3.6e+15) {
tmp = t_2 + (Math.sqrt((1.0 + y)) - ((y - x) / (Math.sqrt(y) - Math.sqrt(x))));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.3e-215: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) elif y <= 1.65e-23: tmp = 2.0 + (t_1 - (math.sqrt(y) + math.sqrt(z))) elif y <= 3.6e+15: tmp = t_2 + (math.sqrt((1.0 + y)) - ((y - x) / (math.sqrt(y) - math.sqrt(x)))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.3e-215) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); elseif (y <= 1.65e-23) tmp = Float64(2.0 + Float64(t_1 - Float64(sqrt(y) + sqrt(z)))); elseif (y <= 3.6e+15) tmp = Float64(t_2 + Float64(sqrt(Float64(1.0 + y)) - Float64(Float64(y - x) / Float64(sqrt(y) - sqrt(x))))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 4.3e-215) tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t)))); elseif (y <= 1.65e-23) tmp = 2.0 + (t_1 - (sqrt(y) + sqrt(z))); elseif (y <= 3.6e+15) tmp = t_2 + (sqrt((1.0 + y)) - ((y - x) / (sqrt(y) - sqrt(x)))); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e-215], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-23], N[(2.0 + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+15], N[(t$95$2 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[(y - x), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-215}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-23}:\\
\;\;\;\;2 + \left(t_1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+15}:\\
\;\;\;\;t_2 + \left(\sqrt{1 + y} - \frac{y - x}{\sqrt{y} - \sqrt{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.30000000000000024e-215Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l-61.4%
associate-+r-57.9%
Simplified37.6%
Taylor expanded in x around 0 30.4%
associate--l+51.0%
associate--l+52.6%
associate-+r+52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in y around 0 30.4%
+-commutative30.4%
associate--l+64.9%
associate--l+61.2%
+-commutative61.2%
Simplified61.2%
if 4.30000000000000024e-215 < y < 1.6500000000000001e-23Initial program 98.3%
associate-+l+98.3%
+-commutative98.3%
associate-+l+98.3%
+-commutative98.3%
associate-+l-54.4%
associate-+r-51.1%
Simplified18.0%
Taylor expanded in t around inf 21.3%
Taylor expanded in y around 0 21.3%
Taylor expanded in x around 0 27.9%
associate--l+54.7%
+-commutative54.7%
Simplified54.7%
if 1.6500000000000001e-23 < y < 3.6e15Initial program 91.1%
associate-+l+91.1%
+-commutative91.1%
associate-+l+91.1%
+-commutative91.1%
associate-+l-50.5%
associate-+r-46.4%
Simplified10.0%
Taylor expanded in t around inf 9.8%
Taylor expanded in z around inf 21.2%
+-commutative21.2%
Simplified21.2%
flip-+21.1%
div-sub21.1%
rem-square-sqrt21.2%
rem-square-sqrt21.9%
Applied egg-rr21.9%
div-sub21.9%
Simplified21.9%
if 3.6e15 < y Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l-66.4%
associate-+r-56.3%
Simplified27.1%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt18.9%
+-commutative18.9%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.8%
+-inverses23.8%
metadata-eval23.8%
Simplified23.8%
Final simplification38.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.2e-215)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(if (<= y 2.05e-35)
(+ 2.0 (- t_1 (+ (sqrt y) (sqrt z))))
(if (<= y 4.5e+15)
(- (- (+ t_2 (sqrt (+ 1.0 y))) (sqrt y)) (sqrt x))
(/ 1.0 (+ (sqrt x) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else if (y <= 2.05e-35) {
tmp = 2.0 + (t_1 - (sqrt(y) + sqrt(z)));
} else if (y <= 4.5e+15) {
tmp = ((t_2 + sqrt((1.0 + y))) - sqrt(y)) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.2d-215) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else if (y <= 2.05d-35) then
tmp = 2.0d0 + (t_1 - (sqrt(y) + sqrt(z)))
else if (y <= 4.5d+15) then
tmp = ((t_2 + sqrt((1.0d0 + y))) - sqrt(y)) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.2e-215) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else if (y <= 2.05e-35) {
tmp = 2.0 + (t_1 - (Math.sqrt(y) + Math.sqrt(z)));
} else if (y <= 4.5e+15) {
tmp = ((t_2 + Math.sqrt((1.0 + y))) - Math.sqrt(y)) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.2e-215: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) elif y <= 2.05e-35: tmp = 2.0 + (t_1 - (math.sqrt(y) + math.sqrt(z))) elif y <= 4.5e+15: tmp = ((t_2 + math.sqrt((1.0 + y))) - math.sqrt(y)) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.2e-215) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); elseif (y <= 2.05e-35) tmp = Float64(2.0 + Float64(t_1 - Float64(sqrt(y) + sqrt(z)))); elseif (y <= 4.5e+15) tmp = Float64(Float64(Float64(t_2 + sqrt(Float64(1.0 + y))) - sqrt(y)) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + z)); t_2 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 4.2e-215) tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t)))); elseif (y <= 2.05e-35) tmp = 2.0 + (t_1 - (sqrt(y) + sqrt(z))); elseif (y <= 4.5e+15) tmp = ((t_2 + sqrt((1.0 + y))) - sqrt(y)) - sqrt(x); else tmp = 1.0 / (sqrt(x) + t_2); end tmp_2 = tmp; end
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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.2e-215], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-35], N[(2.0 + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[(N[(t$95$2 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.2 \cdot 10^{-215}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-35}:\\
\;\;\;\;2 + \left(t_1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(t_2 + \sqrt{1 + y}\right) - \sqrt{y}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.2e-215Initial program 95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l+95.1%
+-commutative95.1%
associate-+l-61.4%
associate-+r-57.9%
Simplified37.6%
Taylor expanded in x around 0 30.4%
associate--l+51.0%
associate--l+52.6%
associate-+r+52.6%
+-commutative52.6%
Simplified52.6%
Taylor expanded in y around 0 30.4%
+-commutative30.4%
associate--l+64.9%
associate--l+61.2%
+-commutative61.2%
Simplified61.2%
if 4.2e-215 < y < 2.05000000000000013e-35Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l-54.6%
associate-+r-51.1%
Simplified18.8%
Taylor expanded in t around inf 21.2%
Taylor expanded in y around 0 21.2%
Taylor expanded in x around 0 27.5%
associate--l+54.6%
+-commutative54.6%
Simplified54.6%
if 2.05000000000000013e-35 < y < 4.5e15Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l-50.6%
associate-+r-47.3%
Simplified9.0%
Taylor expanded in t around inf 12.5%
Taylor expanded in z around inf 18.5%
+-commutative18.5%
Simplified18.5%
associate-+r-18.5%
associate--r+18.5%
+-commutative18.5%
+-commutative18.5%
Applied egg-rr18.5%
if 4.5e15 < y Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l-66.4%
associate-+r-56.3%
Simplified27.1%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt18.9%
+-commutative18.9%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.8%
+-inverses23.8%
metadata-eval23.8%
Simplified23.8%
Final simplification37.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 3.5e-23)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z))))
(if (<= y 4.5e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ (sqrt x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 3.5e-23) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z)));
} else if (y <= 4.5e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 3.5d-23) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z)))
else if (y <= 4.5d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 3.5e-23) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z)));
} else if (y <= 4.5e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 3.5e-23: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z))) elif y <= 4.5e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 3.5e-23) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z)))); elseif (y <= 4.5e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 3.5e-23) tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))); elseif (y <= 4.5e+15) tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))); else tmp = 1.0 / (sqrt(x) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.5e-23], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], 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], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 3.5 \cdot 10^{-23}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 3.49999999999999993e-23Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l-56.9%
associate-+r-53.6%
Simplified25.1%
Taylor expanded in t around inf 21.4%
Taylor expanded in y around 0 21.4%
Taylor expanded in x around 0 24.5%
associate--l+51.9%
+-commutative51.9%
Simplified51.9%
if 3.49999999999999993e-23 < y < 4.5e15Initial program 91.1%
associate-+l+91.1%
+-commutative91.1%
associate-+l+91.1%
+-commutative91.1%
associate-+l-50.5%
associate-+r-46.4%
Simplified10.0%
Taylor expanded in t around inf 9.8%
Taylor expanded in z around inf 21.2%
+-commutative21.2%
Simplified21.2%
if 4.5e15 < y Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l-66.4%
associate-+r-56.3%
Simplified27.1%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt18.9%
+-commutative18.9%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.8%
+-inverses23.8%
metadata-eval23.8%
Simplified23.8%
Final simplification36.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 3.2e-23)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z))))
(if (<= y 1.6e+41)
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- t_1 (sqrt x)))
(/ 1.0 (+ (sqrt x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 3.2e-23) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z)));
} else if (y <= 1.6e+41) {
tmp = (sqrt((1.0 + y)) - sqrt(y)) + (t_1 - sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 3.2d-23) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z)))
else if (y <= 1.6d+41) then
tmp = (sqrt((1.0d0 + y)) - sqrt(y)) + (t_1 - sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 3.2e-23) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z)));
} else if (y <= 1.6e+41) {
tmp = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (t_1 - Math.sqrt(x));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 3.2e-23: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z))) elif y <= 1.6e+41: tmp = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (t_1 - math.sqrt(x)) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 3.2e-23) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z)))); elseif (y <= 1.6e+41) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(t_1 - sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 3.2e-23) tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))); elseif (y <= 1.6e+41) tmp = (sqrt((1.0 + y)) - sqrt(y)) + (t_1 - sqrt(x)); else tmp = 1.0 / (sqrt(x) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.2e-23], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+41], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 3.2 \cdot 10^{-23}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+41}:\\
\;\;\;\;\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(t_1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 3.19999999999999976e-23Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l-56.9%
associate-+r-53.6%
Simplified25.1%
Taylor expanded in t around inf 21.4%
Taylor expanded in y around 0 21.4%
Taylor expanded in x around 0 24.5%
associate--l+51.9%
+-commutative51.9%
Simplified51.9%
if 3.19999999999999976e-23 < y < 1.60000000000000005e41Initial program 89.1%
associate-+l+89.1%
+-commutative89.1%
associate-+l+89.1%
+-commutative89.1%
associate-+l-58.9%
associate-+r-53.5%
Simplified24.8%
Taylor expanded in t around inf 19.7%
Taylor expanded in z around inf 20.9%
+-commutative20.9%
Simplified20.9%
+-commutative20.9%
associate--r+20.9%
associate-+l-32.7%
+-commutative32.7%
Applied egg-rr32.7%
if 1.60000000000000005e41 < y Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l-66.2%
associate-+r-55.6%
Simplified25.1%
Taylor expanded in t around inf 18.9%
Taylor expanded in z around inf 18.8%
+-commutative18.8%
Simplified18.8%
Taylor expanded in y around inf 18.2%
flip--18.2%
div-inv18.2%
+-commutative18.2%
+-commutative18.2%
rem-square-sqrt18.6%
+-commutative18.6%
rem-square-sqrt18.2%
Applied egg-rr18.2%
associate-*r/18.2%
*-rgt-identity18.2%
associate--l+24.0%
+-inverses24.0%
metadata-eval24.0%
Simplified24.0%
Final simplification37.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 2.05e-35)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z))))
(if (<= y 5e+14)
(- (- (+ t_1 (sqrt (+ 1.0 y))) (sqrt y)) (sqrt x))
(/ 1.0 (+ (sqrt x) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 2.05e-35) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z)));
} else if (y <= 5e+14) {
tmp = ((t_1 + sqrt((1.0 + y))) - sqrt(y)) - sqrt(x);
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 2.05d-35) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z)))
else if (y <= 5d+14) then
tmp = ((t_1 + sqrt((1.0d0 + y))) - sqrt(y)) - sqrt(x)
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 2.05e-35) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z)));
} else if (y <= 5e+14) {
tmp = ((t_1 + Math.sqrt((1.0 + y))) - Math.sqrt(y)) - Math.sqrt(x);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 2.05e-35: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z))) elif y <= 5e+14: tmp = ((t_1 + math.sqrt((1.0 + y))) - math.sqrt(y)) - math.sqrt(x) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 2.05e-35) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z)))); elseif (y <= 5e+14) tmp = Float64(Float64(Float64(t_1 + sqrt(Float64(1.0 + y))) - sqrt(y)) - sqrt(x)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + x)); tmp = 0.0; if (y <= 2.05e-35) tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))); elseif (y <= 5e+14) tmp = ((t_1 + sqrt((1.0 + y))) - sqrt(y)) - sqrt(x); else tmp = 1.0 / (sqrt(x) + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.05e-35], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+14], N[(N[(N[(t$95$1 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 2.05 \cdot 10^{-35}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+14}:\\
\;\;\;\;\left(\left(t_1 + \sqrt{1 + y}\right) - \sqrt{y}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 2.05000000000000013e-35Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l-57.1%
associate-+r-53.7%
Simplified25.8%
Taylor expanded in t around inf 21.3%
Taylor expanded in y around 0 21.3%
Taylor expanded in x around 0 24.1%
associate--l+51.7%
+-commutative51.7%
Simplified51.7%
if 2.05000000000000013e-35 < y < 5e14Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l-50.6%
associate-+r-47.3%
Simplified9.0%
Taylor expanded in t around inf 12.5%
Taylor expanded in z around inf 18.5%
+-commutative18.5%
Simplified18.5%
associate-+r-18.5%
associate--r+18.5%
+-commutative18.5%
+-commutative18.5%
Applied egg-rr18.5%
if 5e14 < y Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+l-66.4%
associate-+r-56.3%
Simplified27.1%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt18.9%
+-commutative18.9%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.8%
+-inverses23.8%
metadata-eval23.8%
Simplified23.8%
Final simplification35.4%
(FPCore (x y z t)
:precision binary64
(if (<= y 2.45e-23)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z))))
(if (<= y 42000000000.0)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.45e-23) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z)));
} else if (y <= 42000000000.0) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.45d-23) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z)))
else if (y <= 42000000000.0d0) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.45e-23) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z)));
} else if (y <= 42000000000.0) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.45e-23: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z))) elif y <= 42000000000.0: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.45e-23) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z)))); elseif (y <= 42000000000.0) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.45e-23) tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))); elseif (y <= 42000000000.0) tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y)); else tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.45e-23], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 42000000000.0], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{-23}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 42000000000:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.4499999999999999e-23Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l-56.9%
associate-+r-53.6%
Simplified25.1%
Taylor expanded in t around inf 21.4%
Taylor expanded in y around 0 21.4%
Taylor expanded in x around 0 24.5%
associate--l+51.9%
+-commutative51.9%
Simplified51.9%
if 2.4499999999999999e-23 < y < 4.2e10Initial program 92.1%
associate-+l+92.1%
+-commutative92.1%
associate-+l+92.1%
+-commutative92.1%
associate-+l-49.0%
associate-+r-44.6%
Simplified7.3%
Taylor expanded in t around inf 9.2%
Taylor expanded in z around inf 21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in x around 0 49.2%
associate--l+49.2%
Simplified49.2%
if 4.2e10 < y Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l-66.5%
associate-+r-56.5%
Simplified27.3%
Taylor expanded in t around inf 20.3%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
Taylor expanded in y around inf 18.5%
flip--18.5%
div-inv18.5%
+-commutative18.5%
+-commutative18.5%
rem-square-sqrt18.9%
+-commutative18.9%
rem-square-sqrt18.5%
Applied egg-rr18.5%
associate-*r/18.5%
*-rgt-identity18.5%
associate--l+23.7%
+-inverses23.7%
metadata-eval23.7%
Simplified23.7%
Final simplification37.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x)))) (if (<= y 6.8) (+ 1.0 t_1) t_1)))
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 6.8) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 6.8d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 6.8) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 6.8: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 6.8) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = sqrt((1.0 + x)) - sqrt(x); tmp = 0.0; if (y <= 6.8) tmp = 1.0 + t_1; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.8], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 6.8:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 6.79999999999999982Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+l-57.4%
associate-+r-54.2%
Simplified23.6%
Taylor expanded in t around inf 20.2%
Taylor expanded in z around inf 21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in y around 0 20.8%
associate--l+36.1%
Simplified36.1%
if 6.79999999999999982 < y Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l-64.7%
associate-+r-54.7%
Simplified26.5%
Taylor expanded in t around inf 20.0%
Taylor expanded in z around inf 19.7%
+-commutative19.7%
Simplified19.7%
Taylor expanded in y around inf 18.2%
Final simplification26.9%
(FPCore (x y z t) :precision binary64 (if (<= z 0.35) (- 3.0 (+ (sqrt y) (sqrt z))) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.35) {
tmp = 3.0 - (sqrt(y) + sqrt(z));
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.35d0) then
tmp = 3.0d0 - (sqrt(y) + sqrt(z))
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.35) {
tmp = 3.0 - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 0.35: tmp = 3.0 - (math.sqrt(y) + math.sqrt(z)) else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 0.35) tmp = Float64(3.0 - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 0.35) tmp = 3.0 - (sqrt(y) + sqrt(z)); else tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 0.35], N[(3.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.35:\\
\;\;\;\;3 - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.34999999999999998Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+l-57.9%
associate-+r-54.4%
Simplified34.4%
Taylor expanded in t around inf 21.1%
Taylor expanded in y around 0 14.4%
Taylor expanded in z around 0 14.4%
Taylor expanded in x around 0 21.0%
+-commutative21.0%
Simplified21.0%
if 0.34999999999999998 < z Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+l-64.3%
associate-+r-54.5%
Simplified16.1%
Taylor expanded in t around inf 19.1%
Taylor expanded in z around inf 28.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in x around 0 33.6%
associate--l+54.7%
Simplified54.7%
Final simplification38.3%
(FPCore (x y z t) :precision binary64 (if (<= z 1.5) (- 3.0 (+ (sqrt y) (sqrt z))) (- (+ 1.0 (* x 0.5)) (sqrt x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5) {
tmp = 3.0 - (sqrt(y) + sqrt(z));
} else {
tmp = (1.0 + (x * 0.5)) - sqrt(x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.5d0) then
tmp = 3.0d0 - (sqrt(y) + sqrt(z))
else
tmp = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5) {
tmp = 3.0 - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.5: tmp = 3.0 - (math.sqrt(y) + math.sqrt(z)) else: tmp = (1.0 + (x * 0.5)) - math.sqrt(x) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.5) tmp = Float64(3.0 - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.5) tmp = 3.0 - (sqrt(y) + sqrt(z)); else tmp = (1.0 + (x * 0.5)) - sqrt(x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.5], N[(3.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5:\\
\;\;\;\;3 - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if z < 1.5Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+l-57.6%
associate-+r-54.0%
Simplified34.3%
Taylor expanded in t around inf 21.1%
Taylor expanded in y around 0 14.3%
Taylor expanded in z around 0 14.3%
Taylor expanded in x around 0 20.9%
+-commutative20.9%
Simplified20.9%
if 1.5 < z Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
associate-+l+86.0%
+-commutative86.0%
associate-+l-64.6%
associate-+r-54.9%
Simplified16.1%
Taylor expanded in t around inf 19.1%
Taylor expanded in z around inf 28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in y around inf 17.9%
Taylor expanded in x around 0 18.4%
Final simplification19.6%
(FPCore (x y z t) :precision binary64 (if (<= z 1.5) (- 3.0 (+ (sqrt y) (sqrt z))) (- (sqrt (+ 1.0 x)) (sqrt x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5) {
tmp = 3.0 - (sqrt(y) + sqrt(z));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.5d0) then
tmp = 3.0d0 - (sqrt(y) + sqrt(z))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5) {
tmp = 3.0 - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.5: tmp = 3.0 - (math.sqrt(y) + math.sqrt(z)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.5) tmp = Float64(3.0 - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.5) tmp = 3.0 - (sqrt(y) + sqrt(z)); else tmp = sqrt((1.0 + x)) - sqrt(x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.5], N[(3.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5:\\
\;\;\;\;3 - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if z < 1.5Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+l-57.6%
associate-+r-54.0%
Simplified34.3%
Taylor expanded in t around inf 21.1%
Taylor expanded in y around 0 14.3%
Taylor expanded in z around 0 14.3%
Taylor expanded in x around 0 20.9%
+-commutative20.9%
Simplified20.9%
if 1.5 < z Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
associate-+l+86.0%
+-commutative86.0%
associate-+l-64.6%
associate-+r-54.9%
Simplified16.1%
Taylor expanded in t around inf 19.1%
Taylor expanded in z around inf 28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in y around inf 17.9%
Final simplification19.4%
(FPCore (x y z t) :precision binary64 (- (+ 1.0 (* x 0.5)) (sqrt x)))
double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - sqrt(x);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end function
public static double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - Math.sqrt(x);
}
def code(x, y, z, t): return (1.0 + (x * 0.5)) - math.sqrt(x)
function code(x, y, z, t) return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) end
function tmp = code(x, y, z, t) tmp = (1.0 + (x * 0.5)) - sqrt(x); end
code[x_, y_, z_, t_] := N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
Initial program 91.4%
associate-+l+91.4%
+-commutative91.4%
associate-+l+91.4%
+-commutative91.4%
associate-+l-61.1%
associate-+r-54.4%
Simplified25.1%
Taylor expanded in t around inf 20.1%
Taylor expanded in z around inf 20.4%
+-commutative20.4%
Simplified20.4%
Taylor expanded in y around inf 14.4%
Taylor expanded in x around 0 15.1%
Final simplification15.1%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2023297
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))