
(FPCore (x y) :precision binary64 (/ (* x 100.0) (+ x y)))
double code(double x, double y) {
return (x * 100.0) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * 100.0d0) / (x + y)
end function
public static double code(double x, double y) {
return (x * 100.0) / (x + y);
}
def code(x, y): return (x * 100.0) / (x + y)
function code(x, y) return Float64(Float64(x * 100.0) / Float64(x + y)) end
function tmp = code(x, y) tmp = (x * 100.0) / (x + y); end
code[x_, y_] := N[(N[(x * 100.0), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 100}{x + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x 100.0) (+ x y)))
double code(double x, double y) {
return (x * 100.0) / (x + y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * 100.0d0) / (x + y)
end function
public static double code(double x, double y) {
return (x * 100.0) / (x + y);
}
def code(x, y): return (x * 100.0) / (x + y)
function code(x, y) return Float64(Float64(x * 100.0) / Float64(x + y)) end
function tmp = code(x, y) tmp = (x * 100.0) / (x + y); end
code[x_, y_] := N[(N[(x * 100.0), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 100}{x + y}
\end{array}
(FPCore (x y) :precision binary64 (/ x (/ (+ x y) 100.0)))
double code(double x, double y) {
return x / ((x + y) / 100.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / ((x + y) / 100.0d0)
end function
public static double code(double x, double y) {
return x / ((x + y) / 100.0);
}
def code(x, y): return x / ((x + y) / 100.0)
function code(x, y) return Float64(x / Float64(Float64(x + y) / 100.0)) end
function tmp = code(x, y) tmp = x / ((x + y) / 100.0); end
code[x_, y_] := N[(x / N[(N[(x + y), $MachinePrecision] / 100.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{\frac{x + y}{100}}
\end{array}
Initial program 99.0%
associate-/l*99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(if (or (<= y -7e+112)
(not
(or (<= y -1.65e+39)
(and (not (<= y -4.5e-64))
(or (<= y 4.1e-12)
(and (not (<= y 3.3e+26)) (<= y 5.6e+53)))))))
(* 100.0 (/ x y))
100.0))
double code(double x, double y) {
double tmp;
if ((y <= -7e+112) || !((y <= -1.65e+39) || (!(y <= -4.5e-64) && ((y <= 4.1e-12) || (!(y <= 3.3e+26) && (y <= 5.6e+53)))))) {
tmp = 100.0 * (x / y);
} else {
tmp = 100.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-7d+112)) .or. (.not. (y <= (-1.65d+39)) .or. (.not. (y <= (-4.5d-64))) .and. (y <= 4.1d-12) .or. (.not. (y <= 3.3d+26)) .and. (y <= 5.6d+53))) then
tmp = 100.0d0 * (x / y)
else
tmp = 100.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -7e+112) || !((y <= -1.65e+39) || (!(y <= -4.5e-64) && ((y <= 4.1e-12) || (!(y <= 3.3e+26) && (y <= 5.6e+53)))))) {
tmp = 100.0 * (x / y);
} else {
tmp = 100.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -7e+112) or not ((y <= -1.65e+39) or (not (y <= -4.5e-64) and ((y <= 4.1e-12) or (not (y <= 3.3e+26) and (y <= 5.6e+53))))): tmp = 100.0 * (x / y) else: tmp = 100.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -7e+112) || !((y <= -1.65e+39) || (!(y <= -4.5e-64) && ((y <= 4.1e-12) || (!(y <= 3.3e+26) && (y <= 5.6e+53)))))) tmp = Float64(100.0 * Float64(x / y)); else tmp = 100.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -7e+112) || ~(((y <= -1.65e+39) || (~((y <= -4.5e-64)) && ((y <= 4.1e-12) || (~((y <= 3.3e+26)) && (y <= 5.6e+53))))))) tmp = 100.0 * (x / y); else tmp = 100.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -7e+112], N[Not[Or[LessEqual[y, -1.65e+39], And[N[Not[LessEqual[y, -4.5e-64]], $MachinePrecision], Or[LessEqual[y, 4.1e-12], And[N[Not[LessEqual[y, 3.3e+26]], $MachinePrecision], LessEqual[y, 5.6e+53]]]]]], $MachinePrecision]], N[(100.0 * N[(x / y), $MachinePrecision]), $MachinePrecision], 100.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+112} \lor \neg \left(y \leq -1.65 \cdot 10^{+39} \lor \neg \left(y \leq -4.5 \cdot 10^{-64}\right) \land \left(y \leq 4.1 \cdot 10^{-12} \lor \neg \left(y \leq 3.3 \cdot 10^{+26}\right) \land y \leq 5.6 \cdot 10^{+53}\right)\right):\\
\;\;\;\;100 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;100\\
\end{array}
\end{array}
if y < -6.99999999999999994e112 or -1.6500000000000001e39 < y < -4.5000000000000001e-64 or 4.0999999999999999e-12 < y < 3.29999999999999993e26 or 5.6e53 < y Initial program 99.7%
*-commutative99.7%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in x around 0 81.9%
if -6.99999999999999994e112 < y < -1.6500000000000001e39 or -4.5000000000000001e-64 < y < 4.0999999999999999e-12 or 3.29999999999999993e26 < y < 5.6e53Initial program 98.3%
*-commutative98.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 82.5%
Final simplification82.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 100.0 (/ x y))))
(if (<= y -4.6e+108)
t_0
(if (<= y -2.1e+38)
100.0
(if (<= y -4e-63)
t_0
(if (<= y 4.2e-12)
100.0
(if (<= y 7.2e+19)
(/ 100.0 (/ y x))
(if (<= y 1.46e+57) 100.0 t_0))))))))
double code(double x, double y) {
double t_0 = 100.0 * (x / y);
double tmp;
if (y <= -4.6e+108) {
tmp = t_0;
} else if (y <= -2.1e+38) {
tmp = 100.0;
} else if (y <= -4e-63) {
tmp = t_0;
} else if (y <= 4.2e-12) {
tmp = 100.0;
} else if (y <= 7.2e+19) {
tmp = 100.0 / (y / x);
} else if (y <= 1.46e+57) {
tmp = 100.0;
} else {
tmp = t_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 = 100.0d0 * (x / y)
if (y <= (-4.6d+108)) then
tmp = t_0
else if (y <= (-2.1d+38)) then
tmp = 100.0d0
else if (y <= (-4d-63)) then
tmp = t_0
else if (y <= 4.2d-12) then
tmp = 100.0d0
else if (y <= 7.2d+19) then
tmp = 100.0d0 / (y / x)
else if (y <= 1.46d+57) then
tmp = 100.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 100.0 * (x / y);
double tmp;
if (y <= -4.6e+108) {
tmp = t_0;
} else if (y <= -2.1e+38) {
tmp = 100.0;
} else if (y <= -4e-63) {
tmp = t_0;
} else if (y <= 4.2e-12) {
tmp = 100.0;
} else if (y <= 7.2e+19) {
tmp = 100.0 / (y / x);
} else if (y <= 1.46e+57) {
tmp = 100.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 100.0 * (x / y) tmp = 0 if y <= -4.6e+108: tmp = t_0 elif y <= -2.1e+38: tmp = 100.0 elif y <= -4e-63: tmp = t_0 elif y <= 4.2e-12: tmp = 100.0 elif y <= 7.2e+19: tmp = 100.0 / (y / x) elif y <= 1.46e+57: tmp = 100.0 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(100.0 * Float64(x / y)) tmp = 0.0 if (y <= -4.6e+108) tmp = t_0; elseif (y <= -2.1e+38) tmp = 100.0; elseif (y <= -4e-63) tmp = t_0; elseif (y <= 4.2e-12) tmp = 100.0; elseif (y <= 7.2e+19) tmp = Float64(100.0 / Float64(y / x)); elseif (y <= 1.46e+57) tmp = 100.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 100.0 * (x / y); tmp = 0.0; if (y <= -4.6e+108) tmp = t_0; elseif (y <= -2.1e+38) tmp = 100.0; elseif (y <= -4e-63) tmp = t_0; elseif (y <= 4.2e-12) tmp = 100.0; elseif (y <= 7.2e+19) tmp = 100.0 / (y / x); elseif (y <= 1.46e+57) tmp = 100.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(100.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+108], t$95$0, If[LessEqual[y, -2.1e+38], 100.0, If[LessEqual[y, -4e-63], t$95$0, If[LessEqual[y, 4.2e-12], 100.0, If[LessEqual[y, 7.2e+19], N[(100.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.46e+57], 100.0, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 100 \cdot \frac{x}{y}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+38}:\\
\;\;\;\;100\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-12}:\\
\;\;\;\;100\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+19}:\\
\;\;\;\;\frac{100}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 1.46 \cdot 10^{+57}:\\
\;\;\;\;100\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -4.5999999999999998e108 or -2.1e38 < y < -4.00000000000000027e-63 or 1.46e57 < y Initial program 99.8%
*-commutative99.8%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in x around 0 81.3%
if -4.5999999999999998e108 < y < -2.1e38 or -4.00000000000000027e-63 < y < 4.19999999999999988e-12 or 7.2e19 < y < 1.46e57Initial program 98.3%
*-commutative98.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 82.5%
if 4.19999999999999988e-12 < y < 7.2e19Initial program 98.4%
*-commutative98.4%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 97.8%
Final simplification82.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y 0.01))))
(if (<= y -4.6e+108)
(* 100.0 (/ x y))
(if (<= y -5.8e+38)
100.0
(if (<= y -3.9e-63)
t_0
(if (<= y 4e-14)
100.0
(if (<= y 1.15e+25)
(/ 100.0 (/ y x))
(if (<= y 5.4e+53) 100.0 t_0))))))))
double code(double x, double y) {
double t_0 = x / (y * 0.01);
double tmp;
if (y <= -4.6e+108) {
tmp = 100.0 * (x / y);
} else if (y <= -5.8e+38) {
tmp = 100.0;
} else if (y <= -3.9e-63) {
tmp = t_0;
} else if (y <= 4e-14) {
tmp = 100.0;
} else if (y <= 1.15e+25) {
tmp = 100.0 / (y / x);
} else if (y <= 5.4e+53) {
tmp = 100.0;
} else {
tmp = t_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 = x / (y * 0.01d0)
if (y <= (-4.6d+108)) then
tmp = 100.0d0 * (x / y)
else if (y <= (-5.8d+38)) then
tmp = 100.0d0
else if (y <= (-3.9d-63)) then
tmp = t_0
else if (y <= 4d-14) then
tmp = 100.0d0
else if (y <= 1.15d+25) then
tmp = 100.0d0 / (y / x)
else if (y <= 5.4d+53) then
tmp = 100.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * 0.01);
double tmp;
if (y <= -4.6e+108) {
tmp = 100.0 * (x / y);
} else if (y <= -5.8e+38) {
tmp = 100.0;
} else if (y <= -3.9e-63) {
tmp = t_0;
} else if (y <= 4e-14) {
tmp = 100.0;
} else if (y <= 1.15e+25) {
tmp = 100.0 / (y / x);
} else if (y <= 5.4e+53) {
tmp = 100.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y * 0.01) tmp = 0 if y <= -4.6e+108: tmp = 100.0 * (x / y) elif y <= -5.8e+38: tmp = 100.0 elif y <= -3.9e-63: tmp = t_0 elif y <= 4e-14: tmp = 100.0 elif y <= 1.15e+25: tmp = 100.0 / (y / x) elif y <= 5.4e+53: tmp = 100.0 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y * 0.01)) tmp = 0.0 if (y <= -4.6e+108) tmp = Float64(100.0 * Float64(x / y)); elseif (y <= -5.8e+38) tmp = 100.0; elseif (y <= -3.9e-63) tmp = t_0; elseif (y <= 4e-14) tmp = 100.0; elseif (y <= 1.15e+25) tmp = Float64(100.0 / Float64(y / x)); elseif (y <= 5.4e+53) tmp = 100.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * 0.01); tmp = 0.0; if (y <= -4.6e+108) tmp = 100.0 * (x / y); elseif (y <= -5.8e+38) tmp = 100.0; elseif (y <= -3.9e-63) tmp = t_0; elseif (y <= 4e-14) tmp = 100.0; elseif (y <= 1.15e+25) tmp = 100.0 / (y / x); elseif (y <= 5.4e+53) tmp = 100.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * 0.01), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+108], N[(100.0 * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.8e+38], 100.0, If[LessEqual[y, -3.9e-63], t$95$0, If[LessEqual[y, 4e-14], 100.0, If[LessEqual[y, 1.15e+25], N[(100.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e+53], 100.0, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot 0.01}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+108}:\\
\;\;\;\;100 \cdot \frac{x}{y}\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{+38}:\\
\;\;\;\;100\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-14}:\\
\;\;\;\;100\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+25}:\\
\;\;\;\;\frac{100}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+53}:\\
\;\;\;\;100\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -4.5999999999999998e108Initial program 99.8%
*-commutative99.8%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around 0 91.8%
if -4.5999999999999998e108 < y < -5.80000000000000013e38 or -3.90000000000000022e-63 < y < 4e-14 or 1.1499999999999999e25 < y < 5.40000000000000039e53Initial program 98.3%
*-commutative98.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 82.5%
if -5.80000000000000013e38 < y < -3.90000000000000022e-63 or 5.40000000000000039e53 < y Initial program 99.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 75.3%
*-commutative75.3%
Simplified75.3%
if 4e-14 < y < 1.1499999999999999e25Initial program 98.4%
*-commutative98.4%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 97.8%
Final simplification82.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ x 0.01) y)))
(if (<= y -4.6e+108)
t_0
(if (<= y -4.6e+38)
100.0
(if (<= y -4.8e-64)
(/ x (* y 0.01))
(if (<= y 4e-14)
100.0
(if (<= y 7.7e+28)
(/ 100.0 (/ y x))
(if (<= y 4.2e+55) 100.0 t_0))))))))
double code(double x, double y) {
double t_0 = (x / 0.01) / y;
double tmp;
if (y <= -4.6e+108) {
tmp = t_0;
} else if (y <= -4.6e+38) {
tmp = 100.0;
} else if (y <= -4.8e-64) {
tmp = x / (y * 0.01);
} else if (y <= 4e-14) {
tmp = 100.0;
} else if (y <= 7.7e+28) {
tmp = 100.0 / (y / x);
} else if (y <= 4.2e+55) {
tmp = 100.0;
} else {
tmp = t_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 = (x / 0.01d0) / y
if (y <= (-4.6d+108)) then
tmp = t_0
else if (y <= (-4.6d+38)) then
tmp = 100.0d0
else if (y <= (-4.8d-64)) then
tmp = x / (y * 0.01d0)
else if (y <= 4d-14) then
tmp = 100.0d0
else if (y <= 7.7d+28) then
tmp = 100.0d0 / (y / x)
else if (y <= 4.2d+55) then
tmp = 100.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x / 0.01) / y;
double tmp;
if (y <= -4.6e+108) {
tmp = t_0;
} else if (y <= -4.6e+38) {
tmp = 100.0;
} else if (y <= -4.8e-64) {
tmp = x / (y * 0.01);
} else if (y <= 4e-14) {
tmp = 100.0;
} else if (y <= 7.7e+28) {
tmp = 100.0 / (y / x);
} else if (y <= 4.2e+55) {
tmp = 100.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x / 0.01) / y tmp = 0 if y <= -4.6e+108: tmp = t_0 elif y <= -4.6e+38: tmp = 100.0 elif y <= -4.8e-64: tmp = x / (y * 0.01) elif y <= 4e-14: tmp = 100.0 elif y <= 7.7e+28: tmp = 100.0 / (y / x) elif y <= 4.2e+55: tmp = 100.0 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x / 0.01) / y) tmp = 0.0 if (y <= -4.6e+108) tmp = t_0; elseif (y <= -4.6e+38) tmp = 100.0; elseif (y <= -4.8e-64) tmp = Float64(x / Float64(y * 0.01)); elseif (y <= 4e-14) tmp = 100.0; elseif (y <= 7.7e+28) tmp = Float64(100.0 / Float64(y / x)); elseif (y <= 4.2e+55) tmp = 100.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (x / 0.01) / y; tmp = 0.0; if (y <= -4.6e+108) tmp = t_0; elseif (y <= -4.6e+38) tmp = 100.0; elseif (y <= -4.8e-64) tmp = x / (y * 0.01); elseif (y <= 4e-14) tmp = 100.0; elseif (y <= 7.7e+28) tmp = 100.0 / (y / x); elseif (y <= 4.2e+55) tmp = 100.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / 0.01), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -4.6e+108], t$95$0, If[LessEqual[y, -4.6e+38], 100.0, If[LessEqual[y, -4.8e-64], N[(x / N[(y * 0.01), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e-14], 100.0, If[LessEqual[y, 7.7e+28], N[(100.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+55], 100.0, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{x}{0.01}}{y}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+38}:\\
\;\;\;\;100\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-64}:\\
\;\;\;\;\frac{x}{y \cdot 0.01}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-14}:\\
\;\;\;\;100\\
\mathbf{elif}\;y \leq 7.7 \cdot 10^{+28}:\\
\;\;\;\;\frac{100}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+55}:\\
\;\;\;\;100\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -4.5999999999999998e108 or 4.2000000000000001e55 < y Initial program 99.8%
*-commutative99.8%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around 0 84.6%
metadata-eval84.6%
times-frac84.6%
*-un-lft-identity84.6%
associate-/r*84.8%
Applied egg-rr84.8%
if -4.5999999999999998e108 < y < -4.6000000000000002e38 or -4.79999999999999997e-64 < y < 4e-14 or 7.6999999999999997e28 < y < 4.2000000000000001e55Initial program 98.3%
*-commutative98.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 82.5%
if -4.6000000000000002e38 < y < -4.79999999999999997e-64Initial program 99.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 64.4%
*-commutative64.4%
Simplified64.4%
if 4e-14 < y < 7.6999999999999997e28Initial program 98.4%
*-commutative98.4%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 97.8%
Final simplification82.4%
(FPCore (x y) :precision binary64 (/ 100.0 (+ (/ y x) 1.0)))
double code(double x, double y) {
return 100.0 / ((y / x) + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 100.0d0 / ((y / x) + 1.0d0)
end function
public static double code(double x, double y) {
return 100.0 / ((y / x) + 1.0);
}
def code(x, y): return 100.0 / ((y / x) + 1.0)
function code(x, y) return Float64(100.0 / Float64(Float64(y / x) + 1.0)) end
function tmp = code(x, y) tmp = 100.0 / ((y / x) + 1.0); end
code[x_, y_] := N[(100.0 / N[(N[(y / x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{100}{\frac{y}{x} + 1}
\end{array}
Initial program 99.0%
*-commutative99.0%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around 0 99.3%
+-commutative99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y) :precision binary64 100.0)
double code(double x, double y) {
return 100.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 100.0d0
end function
public static double code(double x, double y) {
return 100.0;
}
def code(x, y): return 100.0
function code(x, y) return 100.0 end
function tmp = code(x, y) tmp = 100.0; end
code[x_, y_] := 100.0
\begin{array}{l}
\\
100
\end{array}
Initial program 99.0%
*-commutative99.0%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around inf 51.6%
Final simplification51.6%
(FPCore (x y) :precision binary64 (* (/ x 1.0) (/ 100.0 (+ x y))))
double code(double x, double y) {
return (x / 1.0) * (100.0 / (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / 1.0d0) * (100.0d0 / (x + y))
end function
public static double code(double x, double y) {
return (x / 1.0) * (100.0 / (x + y));
}
def code(x, y): return (x / 1.0) * (100.0 / (x + y))
function code(x, y) return Float64(Float64(x / 1.0) * Float64(100.0 / Float64(x + y))) end
function tmp = code(x, y) tmp = (x / 1.0) * (100.0 / (x + y)); end
code[x_, y_] := N[(N[(x / 1.0), $MachinePrecision] * N[(100.0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{1} \cdot \frac{100}{x + y}
\end{array}
herbie shell --seed 2023199
(FPCore (x y)
:name "Development.Shake.Progress:message from shake-0.15.5"
:precision binary64
:herbie-target
(* (/ x 1.0) (/ 100.0 (+ x y)))
(/ (* x 100.0) (+ x y)))