
(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 19 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 (+ 1.0 (+ y x))) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
return ((y / (1.0 + (y + x))) * (x / (y + x))) / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (1.0d0 + (y + x))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / (1.0 + (y + x))) * (x / (y + x))) / (y + x);
}
def code(x, y): return ((y / (1.0 + (y + x))) * (x / (y + x))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(1.0 + Float64(y + x))) * Float64(x / Float64(y + x))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / (1.0 + (y + x))) * (x / (y + x))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{1 + \left(y + x\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Initial program 68.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= x -5.5e+72)
(/ (* (/ y t_0) 1.0) (+ y x))
(if (<= x -1.5e-123)
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0)))
(if (<= x -1.75e-307)
(/ y (* (/ (+ y x) x) (* (+ 1.0 y) (+ y x))))
(* (/ (/ x (+ y x)) t_0) 1.0))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -5.5e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -1.5e-123) {
tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
} else if (x <= -1.75e-307) {
tmp = y / (((y + x) / x) * ((1.0 + y) * (y + x)));
} else {
tmp = ((x / (y + x)) / t_0) * 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (y + x)
if (x <= (-5.5d+72)) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else if (x <= (-1.5d-123)) then
tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
else if (x <= (-1.75d-307)) then
tmp = y / (((y + x) / x) * ((1.0d0 + y) * (y + x)))
else
tmp = ((x / (y + x)) / t_0) * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -5.5e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -1.5e-123) {
tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
} else if (x <= -1.75e-307) {
tmp = y / (((y + x) / x) * ((1.0 + y) * (y + x)));
} else {
tmp = ((x / (y + x)) / t_0) * 1.0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if x <= -5.5e+72: tmp = ((y / t_0) * 1.0) / (y + x) elif x <= -1.5e-123: tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)) elif x <= -1.75e-307: tmp = y / (((y + x) / x) * ((1.0 + y) * (y + x))) else: tmp = ((x / (y + x)) / t_0) * 1.0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -5.5e+72) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); elseif (x <= -1.5e-123) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))); elseif (x <= -1.75e-307) tmp = Float64(y / Float64(Float64(Float64(y + x) / x) * Float64(Float64(1.0 + y) * Float64(y + x)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) / t_0) * 1.0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (x <= -5.5e+72) tmp = ((y / t_0) * 1.0) / (y + x); elseif (x <= -1.5e-123) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); elseif (x <= -1.75e-307) tmp = y / (((y + x) / x) * ((1.0 + y) * (y + x))); else tmp = ((x / (y + x)) / t_0) * 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+72], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e-123], 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], If[LessEqual[x, -1.75e-307], N[(y / N[(N[(N[(y + x), $MachinePrecision] / x), $MachinePrecision] * N[(N[(1.0 + y), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-123}:\\
\;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-307}:\\
\;\;\;\;\frac{y}{\frac{y + x}{x} \cdot \left(\left(1 + y\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0} \cdot 1\\
\end{array}
\end{array}
if x < -5.5e72Initial program 58.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites79.7%
if -5.5e72 < x < -1.49999999999999992e-123Initial program 88.2%
if -1.49999999999999992e-123 < x < -1.7500000000000001e-307Initial program 65.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
lower-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l/N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6497.6
Applied rewrites97.6%
if -1.7500000000000001e-307 < x Initial program 67.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites51.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= x -5.5e+72)
(/ (* (/ y t_0) 1.0) (+ y x))
(if (<= x -8.8e-6)
(/ (* x y) (* (+ y x) (* t_0 (+ y x))))
(/ (* (/ x (+ y x)) y) (* (+ 1.0 y) (+ y x)))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -5.5e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -8.8e-6) {
tmp = (x * y) / ((y + x) * (t_0 * (y + x)));
} else {
tmp = ((x / (y + x)) * y) / ((1.0 + y) * (y + x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (y + x)
if (x <= (-5.5d+72)) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else if (x <= (-8.8d-6)) then
tmp = (x * y) / ((y + x) * (t_0 * (y + x)))
else
tmp = ((x / (y + x)) * y) / ((1.0d0 + y) * (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -5.5e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -8.8e-6) {
tmp = (x * y) / ((y + x) * (t_0 * (y + x)));
} else {
tmp = ((x / (y + x)) * y) / ((1.0 + y) * (y + x));
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if x <= -5.5e+72: tmp = ((y / t_0) * 1.0) / (y + x) elif x <= -8.8e-6: tmp = (x * y) / ((y + x) * (t_0 * (y + x))) else: tmp = ((x / (y + x)) * y) / ((1.0 + y) * (y + x)) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -5.5e+72) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); elseif (x <= -8.8e-6) tmp = Float64(Float64(x * y) / Float64(Float64(y + x) * Float64(t_0 * Float64(y + x)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * y) / Float64(Float64(1.0 + y) * Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (x <= -5.5e+72) tmp = ((y / t_0) * 1.0) / (y + x); elseif (x <= -8.8e-6) tmp = (x * y) / ((y + x) * (t_0 * (y + x))); else tmp = ((x / (y + x)) * y) / ((1.0 + y) * (y + x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+72], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.8e-6], N[(N[(x * y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(N[(1.0 + y), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{x \cdot y}{\left(y + x\right) \cdot \left(t\_0 \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot y}{\left(1 + y\right) \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if x < -5.5e72Initial program 58.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites79.7%
if -5.5e72 < x < -8.8000000000000004e-6Initial program 85.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6485.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6485.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6485.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6485.9
Applied rewrites85.9%
if -8.8000000000000004e-6 < x Initial program 69.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
lower-+.f6483.0
Applied rewrites83.0%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l/N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f64N/A
Applied rewrites84.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (+ y x))) (t_1 (+ 1.0 (+ y x))))
(if (<= x -1.05e+154)
(* (/ t_0 t_1) (/ y x))
(/ (* t_0 y) (* t_1 (+ y x))))))
double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = 1.0 + (y + x);
double tmp;
if (x <= -1.05e+154) {
tmp = (t_0 / t_1) * (y / x);
} else {
tmp = (t_0 * y) / (t_1 * (y + x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / (y + x)
t_1 = 1.0d0 + (y + x)
if (x <= (-1.05d+154)) then
tmp = (t_0 / t_1) * (y / x)
else
tmp = (t_0 * y) / (t_1 * (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + x);
double t_1 = 1.0 + (y + x);
double tmp;
if (x <= -1.05e+154) {
tmp = (t_0 / t_1) * (y / x);
} else {
tmp = (t_0 * y) / (t_1 * (y + x));
}
return tmp;
}
def code(x, y): t_0 = x / (y + x) t_1 = 1.0 + (y + x) tmp = 0 if x <= -1.05e+154: tmp = (t_0 / t_1) * (y / x) else: tmp = (t_0 * y) / (t_1 * (y + x)) return tmp
function code(x, y) t_0 = Float64(x / Float64(y + x)) t_1 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -1.05e+154) tmp = Float64(Float64(t_0 / t_1) * Float64(y / x)); else tmp = Float64(Float64(t_0 * y) / Float64(t_1 * Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + x); t_1 = 1.0 + (y + x); tmp = 0.0; if (x <= -1.05e+154) tmp = (t_0 / t_1) * (y / x); else tmp = (t_0 * y) / (t_1 * (y + x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+154], N[(N[(t$95$0 / t$95$1), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * y), $MachinePrecision] / N[(t$95$1 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
t_1 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+154}:\\
\;\;\;\;\frac{t\_0}{t\_1} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 \cdot y}{t\_1 \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if x < -1.04999999999999997e154Initial program 57.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.9
Applied rewrites99.9%
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f6492.8
Applied rewrites92.8%
if -1.04999999999999997e154 < x Initial program 70.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6494.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.6
Applied rewrites94.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= x -5.5e+72)
(/ (* (/ y t_0) 1.0) (+ y x))
(if (<= x -9.5e-133)
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0)))
(* (/ (/ x (+ y x)) t_0) 1.0)))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -5.5e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -9.5e-133) {
tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
} else {
tmp = ((x / (y + x)) / t_0) * 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (y + x)
if (x <= (-5.5d+72)) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else if (x <= (-9.5d-133)) then
tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
else
tmp = ((x / (y + x)) / t_0) * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -5.5e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -9.5e-133) {
tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
} else {
tmp = ((x / (y + x)) / t_0) * 1.0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if x <= -5.5e+72: tmp = ((y / t_0) * 1.0) / (y + x) elif x <= -9.5e-133: tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)) else: tmp = ((x / (y + x)) / t_0) * 1.0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -5.5e+72) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); elseif (x <= -9.5e-133) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) / t_0) * 1.0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (x <= -5.5e+72) tmp = ((y / t_0) * 1.0) / (y + x); elseif (x <= -9.5e-133) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); else tmp = ((x / (y + x)) / t_0) * 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+72], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.5e-133], 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], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-133}:\\
\;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0} \cdot 1\\
\end{array}
\end{array}
if x < -5.5e72Initial program 58.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites79.7%
if -5.5e72 < x < -9.4999999999999992e-133Initial program 86.9%
if -9.4999999999999992e-133 < x Initial program 66.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites60.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= x -1.35e+154)
(/ (* (/ y t_0) 1.0) (+ y x))
(/ (* (/ x (+ y x)) y) (* t_0 (+ y x))))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -1.35e+154) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else {
tmp = ((x / (y + x)) * y) / (t_0 * (y + x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (y + x)
if (x <= (-1.35d+154)) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else
tmp = ((x / (y + x)) * y) / (t_0 * (y + x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -1.35e+154) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else {
tmp = ((x / (y + x)) * y) / (t_0 * (y + x));
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if x <= -1.35e+154: tmp = ((y / t_0) * 1.0) / (y + x) else: tmp = ((x / (y + x)) * y) / (t_0 * (y + x)) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -1.35e+154) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); else tmp = Float64(Float64(Float64(x / Float64(y + x)) * y) / Float64(t_0 * Float64(y + x))); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (x <= -1.35e+154) tmp = ((y / t_0) * 1.0) / (y + x); else tmp = ((x / (y + x)) * y) / (t_0 * (y + x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+154], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x} \cdot y}{t\_0 \cdot \left(y + x\right)}\\
\end{array}
\end{array}
if x < -1.35000000000000003e154Initial program 57.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
Applied rewrites86.8%
if -1.35000000000000003e154 < x Initial program 70.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6494.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.6
lift-+.f64N/A
+-commutativeN/A
lower-+.f6494.6
Applied rewrites94.6%
(FPCore (x y) :precision binary64 (if (<= x -1.7e+84) (/ (/ y x) (+ y x)) (/ x (* (+ y x) (* (/ (+ 1.0 (+ y x)) y) (+ y x))))))
double code(double x, double y) {
double tmp;
if (x <= -1.7e+84) {
tmp = (y / x) / (y + x);
} else {
tmp = x / ((y + x) * (((1.0 + (y + x)) / y) * (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 <= (-1.7d+84)) then
tmp = (y / x) / (y + x)
else
tmp = x / ((y + x) * (((1.0d0 + (y + x)) / y) * (y + x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.7e+84) {
tmp = (y / x) / (y + x);
} else {
tmp = x / ((y + x) * (((1.0 + (y + x)) / y) * (y + x)));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.7e+84: tmp = (y / x) / (y + x) else: tmp = x / ((y + x) * (((1.0 + (y + x)) / y) * (y + x))) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.7e+84) tmp = Float64(Float64(y / x) / Float64(y + x)); else tmp = Float64(x / Float64(Float64(y + x) * Float64(Float64(Float64(1.0 + Float64(y + x)) / y) * Float64(y + x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.7e+84) tmp = (y / x) / (y + x); else tmp = x / ((y + x) * (((1.0 + (y + x)) / y) * (y + x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.7e+84], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y + x), $MachinePrecision] * N[(N[(N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+84}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(\frac{1 + \left(y + x\right)}{y} \cdot \left(y + x\right)\right)}\\
\end{array}
\end{array}
if x < -1.6999999999999999e84Initial program 60.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f6482.2
Applied rewrites82.2%
if -1.6999999999999999e84 < x Initial program 70.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f6491.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6491.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6491.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6491.5
Applied rewrites91.5%
Final simplification89.7%
(FPCore (x y) :precision binary64 (* (/ x (+ y x)) (/ (/ y (+ 1.0 (+ y x))) (+ y x))))
double code(double x, double y) {
return (x / (y + x)) * ((y / (1.0 + (y + x))) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (y + x)) * ((y / (1.0d0 + (y + x))) / (y + x))
end function
public static double code(double x, double y) {
return (x / (y + x)) * ((y / (1.0 + (y + x))) / (y + x));
}
def code(x, y): return (x / (y + x)) * ((y / (1.0 + (y + x))) / (y + x))
function code(x, y) return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(1.0 + Float64(y + x))) / Float64(y + x))) end
function tmp = code(x, y) tmp = (x / (y + x)) * ((y / (1.0 + (y + x))) / (y + x)); end
code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y + x} \cdot \frac{\frac{y}{1 + \left(y + x\right)}}{y + x}
\end{array}
Initial program 68.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*l/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
Applied rewrites99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (+ y x))))
(if (<= x -4e+72)
(/ (* (/ y t_0) 1.0) (+ y x))
(if (<= x -2.3e-68)
(/ (* x y) (* (+ y x) (* (+ 1.0 x) (+ y x))))
(* (/ (/ x (+ y x)) t_0) 1.0)))))
double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -4e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -2.3e-68) {
tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x)));
} else {
tmp = ((x / (y + x)) / t_0) * 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (y + x)
if (x <= (-4d+72)) then
tmp = ((y / t_0) * 1.0d0) / (y + x)
else if (x <= (-2.3d-68)) then
tmp = (x * y) / ((y + x) * ((1.0d0 + x) * (y + x)))
else
tmp = ((x / (y + x)) / t_0) * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (y + x);
double tmp;
if (x <= -4e+72) {
tmp = ((y / t_0) * 1.0) / (y + x);
} else if (x <= -2.3e-68) {
tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x)));
} else {
tmp = ((x / (y + x)) / t_0) * 1.0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y + x) tmp = 0 if x <= -4e+72: tmp = ((y / t_0) * 1.0) / (y + x) elif x <= -2.3e-68: tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x))) else: tmp = ((x / (y + x)) / t_0) * 1.0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y + x)) tmp = 0.0 if (x <= -4e+72) tmp = Float64(Float64(Float64(y / t_0) * 1.0) / Float64(y + x)); elseif (x <= -2.3e-68) tmp = Float64(Float64(x * y) / Float64(Float64(y + x) * Float64(Float64(1.0 + x) * Float64(y + x)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) / t_0) * 1.0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y + x); tmp = 0.0; if (x <= -4e+72) tmp = ((y / t_0) * 1.0) / (y + x); elseif (x <= -2.3e-68) tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x))); else tmp = ((x / (y + x)) / t_0) * 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e+72], N[(N[(N[(y / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.3e-68], N[(N[(x * y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \left(y + x\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{y}{t\_0} \cdot 1}{y + x}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(1 + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0} \cdot 1\\
\end{array}
\end{array}
if x < -3.99999999999999978e72Initial program 58.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites79.7%
if -3.99999999999999978e72 < x < -2.29999999999999997e-68Initial program 87.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
Applied rewrites88.0%
Taylor expanded in y around 0
lower-+.f6473.1
Applied rewrites73.1%
if -2.29999999999999997e-68 < x Initial program 68.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites61.5%
(FPCore (x y)
:precision binary64
(if (<= x -6.8e+71)
(/ (/ y x) (+ y x))
(if (<= x -2.3e-68)
(/ (* x y) (* (+ y x) (* (+ 1.0 x) (+ y x))))
(* (/ (/ x (+ y x)) (+ 1.0 (+ y x))) 1.0))))
double code(double x, double y) {
double tmp;
if (x <= -6.8e+71) {
tmp = (y / x) / (y + x);
} else if (x <= -2.3e-68) {
tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x)));
} else {
tmp = ((x / (y + x)) / (1.0 + (y + x))) * 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 <= (-6.8d+71)) then
tmp = (y / x) / (y + x)
else if (x <= (-2.3d-68)) then
tmp = (x * y) / ((y + x) * ((1.0d0 + x) * (y + x)))
else
tmp = ((x / (y + x)) / (1.0d0 + (y + x))) * 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.8e+71) {
tmp = (y / x) / (y + x);
} else if (x <= -2.3e-68) {
tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x)));
} else {
tmp = ((x / (y + x)) / (1.0 + (y + x))) * 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.8e+71: tmp = (y / x) / (y + x) elif x <= -2.3e-68: tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x))) else: tmp = ((x / (y + x)) / (1.0 + (y + x))) * 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -6.8e+71) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -2.3e-68) tmp = Float64(Float64(x * y) / Float64(Float64(y + x) * Float64(Float64(1.0 + x) * Float64(y + x)))); else tmp = Float64(Float64(Float64(x / Float64(y + x)) / Float64(1.0 + Float64(y + x))) * 1.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.8e+71) tmp = (y / x) / (y + x); elseif (x <= -2.3e-68) tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x))); else tmp = ((x / (y + x)) / (1.0 + (y + x))) * 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.8e+71], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.3e-68], N[(N[(x * y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+71}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(1 + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{1 + \left(y + x\right)} \cdot 1\\
\end{array}
\end{array}
if x < -6.7999999999999997e71Initial program 58.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f6479.5
Applied rewrites79.5%
if -6.7999999999999997e71 < x < -2.29999999999999997e-68Initial program 87.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
Applied rewrites88.0%
Taylor expanded in y around 0
lower-+.f6473.1
Applied rewrites73.1%
if -2.29999999999999997e-68 < x Initial program 68.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites61.5%
Final simplification66.7%
(FPCore (x y)
:precision binary64
(if (<= x -6.8e+71)
(/ (/ y x) (+ y x))
(if (<= x -2.3e-68)
(/ (* x y) (* (+ y x) (* (+ 1.0 x) (+ y x))))
(/ (/ x (+ 1.0 y)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -6.8e+71) {
tmp = (y / x) / (y + x);
} else if (x <= -2.3e-68) {
tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x)));
} else {
tmp = (x / (1.0 + y)) / (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 <= (-6.8d+71)) then
tmp = (y / x) / (y + x)
else if (x <= (-2.3d-68)) then
tmp = (x * y) / ((y + x) * ((1.0d0 + x) * (y + x)))
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.8e+71) {
tmp = (y / x) / (y + x);
} else if (x <= -2.3e-68) {
tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x)));
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.8e+71: tmp = (y / x) / (y + x) elif x <= -2.3e-68: tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x))) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -6.8e+71) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -2.3e-68) tmp = Float64(Float64(x * y) / Float64(Float64(y + x) * Float64(Float64(1.0 + x) * Float64(y + x)))); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.8e+71) tmp = (y / x) / (y + x); elseif (x <= -2.3e-68) tmp = (x * y) / ((y + x) * ((1.0 + x) * (y + x))); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.8e+71], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.3e-68], N[(N[(x * y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+71}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(1 + x\right) \cdot \left(y + x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -6.7999999999999997e71Initial program 58.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-/.f6479.5
Applied rewrites79.5%
if -6.7999999999999997e71 < x < -2.29999999999999997e-68Initial program 87.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6488.0
Applied rewrites88.0%
Taylor expanded in y around 0
lower-+.f6473.1
Applied rewrites73.1%
if -2.29999999999999997e-68 < x Initial program 68.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6460.8
Applied rewrites60.8%
Final simplification66.2%
(FPCore (x y) :precision binary64 (if (<= x -4.4e+15) (/ (/ y x) (+ y x)) (if (<= x -7.5e-39) (/ y (fma x x x)) (/ (/ x (+ 1.0 y)) (+ y x)))))
double code(double x, double y) {
double tmp;
if (x <= -4.4e+15) {
tmp = (y / x) / (y + x);
} else if (x <= -7.5e-39) {
tmp = y / fma(x, x, x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -4.4e+15) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -7.5e-39) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
code[x_, y_] := If[LessEqual[x, -4.4e+15], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-39], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -4.4e15Initial program 65.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6472.2
Applied rewrites72.2%
if -4.4e15 < x < -7.49999999999999971e-39Initial program 90.8%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6455.6
Applied rewrites55.6%
if -7.49999999999999971e-39 < x Initial program 68.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6461.7
Applied rewrites61.7%
Final simplification64.3%
(FPCore (x y) :precision binary64 (if (<= x -7.5e-39) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ 1.0 y)) (+ y x))))
double code(double x, double y) {
double tmp;
if (x <= -7.5e-39) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (1.0 + y)) / (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 <= (-7.5d-39)) then
tmp = (y / (1.0d0 + x)) / (y + x)
else
tmp = (x / (1.0d0 + y)) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -7.5e-39) {
tmp = (y / (1.0 + x)) / (y + x);
} else {
tmp = (x / (1.0 + y)) / (y + x);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -7.5e-39: tmp = (y / (1.0 + x)) / (y + x) else: tmp = (x / (1.0 + y)) / (y + x) return tmp
function code(x, y) tmp = 0.0 if (x <= -7.5e-39) tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -7.5e-39) tmp = (y / (1.0 + x)) / (y + x); else tmp = (x / (1.0 + y)) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -7.5e-39], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
\end{array}
\end{array}
if x < -7.49999999999999971e-39Initial program 68.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6470.0
Applied rewrites70.0%
if -7.49999999999999971e-39 < x Initial program 68.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-+.f6461.7
Applied rewrites61.7%
(FPCore (x y) :precision binary64 (if (<= x -4.4e+15) (/ (/ y x) (+ y x)) (if (<= x -7.5e-39) (/ y (fma x x x)) (/ x (fma y y y)))))
double code(double x, double y) {
double tmp;
if (x <= -4.4e+15) {
tmp = (y / x) / (y + x);
} else if (x <= -7.5e-39) {
tmp = y / fma(x, x, x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -4.4e+15) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (x <= -7.5e-39) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[x, -4.4e+15], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-39], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -4.4e15Initial program 65.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-/.f6499.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-+.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-/.f6472.2
Applied rewrites72.2%
if -4.4e15 < x < -7.49999999999999971e-39Initial program 90.8%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6455.6
Applied rewrites55.6%
if -7.49999999999999971e-39 < x Initial program 68.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6461.3
Applied rewrites61.3%
Final simplification64.0%
(FPCore (x y) :precision binary64 (if (<= x -9e+50) (/ (/ y x) x) (if (<= x -7.5e-39) (/ y (fma x x x)) (/ x (fma y y y)))))
double code(double x, double y) {
double tmp;
if (x <= -9e+50) {
tmp = (y / x) / x;
} else if (x <= -7.5e-39) {
tmp = y / fma(x, x, x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -9e+50) tmp = Float64(Float64(y / x) / x); elseif (x <= -7.5e-39) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[x, -9e+50], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -7.5e-39], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -9.00000000000000027e50Initial program 64.1%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6477.0
Applied rewrites77.0%
if -9.00000000000000027e50 < x < -7.49999999999999971e-39Initial program 81.2%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6447.8
Applied rewrites47.8%
if -7.49999999999999971e-39 < x Initial program 68.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6461.3
Applied rewrites61.3%
(FPCore (x y) :precision binary64 (if (<= x -7.5e-39) (/ y (fma x x x)) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (x <= -7.5e-39) {
tmp = y / fma(x, x, x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -7.5e-39) tmp = Float64(y / fma(x, x, x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[x, -7.5e-39], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -7.49999999999999971e-39Initial program 68.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6465.4
Applied rewrites65.4%
if -7.49999999999999971e-39 < x Initial program 68.7%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6461.3
Applied rewrites61.3%
(FPCore (x y) :precision binary64 (if (<= x -2950.0) (/ y (* x x)) (/ x (fma y y y))))
double code(double x, double y) {
double tmp;
if (x <= -2950.0) {
tmp = y / (x * x);
} else {
tmp = x / fma(y, y, y);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= -2950.0) tmp = Float64(y / Float64(x * x)); else tmp = Float64(x / fma(y, y, y)); end return tmp end
code[x_, y_] := If[LessEqual[x, -2950.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2950:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
\end{array}
\end{array}
if x < -2950Initial program 65.5%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6471.6
Applied rewrites71.6%
Applied rewrites66.9%
if -2950 < x Initial program 69.8%
Taylor expanded in x around 0
lower-/.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6460.8
Applied rewrites60.8%
(FPCore (x y) :precision binary64 (if (<= y 6.2e+22) (/ y (* x x)) (/ x (* y y))))
double code(double x, double y) {
double tmp;
if (y <= 6.2e+22) {
tmp = y / (x * x);
} else {
tmp = x / (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 6.2d+22) then
tmp = y / (x * x)
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 6.2e+22) {
tmp = y / (x * x);
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 6.2e+22: tmp = y / (x * x) else: tmp = x / (y * y) return tmp
function code(x, y) tmp = 0.0 if (y <= 6.2e+22) tmp = Float64(y / Float64(x * x)); else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 6.2e+22) tmp = y / (x * x); else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 6.2e+22], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+22}:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < 6.2000000000000004e22Initial program 70.6%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6443.1
Applied rewrites43.1%
Applied rewrites42.5%
if 6.2000000000000004e22 < y Initial program 62.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites99.9%
Taylor expanded in y around inf
lower-/.f64N/A
unpow2N/A
lower-*.f6475.0
Applied rewrites75.0%
Final simplification50.5%
(FPCore (x y) :precision binary64 (/ y (* x x)))
double code(double x, double y) {
return y / (x * x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y / (x * x)
end function
public static double code(double x, double y) {
return y / (x * x);
}
def code(x, y): return y / (x * x)
function code(x, y) return Float64(y / Float64(x * x)) end
function tmp = code(x, y) tmp = y / (x * x); end
code[x_, y_] := N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x \cdot x}
\end{array}
Initial program 68.6%
Taylor expanded in x around inf
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6437.7
Applied rewrites37.7%
Applied rewrites35.8%
(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 2024318
(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))))