
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ (/ y (+ y x)) (+ (+ y x) 1.0)) (/ x (+ y x))))
double code(double x, double y) {
return ((y / (y + x)) / ((y + x) + 1.0)) * (x / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + x)) / ((y + x) + 1.0d0)) * (x / (y + x))
end function
public static double code(double x, double y) {
return ((y / (y + x)) / ((y + x) + 1.0)) * (x / (y + x));
}
def code(x, y): return ((y / (y + x)) / ((y + x) + 1.0)) * (x / (y + x))
function code(x, y) return Float64(Float64(Float64(y / Float64(y + x)) / Float64(Float64(y + x) + 1.0)) * Float64(x / Float64(y + x))) end
function tmp = code(x, y) tmp = ((y / (y + x)) / ((y + x) + 1.0)) * (x / (y + x)); end
code[x_, y_] := N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + x}}{\left(y + x\right) + 1} \cdot \frac{x}{y + x}
\end{array}
Initial program 64.7%
*-commutative64.7%
associate-*l*64.7%
times-frac91.0%
+-commutative91.0%
distribute-lft-in90.9%
*-rgt-identity90.9%
pow290.9%
Applied egg-rr90.9%
associate-*r/91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
unpow291.0%
Applied egg-rr91.0%
distribute-rgt1-in91.0%
times-frac99.8%
Applied egg-rr99.8%
(FPCore (x y)
:precision binary64
(if (<= x -5.6e+68)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= x -0.034)
(* x (/ y (* (+ x (+ y 1.0)) (* (+ y x) (+ y x)))))
(/ (* (/ y (+ y x)) (/ x (+ y 1.0))) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -5.6e+68) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (x <= -0.034) {
tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))));
} else {
tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.6d+68)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (x <= (-0.034d0)) then
tmp = x * (y / ((x + (y + 1.0d0)) * ((y + x) * (y + x))))
else
tmp = ((y / (y + x)) * (x / (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.6e+68) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (x <= -0.034) {
tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))));
} else {
tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.6e+68: tmp = (y / (x + 1.0)) / (y + x) elif x <= -0.034: tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x)))) else: tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -5.6e+68) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (x <= -0.034) tmp = Float64(x * Float64(y / Float64(Float64(x + Float64(y + 1.0)) * Float64(Float64(y + x) * Float64(y + x))))); else tmp = Float64(Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(y + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.6e+68) tmp = (y / (x + 1.0)) / (y + x); elseif (x <= -0.034) tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x)))); else tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.6e+68], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -0.034], N[(x * N[(y / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;x \leq -0.034:\\
\;\;\;\;x \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x} \cdot \frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -5.6e68Initial program 55.5%
Taylor expanded in x around inf 55.5%
Taylor expanded in x around inf 55.5%
associate-/l*74.2%
associate-*l*74.2%
+-commutative74.2%
Applied egg-rr74.2%
associate-*r/55.5%
associate-*r*55.5%
*-commutative55.5%
+-commutative55.5%
times-frac79.8%
+-commutative79.8%
associate-*l/79.8%
times-frac85.6%
*-inverses85.6%
Simplified85.6%
if -5.6e68 < x < -0.034000000000000002Initial program 65.2%
associate-/l*80.2%
associate-+l+80.2%
Simplified80.2%
if -0.034000000000000002 < x Initial program 67.0%
Taylor expanded in x around 0 64.0%
*-un-lft-identity64.0%
associate-*l*64.0%
+-commutative64.0%
times-frac63.9%
*-commutative63.9%
+-commutative63.9%
Applied egg-rr63.9%
+-commutative63.9%
*-commutative63.9%
times-frac84.3%
+-commutative84.3%
Simplified84.3%
*-commutative84.3%
+-commutative84.3%
div-inv84.5%
frac-times64.0%
*-commutative64.0%
+-commutative64.0%
times-frac84.5%
Applied egg-rr84.5%
Final simplification84.4%
(FPCore (x y)
:precision binary64
(if (<= x -3.5e-12)
(/ (/ y (+ x 1.0)) (+ y x))
(if (<= x 9.5e-269)
(* (/ 1.0 (+ y x)) (* y (/ x (+ y x))))
(/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -3.5e-12) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (x <= 9.5e-269) {
tmp = (1.0 / (y + x)) * (y * (x / (y + x)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-3.5d-12)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else if (x <= 9.5d-269) then
tmp = (1.0d0 / (y + x)) * (y * (x / (y + x)))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.5e-12) {
tmp = (y / (x + 1.0)) / (y + x);
} else if (x <= 9.5e-269) {
tmp = (1.0 / (y + x)) * (y * (x / (y + x)));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.5e-12: tmp = (y / (x + 1.0)) / (y + x) elif x <= 9.5e-269: tmp = (1.0 / (y + x)) * (y * (x / (y + x))) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.5e-12) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); elseif (x <= 9.5e-269) tmp = Float64(Float64(1.0 / Float64(y + x)) * Float64(y * Float64(x / Float64(y + x)))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.5e-12) tmp = (y / (x + 1.0)) / (y + x); elseif (x <= 9.5e-269) tmp = (1.0 / (y + x)) * (y * (x / (y + x))); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.5e-12], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-269], N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-269}:\\
\;\;\;\;\frac{1}{y + x} \cdot \left(y \cdot \frac{x}{y + x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -3.5e-12Initial program 58.8%
Taylor expanded in x around inf 57.2%
Taylor expanded in x around inf 52.8%
associate-/l*69.7%
associate-*l*69.8%
+-commutative69.8%
Applied egg-rr69.8%
associate-*r/52.8%
associate-*r*52.8%
*-commutative52.8%
+-commutative52.8%
times-frac75.0%
+-commutative75.0%
associate-*l/75.1%
times-frac75.0%
*-inverses75.0%
Simplified75.0%
if -3.5e-12 < x < 9.5000000000000006e-269Initial program 63.9%
Taylor expanded in x around 0 63.9%
*-un-lft-identity63.9%
associate-*l*63.9%
+-commutative63.9%
times-frac72.4%
*-commutative72.4%
+-commutative72.4%
Applied egg-rr72.4%
+-commutative72.4%
*-commutative72.4%
times-frac99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in y around 0 79.1%
if 9.5000000000000006e-269 < x Initial program 68.4%
associate-/l*80.6%
associate-+l+80.6%
Simplified80.6%
Taylor expanded in x around 0 43.7%
+-commutative43.7%
Simplified43.7%
*-un-lft-identity43.7%
*-commutative43.7%
times-frac48.5%
Applied egg-rr48.5%
*-commutative48.5%
Simplified48.5%
un-div-inv48.6%
Applied egg-rr48.6%
Final simplification63.5%
(FPCore (x y)
:precision binary64
(if (<= y 2.1e-119)
(/ (/ y x) (+ x 1.0))
(if (<= y 1.8e+154)
(/ x (+ (+ y x) (* (+ y x) (+ y x))))
(* (/ x (+ y 1.0)) (/ 1.0 (+ y x))))))
double code(double x, double y) {
double tmp;
if (y <= 2.1e-119) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1.8e+154) {
tmp = x / ((y + x) + ((y + x) * (y + x)));
} else {
tmp = (x / (y + 1.0)) * (1.0 / (y + x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.1d-119) then
tmp = (y / x) / (x + 1.0d0)
else if (y <= 1.8d+154) then
tmp = x / ((y + x) + ((y + x) * (y + x)))
else
tmp = (x / (y + 1.0d0)) * (1.0d0 / (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.1e-119) {
tmp = (y / x) / (x + 1.0);
} else if (y <= 1.8e+154) {
tmp = x / ((y + x) + ((y + x) * (y + x)));
} else {
tmp = (x / (y + 1.0)) * (1.0 / (y + x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.1e-119: tmp = (y / x) / (x + 1.0) elif y <= 1.8e+154: tmp = x / ((y + x) + ((y + x) * (y + x))) else: tmp = (x / (y + 1.0)) * (1.0 / (y + x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.1e-119) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); elseif (y <= 1.8e+154) tmp = Float64(x / Float64(Float64(y + x) + Float64(Float64(y + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(y + 1.0)) * Float64(1.0 / Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.1e-119) tmp = (y / x) / (x + 1.0); elseif (y <= 1.8e+154) tmp = x / ((y + x) + ((y + x) * (y + x))); else tmp = (x / (y + 1.0)) * (1.0 / (y + x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.1e-119], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+154], N[(x / N[(N[(y + x), $MachinePrecision] + N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{-119}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+154}:\\
\;\;\;\;\frac{x}{\left(y + x\right) + \left(y + x\right) \cdot \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + 1} \cdot \frac{1}{y + x}\\
\end{array}
\end{array}
if y < 2.1e-119Initial program 66.6%
associate-/l*75.7%
associate-+l+75.7%
Simplified75.7%
Taylor expanded in y around 0 55.1%
associate-/r*55.8%
+-commutative55.8%
Simplified55.8%
if 2.1e-119 < y < 1.8e154Initial program 65.7%
*-commutative65.7%
associate-*l*65.7%
times-frac94.0%
+-commutative94.0%
distribute-lft-in93.9%
*-rgt-identity93.9%
pow293.9%
Applied egg-rr93.9%
associate-*r/94.0%
+-commutative94.0%
+-commutative94.0%
+-commutative94.0%
Simplified94.0%
unpow294.0%
Applied egg-rr94.0%
Taylor expanded in y around inf 79.8%
if 1.8e154 < y Initial program 51.7%
Taylor expanded in x around 0 51.7%
*-un-lft-identity51.7%
associate-*l*51.7%
+-commutative51.7%
times-frac51.7%
*-commutative51.7%
+-commutative51.7%
Applied egg-rr51.7%
+-commutative51.7%
*-commutative51.7%
times-frac76.3%
+-commutative76.3%
Simplified76.3%
Taylor expanded in x around 0 76.1%
+-commutative76.1%
Simplified76.1%
Final simplification63.1%
(FPCore (x y) :precision binary64 (if (<= x -230000.0) (/ (/ y (+ x 1.0)) (+ y x)) (/ (* (/ y (+ y x)) (/ x (+ y 1.0))) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -230000.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-230000.0d0)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = ((y / (y + x)) * (x / (y + 1.0d0))) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -230000.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -230000.0: tmp = (y / (x + 1.0)) / (y + x) else: tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -230000.0) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(y + 1.0))) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -230000.0) tmp = (y / (x + 1.0)) / (y + x); else tmp = ((y / (y + x)) * (x / (y + 1.0))) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -230000.0], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -230000:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x} \cdot \frac{x}{y + 1}}{y + x}\\
\end{array}
\end{array}
if x < -2.3e5Initial program 57.8%
Taylor expanded in x around inf 57.8%
Taylor expanded in x around inf 57.7%
associate-/l*76.3%
associate-*l*76.3%
+-commutative76.3%
Applied egg-rr76.3%
associate-*r/57.7%
associate-*r*57.7%
*-commutative57.7%
+-commutative57.7%
times-frac82.1%
+-commutative82.1%
associate-*l/82.2%
times-frac82.1%
*-inverses82.1%
Simplified82.1%
if -2.3e5 < x Initial program 66.9%
Taylor expanded in x around 0 63.9%
*-un-lft-identity63.9%
associate-*l*63.9%
+-commutative63.9%
times-frac64.3%
*-commutative64.3%
+-commutative64.3%
Applied egg-rr64.3%
+-commutative64.3%
*-commutative64.3%
times-frac84.5%
+-commutative84.5%
Simplified84.5%
*-commutative84.5%
+-commutative84.5%
div-inv84.6%
frac-times64.3%
*-commutative64.3%
+-commutative64.3%
times-frac84.6%
Applied egg-rr84.6%
Final simplification84.0%
(FPCore (x y) :precision binary64 (if (<= x -28500000.0) (/ (/ y (+ x 1.0)) (+ y x)) (* (/ y (+ y x)) (/ (/ x (+ y x)) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -28500000.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (y / (y + x)) * ((x / (y + x)) / (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-28500000.0d0)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (y / (y + x)) * ((x / (y + x)) / (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -28500000.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (y / (y + x)) * ((x / (y + x)) / (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -28500000.0: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (y / (y + x)) * ((x / (y + x)) / (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -28500000.0) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -28500000.0) tmp = (y / (x + 1.0)) / (y + x); else tmp = (y / (y + x)) * ((x / (y + x)) / (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -28500000.0], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -28500000:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{y + 1}\\
\end{array}
\end{array}
if x < -2.85e7Initial program 57.8%
Taylor expanded in x around inf 57.8%
Taylor expanded in x around inf 57.7%
associate-/l*76.3%
associate-*l*76.3%
+-commutative76.3%
Applied egg-rr76.3%
associate-*r/57.7%
associate-*r*57.7%
*-commutative57.7%
+-commutative57.7%
times-frac82.1%
+-commutative82.1%
associate-*l/82.2%
times-frac82.1%
*-inverses82.1%
Simplified82.1%
if -2.85e7 < x Initial program 66.9%
Taylor expanded in x around 0 63.9%
*-commutative63.9%
associate-*l*63.9%
+-commutative63.9%
times-frac83.4%
+-commutative83.4%
Applied egg-rr83.4%
+-commutative83.4%
associate-/r*84.6%
+-commutative84.6%
Simplified84.6%
Final simplification84.0%
(FPCore (x y) :precision binary64 (if (or (<= y -18000.0) (not (<= y 1.95e-118))) (/ x (* y (+ x 1.0))) (/ 1.0 (/ x y))))
double code(double x, double y) {
double tmp;
if ((y <= -18000.0) || !(y <= 1.95e-118)) {
tmp = x / (y * (x + 1.0));
} else {
tmp = 1.0 / (x / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-18000.0d0)) .or. (.not. (y <= 1.95d-118))) then
tmp = x / (y * (x + 1.0d0))
else
tmp = 1.0d0 / (x / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -18000.0) || !(y <= 1.95e-118)) {
tmp = x / (y * (x + 1.0));
} else {
tmp = 1.0 / (x / y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -18000.0) or not (y <= 1.95e-118): tmp = x / (y * (x + 1.0)) else: tmp = 1.0 / (x / y) return tmp
function code(x, y) tmp = 0.0 if ((y <= -18000.0) || !(y <= 1.95e-118)) tmp = Float64(x / Float64(y * Float64(x + 1.0))); else tmp = Float64(1.0 / Float64(x / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -18000.0) || ~((y <= 1.95e-118))) tmp = x / (y * (x + 1.0)); else tmp = 1.0 / (x / y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -18000.0], N[Not[LessEqual[y, 1.95e-118]], $MachinePrecision]], N[(x / N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -18000 \lor \neg \left(y \leq 1.95 \cdot 10^{-118}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{y}}\\
\end{array}
\end{array}
if y < -18000 or 1.95e-118 < y Initial program 58.8%
Taylor expanded in x around inf 48.9%
Taylor expanded in y around inf 47.2%
+-commutative47.2%
Simplified47.2%
if -18000 < y < 1.95e-118Initial program 74.4%
Taylor expanded in x around 0 58.9%
Taylor expanded in y around 0 56.7%
clear-num57.0%
inv-pow57.0%
Applied egg-rr57.0%
unpow-157.0%
Simplified57.0%
Final simplification50.9%
(FPCore (x y) :precision binary64 (if (<= y -11000.0) (/ x (* y (+ x 1.0))) (if (<= y 2.1e-118) (/ 1.0 (/ x y)) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -11000.0) {
tmp = x / (y * (x + 1.0));
} else if (y <= 2.1e-118) {
tmp = 1.0 / (x / y);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-11000.0d0)) then
tmp = x / (y * (x + 1.0d0))
else if (y <= 2.1d-118) then
tmp = 1.0d0 / (x / y)
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -11000.0) {
tmp = x / (y * (x + 1.0));
} else if (y <= 2.1e-118) {
tmp = 1.0 / (x / y);
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -11000.0: tmp = x / (y * (x + 1.0)) elif y <= 2.1e-118: tmp = 1.0 / (x / y) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= -11000.0) tmp = Float64(x / Float64(y * Float64(x + 1.0))); elseif (y <= 2.1e-118) tmp = Float64(1.0 / Float64(x / y)); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -11000.0) tmp = x / (y * (x + 1.0)); elseif (y <= 2.1e-118) tmp = 1.0 / (x / y); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -11000.0], N[(x / N[(y * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-118], N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -11000:\\
\;\;\;\;\frac{x}{y \cdot \left(x + 1\right)}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-118}:\\
\;\;\;\;\frac{1}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < -11000Initial program 56.6%
Taylor expanded in x around inf 42.2%
Taylor expanded in y around inf 40.2%
+-commutative40.2%
Simplified40.2%
if -11000 < y < 2.1e-118Initial program 74.4%
Taylor expanded in x around 0 58.9%
Taylor expanded in y around 0 56.7%
clear-num57.0%
inv-pow57.0%
Applied egg-rr57.0%
unpow-157.0%
Simplified57.0%
if 2.1e-118 < y Initial program 60.8%
associate-/l*79.4%
associate-+l+79.4%
Simplified79.4%
Taylor expanded in x around 0 61.7%
+-commutative61.7%
Simplified61.7%
(FPCore (x y) :precision binary64 (if (<= x -1450.0) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -1450.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1450.0d0)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1450.0) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1450.0: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1450.0) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1450.0) tmp = (y / (x + 1.0)) / (y + x); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1450.0], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1450:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1450Initial program 58.4%
Taylor expanded in x around inf 58.4%
Taylor expanded in x around inf 56.9%
associate-/l*75.1%
associate-*l*75.2%
+-commutative75.2%
Applied egg-rr75.2%
associate-*r/56.8%
associate-*r*56.9%
*-commutative56.9%
+-commutative56.9%
times-frac80.8%
+-commutative80.8%
associate-*l/80.9%
times-frac80.8%
*-inverses80.8%
Simplified80.8%
if -1450 < x Initial program 66.7%
associate-/l*77.0%
associate-+l+77.0%
Simplified77.0%
Taylor expanded in x around 0 56.5%
+-commutative56.5%
Simplified56.5%
*-un-lft-identity56.5%
*-commutative56.5%
times-frac59.5%
Applied egg-rr59.5%
*-commutative59.5%
Simplified59.5%
un-div-inv59.6%
Applied egg-rr59.6%
Final simplification64.7%
(FPCore (x y) :precision binary64 (if (<= x -500000.0) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -500000.0) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-500000.0d0)) then
tmp = (y / x) / (x + 1.0d0)
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -500000.0) {
tmp = (y / x) / (x + 1.0);
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -500000.0: tmp = (y / x) / (x + 1.0) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -500000.0) tmp = Float64(Float64(y / x) / Float64(x + 1.0)); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -500000.0) tmp = (y / x) / (x + 1.0); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -500000.0], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -500000:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -5e5Initial program 57.8%
associate-/l*76.3%
associate-+l+76.3%
Simplified76.3%
Taylor expanded in y around 0 75.7%
associate-/r*81.7%
+-commutative81.7%
Simplified81.7%
if -5e5 < x Initial program 66.9%
associate-/l*77.1%
associate-+l+77.1%
Simplified77.1%
Taylor expanded in x around 0 56.7%
+-commutative56.7%
Simplified56.7%
*-un-lft-identity56.7%
*-commutative56.7%
times-frac59.7%
Applied egg-rr59.7%
*-commutative59.7%
Simplified59.7%
un-div-inv59.8%
Applied egg-rr59.8%
(FPCore (x y) :precision binary64 (if (<= y 2.1e-118) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 2.1e-118) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.1d-118) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.1e-118) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.1e-118: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.1e-118) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.1e-118) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.1e-118], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 2.1e-118Initial program 66.6%
associate-/l*75.7%
associate-+l+75.7%
Simplified75.7%
Taylor expanded in y around 0 55.1%
if 2.1e-118 < y Initial program 60.8%
associate-/l*79.4%
associate-+l+79.4%
Simplified79.4%
Taylor expanded in x around 0 61.7%
+-commutative61.7%
Simplified61.7%
*-un-lft-identity61.7%
*-commutative61.7%
times-frac62.0%
Applied egg-rr62.0%
*-commutative62.0%
Simplified62.0%
un-div-inv62.1%
Applied egg-rr62.1%
Final simplification57.4%
(FPCore (x y) :precision binary64 (if (<= y 2.1e-118) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (y <= 2.1e-118) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2.1d-118) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2.1e-118) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2.1e-118: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= 2.1e-118) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2.1e-118) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2.1e-118], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if y < 2.1e-118Initial program 66.6%
associate-/l*75.7%
associate-+l+75.7%
Simplified75.7%
Taylor expanded in y around 0 55.1%
if 2.1e-118 < y Initial program 60.8%
associate-/l*79.4%
associate-+l+79.4%
Simplified79.4%
Taylor expanded in x around 0 61.7%
+-commutative61.7%
Simplified61.7%
Final simplification57.3%
(FPCore (x y) :precision binary64 (if (<= y 2e-118) (/ 1.0 (/ x y)) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 2e-118) {
tmp = 1.0 / (x / y);
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2d-118) then
tmp = 1.0d0 / (x / y)
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2e-118) {
tmp = 1.0 / (x / y);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2e-118: tmp = 1.0 / (x / y) else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 2e-118) tmp = Float64(1.0 / Float64(x / y)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2e-118) tmp = 1.0 / (x / y); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2e-118], N[(1.0 / N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-118}:\\
\;\;\;\;\frac{1}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 1.99999999999999997e-118Initial program 66.6%
Taylor expanded in x around 0 56.8%
Taylor expanded in y around 0 32.9%
clear-num33.1%
inv-pow33.1%
Applied egg-rr33.1%
unpow-133.1%
Simplified33.1%
if 1.99999999999999997e-118 < y Initial program 60.8%
associate-/l*79.4%
associate-+l+79.4%
Simplified79.4%
Taylor expanded in x around 0 61.7%
+-commutative61.7%
Simplified61.7%
Taylor expanded in y around 0 38.5%
(FPCore (x y) :precision binary64 (if (<= y 2e-118) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (y <= 2e-118) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 2d-118) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 2e-118) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 2e-118: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (y <= 2e-118) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 2e-118) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 2e-118], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < 1.99999999999999997e-118Initial program 66.6%
Taylor expanded in x around 0 56.8%
Taylor expanded in y around 0 32.9%
if 1.99999999999999997e-118 < y Initial program 60.8%
associate-/l*79.4%
associate-+l+79.4%
Simplified79.4%
Taylor expanded in x around 0 61.7%
+-commutative61.7%
Simplified61.7%
Taylor expanded in y around 0 38.5%
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
return x / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / y
end function
public static double code(double x, double y) {
return x / y;
}
def code(x, y): return x / y
function code(x, y) return Float64(x / y) end
function tmp = code(x, y) tmp = x / y; end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 64.7%
associate-/l*76.9%
associate-+l+76.9%
Simplified76.9%
Taylor expanded in x around 0 46.9%
+-commutative46.9%
Simplified46.9%
Taylor expanded in y around 0 26.2%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 64.7%
Taylor expanded in x around inf 58.5%
Taylor expanded in x around inf 34.2%
Taylor expanded in x around 0 3.5%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2024170
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))