
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (cos (+ a b))))
double code(double r, double a, double b) {
return (r * sin(b)) / cos((a + b));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (r * sin(b)) / cos((a + b))
end function
public static double code(double r, double a, double b) {
return (r * Math.sin(b)) / Math.cos((a + b));
}
def code(r, a, b): return (r * math.sin(b)) / math.cos((a + b))
function code(r, a, b) return Float64(Float64(r * sin(b)) / cos(Float64(a + b))) end
function tmp = code(r, a, b) tmp = (r * sin(b)) / cos((a + b)); end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r \cdot \sin b}{\cos \left(a + b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (cos (+ a b))))
double code(double r, double a, double b) {
return (r * sin(b)) / cos((a + b));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (r * sin(b)) / cos((a + b))
end function
public static double code(double r, double a, double b) {
return (r * Math.sin(b)) / Math.cos((a + b));
}
def code(r, a, b): return (r * math.sin(b)) / math.cos((a + b))
function code(r, a, b) return Float64(Float64(r * sin(b)) / cos(Float64(a + b))) end
function tmp = code(r, a, b) tmp = (r * sin(b)) / cos((a + b)); end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r \cdot \sin b}{\cos \left(a + b\right)}
\end{array}
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (fma (cos b) (cos a) (* (sin b) (- (sin a))))))
double code(double r, double a, double b) {
return (r * sin(b)) / fma(cos(b), cos(a), (sin(b) * -sin(a)));
}
function code(r, a, b) return Float64(Float64(r * sin(b)) / fma(cos(b), cos(a), Float64(sin(b) * Float64(-sin(a))))) end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision] + N[(N[Sin[b], $MachinePrecision] * (-N[Sin[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \sin b \cdot \left(-\sin a\right)\right)}
\end{array}
Initial program 75.2%
+-commutative75.2%
Simplified75.2%
cos-sum99.5%
cancel-sign-sub-inv99.5%
fma-def99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (fma (cos b) (cos a) (* (sin b) (- (sin a)))))))
double code(double r, double a, double b) {
return r * (sin(b) / fma(cos(b), cos(a), (sin(b) * -sin(a))));
}
function code(r, a, b) return Float64(r * Float64(sin(b) / fma(cos(b), cos(a), Float64(sin(b) * Float64(-sin(a)))))) end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision] + N[(N[Sin[b], $MachinePrecision] * (-N[Sin[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\mathsf{fma}\left(\cos b, \cos a, \sin b \cdot \left(-\sin a\right)\right)}
\end{array}
Initial program 75.2%
associate-*r/75.2%
*-commutative75.2%
+-commutative75.2%
Simplified75.2%
cos-sum99.5%
cancel-sign-sub-inv99.5%
fma-def99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (- (* (cos b) (cos a)) (* (sin b) (sin a))))))
double code(double r, double a, double b) {
return r * (sin(b) / ((cos(b) * cos(a)) - (sin(b) * sin(a))));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = r * (sin(b) / ((cos(b) * cos(a)) - (sin(b) * sin(a))))
end function
public static double code(double r, double a, double b) {
return r * (Math.sin(b) / ((Math.cos(b) * Math.cos(a)) - (Math.sin(b) * Math.sin(a))));
}
def code(r, a, b): return r * (math.sin(b) / ((math.cos(b) * math.cos(a)) - (math.sin(b) * math.sin(a))))
function code(r, a, b) return Float64(r * Float64(sin(b) / Float64(Float64(cos(b) * cos(a)) - Float64(sin(b) * sin(a))))) end
function tmp = code(r, a, b) tmp = r * (sin(b) / ((cos(b) * cos(a)) - (sin(b) * sin(a)))); end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\cos b \cdot \cos a - \sin b \cdot \sin a}
\end{array}
Initial program 75.2%
associate-*r/75.2%
*-commutative75.2%
+-commutative75.2%
Simplified75.2%
cos-sum99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (- (* (cos b) (cos a)) (* (sin b) (sin a)))))
double code(double r, double a, double b) {
return (r * sin(b)) / ((cos(b) * cos(a)) - (sin(b) * sin(a)));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (r * sin(b)) / ((cos(b) * cos(a)) - (sin(b) * sin(a)))
end function
public static double code(double r, double a, double b) {
return (r * Math.sin(b)) / ((Math.cos(b) * Math.cos(a)) - (Math.sin(b) * Math.sin(a)));
}
def code(r, a, b): return (r * math.sin(b)) / ((math.cos(b) * math.cos(a)) - (math.sin(b) * math.sin(a)))
function code(r, a, b) return Float64(Float64(r * sin(b)) / Float64(Float64(cos(b) * cos(a)) - Float64(sin(b) * sin(a)))) end
function tmp = code(r, a, b) tmp = (r * sin(b)) / ((cos(b) * cos(a)) - (sin(b) * sin(a))); end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \sin a}
\end{array}
Initial program 75.2%
+-commutative75.2%
Simplified75.2%
cos-sum99.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (r a b) :precision binary64 (if (<= b -8e-7) (* r (tan b)) (if (<= b 1.75e-6) (* r (/ (sin b) (cos a))) (/ r (/ 1.0 (tan b))))))
double code(double r, double a, double b) {
double tmp;
if (b <= -8e-7) {
tmp = r * tan(b);
} else if (b <= 1.75e-6) {
tmp = r * (sin(b) / cos(a));
} else {
tmp = r / (1.0 / tan(b));
}
return tmp;
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-8d-7)) then
tmp = r * tan(b)
else if (b <= 1.75d-6) then
tmp = r * (sin(b) / cos(a))
else
tmp = r / (1.0d0 / tan(b))
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if (b <= -8e-7) {
tmp = r * Math.tan(b);
} else if (b <= 1.75e-6) {
tmp = r * (Math.sin(b) / Math.cos(a));
} else {
tmp = r / (1.0 / Math.tan(b));
}
return tmp;
}
def code(r, a, b): tmp = 0 if b <= -8e-7: tmp = r * math.tan(b) elif b <= 1.75e-6: tmp = r * (math.sin(b) / math.cos(a)) else: tmp = r / (1.0 / math.tan(b)) return tmp
function code(r, a, b) tmp = 0.0 if (b <= -8e-7) tmp = Float64(r * tan(b)); elseif (b <= 1.75e-6) tmp = Float64(r * Float64(sin(b) / cos(a))); else tmp = Float64(r / Float64(1.0 / tan(b))); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if (b <= -8e-7) tmp = r * tan(b); elseif (b <= 1.75e-6) tmp = r * (sin(b) / cos(a)); else tmp = r / (1.0 / tan(b)); end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[b, -8e-7], N[(r * N[Tan[b], $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.75e-6], N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(r / N[(1.0 / N[Tan[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8 \cdot 10^{-7}:\\
\;\;\;\;r \cdot \tan b\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{-6}:\\
\;\;\;\;r \cdot \frac{\sin b}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;\frac{r}{\frac{1}{\tan b}}\\
\end{array}
\end{array}
if b < -7.9999999999999996e-7Initial program 55.9%
associate-*r/55.8%
*-commutative55.8%
+-commutative55.8%
Simplified55.8%
Taylor expanded in a around 0 55.3%
expm1-log1p-u46.2%
expm1-udef45.5%
quot-tan45.5%
Applied egg-rr45.5%
expm1-def46.4%
expm1-log1p55.4%
Simplified55.4%
if -7.9999999999999996e-7 < b < 1.74999999999999997e-6Initial program 99.2%
associate-*r/99.3%
*-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in b around 0 99.3%
if 1.74999999999999997e-6 < b Initial program 43.4%
associate-*r/43.4%
*-commutative43.4%
+-commutative43.4%
Simplified43.4%
Taylor expanded in a around 0 44.8%
*-commutative44.8%
clear-num44.8%
un-div-inv44.8%
clear-num44.8%
quot-tan44.9%
Applied egg-rr44.9%
Final simplification75.5%
(FPCore (r a b) :precision binary64 (* (sin b) (/ r (cos (+ b a)))))
double code(double r, double a, double b) {
return sin(b) * (r / cos((b + a)));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = sin(b) * (r / cos((b + a)))
end function
public static double code(double r, double a, double b) {
return Math.sin(b) * (r / Math.cos((b + a)));
}
def code(r, a, b): return math.sin(b) * (r / math.cos((b + a)))
function code(r, a, b) return Float64(sin(b) * Float64(r / cos(Float64(b + a)))) end
function tmp = code(r, a, b) tmp = sin(b) * (r / cos((b + a))); end
code[r_, a_, b_] := N[(N[Sin[b], $MachinePrecision] * N[(r / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin b \cdot \frac{r}{\cos \left(b + a\right)}
\end{array}
Initial program 75.2%
associate-/l*75.1%
+-commutative75.1%
Simplified75.1%
associate-/r/75.2%
Applied egg-rr75.2%
Final simplification75.2%
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (cos (+ b a)))))
double code(double r, double a, double b) {
return r * (sin(b) / cos((b + a)));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = r * (sin(b) / cos((b + a)))
end function
public static double code(double r, double a, double b) {
return r * (Math.sin(b) / Math.cos((b + a)));
}
def code(r, a, b): return r * (math.sin(b) / math.cos((b + a)))
function code(r, a, b) return Float64(r * Float64(sin(b) / cos(Float64(b + a)))) end
function tmp = code(r, a, b) tmp = r * (sin(b) / cos((b + a))); end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\cos \left(b + a\right)}
\end{array}
Initial program 75.2%
associate-*r/75.2%
*-commutative75.2%
+-commutative75.2%
Simplified75.2%
Final simplification75.2%
(FPCore (r a b) :precision binary64 (if (or (<= b -1.32e-6) (not (<= b 1.75e-6))) (* r (tan b)) (* r (/ b (cos a)))))
double code(double r, double a, double b) {
double tmp;
if ((b <= -1.32e-6) || !(b <= 1.75e-6)) {
tmp = r * tan(b);
} else {
tmp = r * (b / cos(a));
}
return tmp;
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.32d-6)) .or. (.not. (b <= 1.75d-6))) then
tmp = r * tan(b)
else
tmp = r * (b / cos(a))
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if ((b <= -1.32e-6) || !(b <= 1.75e-6)) {
tmp = r * Math.tan(b);
} else {
tmp = r * (b / Math.cos(a));
}
return tmp;
}
def code(r, a, b): tmp = 0 if (b <= -1.32e-6) or not (b <= 1.75e-6): tmp = r * math.tan(b) else: tmp = r * (b / math.cos(a)) return tmp
function code(r, a, b) tmp = 0.0 if ((b <= -1.32e-6) || !(b <= 1.75e-6)) tmp = Float64(r * tan(b)); else tmp = Float64(r * Float64(b / cos(a))); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if ((b <= -1.32e-6) || ~((b <= 1.75e-6))) tmp = r * tan(b); else tmp = r * (b / cos(a)); end tmp_2 = tmp; end
code[r_, a_, b_] := If[Or[LessEqual[b, -1.32e-6], N[Not[LessEqual[b, 1.75e-6]], $MachinePrecision]], N[(r * N[Tan[b], $MachinePrecision]), $MachinePrecision], N[(r * N[(b / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.32 \cdot 10^{-6} \lor \neg \left(b \leq 1.75 \cdot 10^{-6}\right):\\
\;\;\;\;r \cdot \tan b\\
\mathbf{else}:\\
\;\;\;\;r \cdot \frac{b}{\cos a}\\
\end{array}
\end{array}
if b < -1.3200000000000001e-6 or 1.74999999999999997e-6 < b Initial program 49.3%
associate-*r/49.3%
*-commutative49.3%
+-commutative49.3%
Simplified49.3%
Taylor expanded in a around 0 49.8%
expm1-log1p-u39.6%
expm1-udef38.8%
quot-tan38.8%
Applied egg-rr38.8%
expm1-def39.7%
expm1-log1p49.8%
Simplified49.8%
if -1.3200000000000001e-6 < b < 1.74999999999999997e-6Initial program 99.2%
associate-*r/99.3%
*-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in b around 0 99.3%
Final simplification75.5%
(FPCore (r a b) :precision binary64 (if (<= b -1.32e-6) (* r (tan b)) (if (<= b 1.75e-6) (* r (/ b (cos a))) (/ r (/ 1.0 (tan b))))))
double code(double r, double a, double b) {
double tmp;
if (b <= -1.32e-6) {
tmp = r * tan(b);
} else if (b <= 1.75e-6) {
tmp = r * (b / cos(a));
} else {
tmp = r / (1.0 / tan(b));
}
return tmp;
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.32d-6)) then
tmp = r * tan(b)
else if (b <= 1.75d-6) then
tmp = r * (b / cos(a))
else
tmp = r / (1.0d0 / tan(b))
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if (b <= -1.32e-6) {
tmp = r * Math.tan(b);
} else if (b <= 1.75e-6) {
tmp = r * (b / Math.cos(a));
} else {
tmp = r / (1.0 / Math.tan(b));
}
return tmp;
}
def code(r, a, b): tmp = 0 if b <= -1.32e-6: tmp = r * math.tan(b) elif b <= 1.75e-6: tmp = r * (b / math.cos(a)) else: tmp = r / (1.0 / math.tan(b)) return tmp
function code(r, a, b) tmp = 0.0 if (b <= -1.32e-6) tmp = Float64(r * tan(b)); elseif (b <= 1.75e-6) tmp = Float64(r * Float64(b / cos(a))); else tmp = Float64(r / Float64(1.0 / tan(b))); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if (b <= -1.32e-6) tmp = r * tan(b); elseif (b <= 1.75e-6) tmp = r * (b / cos(a)); else tmp = r / (1.0 / tan(b)); end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[b, -1.32e-6], N[(r * N[Tan[b], $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.75e-6], N[(r * N[(b / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(r / N[(1.0 / N[Tan[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.32 \cdot 10^{-6}:\\
\;\;\;\;r \cdot \tan b\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{-6}:\\
\;\;\;\;r \cdot \frac{b}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;\frac{r}{\frac{1}{\tan b}}\\
\end{array}
\end{array}
if b < -1.3200000000000001e-6Initial program 55.9%
associate-*r/55.8%
*-commutative55.8%
+-commutative55.8%
Simplified55.8%
Taylor expanded in a around 0 55.3%
expm1-log1p-u46.2%
expm1-udef45.5%
quot-tan45.5%
Applied egg-rr45.5%
expm1-def46.4%
expm1-log1p55.4%
Simplified55.4%
if -1.3200000000000001e-6 < b < 1.74999999999999997e-6Initial program 99.2%
associate-*r/99.3%
*-commutative99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in b around 0 99.3%
if 1.74999999999999997e-6 < b Initial program 43.4%
associate-*r/43.4%
*-commutative43.4%
+-commutative43.4%
Simplified43.4%
Taylor expanded in a around 0 44.8%
*-commutative44.8%
clear-num44.8%
un-div-inv44.8%
clear-num44.8%
quot-tan44.9%
Applied egg-rr44.9%
Final simplification75.5%
(FPCore (r a b) :precision binary64 (* r (tan b)))
double code(double r, double a, double b) {
return r * tan(b);
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = r * tan(b)
end function
public static double code(double r, double a, double b) {
return r * Math.tan(b);
}
def code(r, a, b): return r * math.tan(b)
function code(r, a, b) return Float64(r * tan(b)) end
function tmp = code(r, a, b) tmp = r * tan(b); end
code[r_, a_, b_] := N[(r * N[Tan[b], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \tan b
\end{array}
Initial program 75.2%
associate-*r/75.2%
*-commutative75.2%
+-commutative75.2%
Simplified75.2%
Taylor expanded in a around 0 58.0%
expm1-log1p-u53.1%
expm1-udef31.3%
quot-tan31.3%
Applied egg-rr31.3%
expm1-def53.2%
expm1-log1p58.1%
Simplified58.1%
Final simplification58.1%
(FPCore (r a b) :precision binary64 (/ r (+ (* b -0.3333333333333333) (/ 1.0 b))))
double code(double r, double a, double b) {
return r / ((b * -0.3333333333333333) + (1.0 / b));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = r / ((b * (-0.3333333333333333d0)) + (1.0d0 / b))
end function
public static double code(double r, double a, double b) {
return r / ((b * -0.3333333333333333) + (1.0 / b));
}
def code(r, a, b): return r / ((b * -0.3333333333333333) + (1.0 / b))
function code(r, a, b) return Float64(r / Float64(Float64(b * -0.3333333333333333) + Float64(1.0 / b))) end
function tmp = code(r, a, b) tmp = r / ((b * -0.3333333333333333) + (1.0 / b)); end
code[r_, a_, b_] := N[(r / N[(N[(b * -0.3333333333333333), $MachinePrecision] + N[(1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r}{b \cdot -0.3333333333333333 + \frac{1}{b}}
\end{array}
Initial program 75.2%
associate-/l*75.1%
+-commutative75.1%
Simplified75.1%
Taylor expanded in b around 0 55.2%
fma-def55.2%
distribute-rgt-out--55.2%
metadata-eval55.2%
neg-mul-155.2%
+-commutative55.2%
unsub-neg55.2%
Simplified55.2%
Taylor expanded in a around 0 37.4%
Final simplification37.4%
(FPCore (r a b) :precision binary64 (* r b))
double code(double r, double a, double b) {
return r * b;
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = r * b
end function
public static double code(double r, double a, double b) {
return r * b;
}
def code(r, a, b): return r * b
function code(r, a, b) return Float64(r * b) end
function tmp = code(r, a, b) tmp = r * b; end
code[r_, a_, b_] := N[(r * b), $MachinePrecision]
\begin{array}{l}
\\
r \cdot b
\end{array}
Initial program 75.2%
associate-/l*75.1%
+-commutative75.1%
Simplified75.1%
Taylor expanded in a around 0 55.3%
mul-1-neg55.3%
unsub-neg55.3%
Simplified55.3%
Taylor expanded in b around 0 36.8%
Final simplification36.8%
herbie shell --seed 2023203
(FPCore (r a b)
:name "rsin A (should all be same)"
:precision binary64
(/ (* r (sin b)) (cos (+ a b))))