
(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 16 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 (/ (* (sin b) r) (fma (cos b) (cos a) (* (sin a) (- (sin b))))))
double code(double r, double a, double b) {
return (sin(b) * r) / fma(cos(b), cos(a), (sin(a) * -sin(b)));
}
function code(r, a, b) return Float64(Float64(sin(b) * r) / fma(cos(b), cos(a), Float64(sin(a) * Float64(-sin(b))))) end
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision] + N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin b \cdot r}{\mathsf{fma}\left(\cos b, \cos a, \sin a \cdot \left(-\sin b\right)\right)}
\end{array}
Initial program 76.3%
lift-cos.f64N/A
lift-+.f64N/A
cos-sumN/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-cos.f64N/A
lift-sin.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* (sin b) r)))
(if (<= a -0.000102)
(/ t_0 (cos a))
(if (<= a 1.05e-5) (/ t_0 (cos b)) (* (/ (sin b) (cos a)) r)))))
double code(double r, double a, double b) {
double t_0 = sin(b) * r;
double tmp;
if (a <= -0.000102) {
tmp = t_0 / cos(a);
} else if (a <= 1.05e-5) {
tmp = t_0 / cos(b);
} else {
tmp = (sin(b) / cos(a)) * r;
}
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) :: t_0
real(8) :: tmp
t_0 = sin(b) * r
if (a <= (-0.000102d0)) then
tmp = t_0 / cos(a)
else if (a <= 1.05d-5) then
tmp = t_0 / cos(b)
else
tmp = (sin(b) / cos(a)) * r
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double t_0 = Math.sin(b) * r;
double tmp;
if (a <= -0.000102) {
tmp = t_0 / Math.cos(a);
} else if (a <= 1.05e-5) {
tmp = t_0 / Math.cos(b);
} else {
tmp = (Math.sin(b) / Math.cos(a)) * r;
}
return tmp;
}
def code(r, a, b): t_0 = math.sin(b) * r tmp = 0 if a <= -0.000102: tmp = t_0 / math.cos(a) elif a <= 1.05e-5: tmp = t_0 / math.cos(b) else: tmp = (math.sin(b) / math.cos(a)) * r return tmp
function code(r, a, b) t_0 = Float64(sin(b) * r) tmp = 0.0 if (a <= -0.000102) tmp = Float64(t_0 / cos(a)); elseif (a <= 1.05e-5) tmp = Float64(t_0 / cos(b)); else tmp = Float64(Float64(sin(b) / cos(a)) * r); end return tmp end
function tmp_2 = code(r, a, b) t_0 = sin(b) * r; tmp = 0.0; if (a <= -0.000102) tmp = t_0 / cos(a); elseif (a <= 1.05e-5) tmp = t_0 / cos(b); else tmp = (sin(b) / cos(a)) * r; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[a, -0.000102], N[(t$95$0 / N[Cos[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-5], N[(t$95$0 / N[Cos[b], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;a \leq -0.000102:\\
\;\;\;\;\frac{t\_0}{\cos a}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-5}:\\
\;\;\;\;\frac{t\_0}{\cos b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin b}{\cos a} \cdot r\\
\end{array}
\end{array}
if a < -1.01999999999999999e-4Initial program 51.4%
Taylor expanded in b around 0
lower-cos.f6451.7
Applied rewrites51.7%
if -1.01999999999999999e-4 < a < 1.04999999999999994e-5Initial program 99.3%
Taylor expanded in a around 0
lower-cos.f6499.3
Applied rewrites99.3%
if 1.04999999999999994e-5 < a Initial program 60.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6460.8
Applied rewrites60.8%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
pow2N/A
lower-pow.f6447.6
Applied rewrites47.6%
Taylor expanded in b around 0
lower-cos.f6447.4
Applied rewrites47.4%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
lower-/.f6447.4
lift-pow.f64N/A
lift-pow.f64N/A
pow-powN/A
metadata-evalN/A
unpow160.8
Applied rewrites60.8%
Final simplification76.4%
(FPCore (r a b) :precision binary64 (if (<= a -0.000102) (/ (* (sin b) r) (cos a)) (if (<= a 1.05e-5) (* (/ r (cos b)) (sin b)) (* (/ (sin b) (cos a)) r))))
double code(double r, double a, double b) {
double tmp;
if (a <= -0.000102) {
tmp = (sin(b) * r) / cos(a);
} else if (a <= 1.05e-5) {
tmp = (r / cos(b)) * sin(b);
} else {
tmp = (sin(b) / cos(a)) * r;
}
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 (a <= (-0.000102d0)) then
tmp = (sin(b) * r) / cos(a)
else if (a <= 1.05d-5) then
tmp = (r / cos(b)) * sin(b)
else
tmp = (sin(b) / cos(a)) * r
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if (a <= -0.000102) {
tmp = (Math.sin(b) * r) / Math.cos(a);
} else if (a <= 1.05e-5) {
tmp = (r / Math.cos(b)) * Math.sin(b);
} else {
tmp = (Math.sin(b) / Math.cos(a)) * r;
}
return tmp;
}
def code(r, a, b): tmp = 0 if a <= -0.000102: tmp = (math.sin(b) * r) / math.cos(a) elif a <= 1.05e-5: tmp = (r / math.cos(b)) * math.sin(b) else: tmp = (math.sin(b) / math.cos(a)) * r return tmp
function code(r, a, b) tmp = 0.0 if (a <= -0.000102) tmp = Float64(Float64(sin(b) * r) / cos(a)); elseif (a <= 1.05e-5) tmp = Float64(Float64(r / cos(b)) * sin(b)); else tmp = Float64(Float64(sin(b) / cos(a)) * r); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if (a <= -0.000102) tmp = (sin(b) * r) / cos(a); elseif (a <= 1.05e-5) tmp = (r / cos(b)) * sin(b); else tmp = (sin(b) / cos(a)) * r; end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[a, -0.000102], N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-5], N[(N[(r / N[Cos[b], $MachinePrecision]), $MachinePrecision] * N[Sin[b], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.000102:\\
\;\;\;\;\frac{\sin b \cdot r}{\cos a}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-5}:\\
\;\;\;\;\frac{r}{\cos b} \cdot \sin b\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin b}{\cos a} \cdot r\\
\end{array}
\end{array}
if a < -1.01999999999999999e-4Initial program 51.4%
Taylor expanded in b around 0
lower-cos.f6451.7
Applied rewrites51.7%
if -1.01999999999999999e-4 < a < 1.04999999999999994e-5Initial program 99.3%
Taylor expanded in a around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6499.1
Applied rewrites99.1%
if 1.04999999999999994e-5 < a Initial program 60.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6460.8
Applied rewrites60.8%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
pow2N/A
lower-pow.f6447.6
Applied rewrites47.6%
Taylor expanded in b around 0
lower-cos.f6447.4
Applied rewrites47.4%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
lower-/.f6447.4
lift-pow.f64N/A
lift-pow.f64N/A
pow-powN/A
metadata-evalN/A
unpow160.8
Applied rewrites60.8%
Final simplification76.3%
(FPCore (r a b) :precision binary64 (if (<= a -0.000102) (* (/ r (cos a)) (sin b)) (if (<= a 1.05e-5) (* (/ r (cos b)) (sin b)) (* (/ (sin b) (cos a)) r))))
double code(double r, double a, double b) {
double tmp;
if (a <= -0.000102) {
tmp = (r / cos(a)) * sin(b);
} else if (a <= 1.05e-5) {
tmp = (r / cos(b)) * sin(b);
} else {
tmp = (sin(b) / cos(a)) * r;
}
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 (a <= (-0.000102d0)) then
tmp = (r / cos(a)) * sin(b)
else if (a <= 1.05d-5) then
tmp = (r / cos(b)) * sin(b)
else
tmp = (sin(b) / cos(a)) * r
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if (a <= -0.000102) {
tmp = (r / Math.cos(a)) * Math.sin(b);
} else if (a <= 1.05e-5) {
tmp = (r / Math.cos(b)) * Math.sin(b);
} else {
tmp = (Math.sin(b) / Math.cos(a)) * r;
}
return tmp;
}
def code(r, a, b): tmp = 0 if a <= -0.000102: tmp = (r / math.cos(a)) * math.sin(b) elif a <= 1.05e-5: tmp = (r / math.cos(b)) * math.sin(b) else: tmp = (math.sin(b) / math.cos(a)) * r return tmp
function code(r, a, b) tmp = 0.0 if (a <= -0.000102) tmp = Float64(Float64(r / cos(a)) * sin(b)); elseif (a <= 1.05e-5) tmp = Float64(Float64(r / cos(b)) * sin(b)); else tmp = Float64(Float64(sin(b) / cos(a)) * r); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if (a <= -0.000102) tmp = (r / cos(a)) * sin(b); elseif (a <= 1.05e-5) tmp = (r / cos(b)) * sin(b); else tmp = (sin(b) / cos(a)) * r; end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[a, -0.000102], N[(N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision] * N[Sin[b], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-5], N[(N[(r / N[Cos[b], $MachinePrecision]), $MachinePrecision] * N[Sin[b], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.000102:\\
\;\;\;\;\frac{r}{\cos a} \cdot \sin b\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-5}:\\
\;\;\;\;\frac{r}{\cos b} \cdot \sin b\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin b}{\cos a} \cdot r\\
\end{array}
\end{array}
if a < -1.01999999999999999e-4Initial program 51.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6451.3
Applied rewrites51.3%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
pow2N/A
lower-pow.f6430.8
Applied rewrites30.8%
Taylor expanded in b around 0
lower-cos.f6430.8
Applied rewrites30.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6430.8
lift-pow.f64N/A
lift-pow.f64N/A
pow-powN/A
metadata-evalN/A
unpow151.6
Applied rewrites51.6%
if -1.01999999999999999e-4 < a < 1.04999999999999994e-5Initial program 99.3%
Taylor expanded in a around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6499.1
Applied rewrites99.1%
if 1.04999999999999994e-5 < a Initial program 60.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6460.8
Applied rewrites60.8%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
pow2N/A
lower-pow.f6447.6
Applied rewrites47.6%
Taylor expanded in b around 0
lower-cos.f6447.4
Applied rewrites47.4%
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
lower-/.f6447.4
lift-pow.f64N/A
lift-pow.f64N/A
pow-powN/A
metadata-evalN/A
unpow160.8
Applied rewrites60.8%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* (/ r (cos a)) (sin b))))
(if (<= a -0.000102)
t_0
(if (<= a 1.05e-5) (* (/ r (cos b)) (sin b)) t_0))))
double code(double r, double a, double b) {
double t_0 = (r / cos(a)) * sin(b);
double tmp;
if (a <= -0.000102) {
tmp = t_0;
} else if (a <= 1.05e-5) {
tmp = (r / cos(b)) * sin(b);
} else {
tmp = t_0;
}
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) :: t_0
real(8) :: tmp
t_0 = (r / cos(a)) * sin(b)
if (a <= (-0.000102d0)) then
tmp = t_0
else if (a <= 1.05d-5) then
tmp = (r / cos(b)) * sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double t_0 = (r / Math.cos(a)) * Math.sin(b);
double tmp;
if (a <= -0.000102) {
tmp = t_0;
} else if (a <= 1.05e-5) {
tmp = (r / Math.cos(b)) * Math.sin(b);
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = (r / math.cos(a)) * math.sin(b) tmp = 0 if a <= -0.000102: tmp = t_0 elif a <= 1.05e-5: tmp = (r / math.cos(b)) * math.sin(b) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(Float64(r / cos(a)) * sin(b)) tmp = 0.0 if (a <= -0.000102) tmp = t_0; elseif (a <= 1.05e-5) tmp = Float64(Float64(r / cos(b)) * sin(b)); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = (r / cos(a)) * sin(b); tmp = 0.0; if (a <= -0.000102) tmp = t_0; elseif (a <= 1.05e-5) tmp = (r / cos(b)) * sin(b); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision] * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.000102], t$95$0, If[LessEqual[a, 1.05e-5], N[(N[(r / N[Cos[b], $MachinePrecision]), $MachinePrecision] * N[Sin[b], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{r}{\cos a} \cdot \sin b\\
\mathbf{if}\;a \leq -0.000102:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-5}:\\
\;\;\;\;\frac{r}{\cos b} \cdot \sin b\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.01999999999999999e-4 or 1.04999999999999994e-5 < a Initial program 56.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6456.0
Applied rewrites56.0%
unpow1N/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
lower-pow.f64N/A
pow2N/A
lower-pow.f6439.2
Applied rewrites39.2%
Taylor expanded in b around 0
lower-cos.f6439.1
Applied rewrites39.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6439.1
lift-pow.f64N/A
lift-pow.f64N/A
pow-powN/A
metadata-evalN/A
unpow156.2
Applied rewrites56.2%
if -1.01999999999999999e-4 < a < 1.04999999999999994e-5Initial program 99.3%
Taylor expanded in a around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6499.1
Applied rewrites99.1%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* (/ r (cos b)) (sin b))))
(if (<= b -0.024)
t_0
(if (<= b 3e-7)
(/
(*
(fma
(* (fma 0.008333333333333333 (* b b) -0.16666666666666666) r)
(* b b)
r)
b)
(cos (+ a b)))
t_0))))
double code(double r, double a, double b) {
double t_0 = (r / cos(b)) * sin(b);
double tmp;
if (b <= -0.024) {
tmp = t_0;
} else if (b <= 3e-7) {
tmp = (fma((fma(0.008333333333333333, (b * b), -0.16666666666666666) * r), (b * b), r) * b) / cos((a + b));
} else {
tmp = t_0;
}
return tmp;
}
function code(r, a, b) t_0 = Float64(Float64(r / cos(b)) * sin(b)) tmp = 0.0 if (b <= -0.024) tmp = t_0; elseif (b <= 3e-7) tmp = Float64(Float64(fma(Float64(fma(0.008333333333333333, Float64(b * b), -0.16666666666666666) * r), Float64(b * b), r) * b) / cos(Float64(a + b))); else tmp = t_0; end return tmp end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r / N[Cos[b], $MachinePrecision]), $MachinePrecision] * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -0.024], t$95$0, If[LessEqual[b, 3e-7], N[(N[(N[(N[(N[(0.008333333333333333 * N[(b * b), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * r), $MachinePrecision] * N[(b * b), $MachinePrecision] + r), $MachinePrecision] * b), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{r}{\cos b} \cdot \sin b\\
\mathbf{if}\;b \leq -0.024:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-7}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, b \cdot b, -0.16666666666666666\right) \cdot r, b \cdot b, r\right) \cdot b}{\cos \left(a + b\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -0.024 or 2.9999999999999999e-7 < b Initial program 51.9%
Taylor expanded in a around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6451.6
Applied rewrites51.6%
if -0.024 < b < 2.9999999999999999e-7Initial program 99.3%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.3%
(FPCore (r a b) :precision binary64 (/ (* (sin b) r) (cos (+ a b))))
double code(double r, double a, double b) {
return (sin(b) * r) / 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 = (sin(b) * r) / cos((a + b))
end function
public static double code(double r, double a, double b) {
return (Math.sin(b) * r) / Math.cos((a + b));
}
def code(r, a, b): return (math.sin(b) * r) / math.cos((a + b))
function code(r, a, b) return Float64(Float64(sin(b) * r) / cos(Float64(a + b))) end
function tmp = code(r, a, b) tmp = (sin(b) * r) / cos((a + b)); end
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin b \cdot r}{\cos \left(a + b\right)}
\end{array}
Initial program 76.3%
Final simplification76.3%
(FPCore (r a b) :precision binary64 (* (/ (sin b) (cos (+ a b))) r))
double code(double r, double a, double b) {
return (sin(b) / cos((a + b))) * r;
}
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) / cos((a + b))) * r
end function
public static double code(double r, double a, double b) {
return (Math.sin(b) / Math.cos((a + b))) * r;
}
def code(r, a, b): return (math.sin(b) / math.cos((a + b))) * r
function code(r, a, b) return Float64(Float64(sin(b) / cos(Float64(a + b))) * r) end
function tmp = code(r, a, b) tmp = (sin(b) / cos((a + b))) * r; end
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin b}{\cos \left(a + b\right)} \cdot r
\end{array}
Initial program 76.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
(FPCore (r a b) :precision binary64 (* (/ r (cos (+ a b))) (sin b)))
double code(double r, double a, double b) {
return (r / cos((a + b))) * sin(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 / cos((a + b))) * sin(b)
end function
public static double code(double r, double a, double b) {
return (r / Math.cos((a + b))) * Math.sin(b);
}
def code(r, a, b): return (r / math.cos((a + b))) * math.sin(b)
function code(r, a, b) return Float64(Float64(r / cos(Float64(a + b))) * sin(b)) end
function tmp = code(r, a, b) tmp = (r / cos((a + b))) * sin(b); end
code[r_, a_, b_] := N[(N[(r / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[b], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r}{\cos \left(a + b\right)} \cdot \sin b
\end{array}
Initial program 76.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
(FPCore (r a b) :precision binary64 (if (<= b 3.6e+16) (/ (* b r) (cos (+ a b))) (/ r (/ (* (- b) (sin a)) b))))
double code(double r, double a, double b) {
double tmp;
if (b <= 3.6e+16) {
tmp = (b * r) / cos((a + b));
} else {
tmp = r / ((-b * sin(a)) / 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 <= 3.6d+16) then
tmp = (b * r) / cos((a + b))
else
tmp = r / ((-b * sin(a)) / b)
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if (b <= 3.6e+16) {
tmp = (b * r) / Math.cos((a + b));
} else {
tmp = r / ((-b * Math.sin(a)) / b);
}
return tmp;
}
def code(r, a, b): tmp = 0 if b <= 3.6e+16: tmp = (b * r) / math.cos((a + b)) else: tmp = r / ((-b * math.sin(a)) / b) return tmp
function code(r, a, b) tmp = 0.0 if (b <= 3.6e+16) tmp = Float64(Float64(b * r) / cos(Float64(a + b))); else tmp = Float64(r / Float64(Float64(Float64(-b) * sin(a)) / b)); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if (b <= 3.6e+16) tmp = (b * r) / cos((a + b)); else tmp = r / ((-b * sin(a)) / b); end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[b, 3.6e+16], N[(N[(b * r), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(r / N[(N[((-b) * N[Sin[a], $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.6 \cdot 10^{+16}:\\
\;\;\;\;\frac{b \cdot r}{\cos \left(a + b\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{r}{\frac{\left(-b\right) \cdot \sin a}{b}}\\
\end{array}
\end{array}
if b < 3.6e16Initial program 83.5%
Taylor expanded in b around 0
lower-*.f6469.5
Applied rewrites69.5%
if 3.6e16 < b Initial program 53.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6453.5
Applied rewrites53.5%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-cos.f6410.3
Applied rewrites10.3%
Taylor expanded in b around inf
Applied rewrites10.0%
Final simplification55.3%
(FPCore (r a b) :precision binary64 (let* ((t_0 (/ r (- (sin a))))) (if (<= b -7e+15) t_0 (if (<= b 5.2e+18) (/ (* b r) (cos a)) t_0))))
double code(double r, double a, double b) {
double t_0 = r / -sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = (b * r) / cos(a);
} else {
tmp = t_0;
}
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) :: t_0
real(8) :: tmp
t_0 = r / -sin(a)
if (b <= (-7d+15)) then
tmp = t_0
else if (b <= 5.2d+18) then
tmp = (b * r) / cos(a)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double t_0 = r / -Math.sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = (b * r) / Math.cos(a);
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r / -math.sin(a) tmp = 0 if b <= -7e+15: tmp = t_0 elif b <= 5.2e+18: tmp = (b * r) / math.cos(a) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r / Float64(-sin(a))) tmp = 0.0 if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = Float64(Float64(b * r) / cos(a)); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r / -sin(a); tmp = 0.0; if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = (b * r) / cos(a); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r / (-N[Sin[a], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[b, -7e+15], t$95$0, If[LessEqual[b, 5.2e+18], N[(N[(b * r), $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{r}{-\sin a}\\
\mathbf{if}\;b \leq -7 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{b \cdot r}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -7e15 or 5.2e18 < b Initial program 49.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-cos.f6410.6
Applied rewrites10.6%
Taylor expanded in b around inf
Applied rewrites10.5%
if -7e15 < b < 5.2e18Initial program 98.6%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f6495.8
Applied rewrites95.8%
Applied rewrites95.8%
(FPCore (r a b) :precision binary64 (let* ((t_0 (/ r (- (sin a))))) (if (<= b -7e+15) t_0 (if (<= b 5.2e+18) (* (/ r (cos a)) b) t_0))))
double code(double r, double a, double b) {
double t_0 = r / -sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = (r / cos(a)) * b;
} else {
tmp = t_0;
}
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) :: t_0
real(8) :: tmp
t_0 = r / -sin(a)
if (b <= (-7d+15)) then
tmp = t_0
else if (b <= 5.2d+18) then
tmp = (r / cos(a)) * b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double t_0 = r / -Math.sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = (r / Math.cos(a)) * b;
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r / -math.sin(a) tmp = 0 if b <= -7e+15: tmp = t_0 elif b <= 5.2e+18: tmp = (r / math.cos(a)) * b else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r / Float64(-sin(a))) tmp = 0.0 if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = Float64(Float64(r / cos(a)) * b); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r / -sin(a); tmp = 0.0; if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = (r / cos(a)) * b; else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r / (-N[Sin[a], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[b, -7e+15], t$95$0, If[LessEqual[b, 5.2e+18], N[(N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{r}{-\sin a}\\
\mathbf{if}\;b \leq -7 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{r}{\cos a} \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -7e15 or 5.2e18 < b Initial program 49.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-cos.f6410.6
Applied rewrites10.6%
Taylor expanded in b around inf
Applied rewrites10.5%
if -7e15 < b < 5.2e18Initial program 98.6%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f6495.8
Applied rewrites95.8%
(FPCore (r a b) :precision binary64 (let* ((t_0 (/ r (- (sin a))))) (if (<= b -7e+15) t_0 (if (<= b 5.2e+18) (* (/ b (cos a)) r) t_0))))
double code(double r, double a, double b) {
double t_0 = r / -sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = (b / cos(a)) * r;
} else {
tmp = t_0;
}
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) :: t_0
real(8) :: tmp
t_0 = r / -sin(a)
if (b <= (-7d+15)) then
tmp = t_0
else if (b <= 5.2d+18) then
tmp = (b / cos(a)) * r
else
tmp = t_0
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double t_0 = r / -Math.sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = (b / Math.cos(a)) * r;
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r / -math.sin(a) tmp = 0 if b <= -7e+15: tmp = t_0 elif b <= 5.2e+18: tmp = (b / math.cos(a)) * r else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r / Float64(-sin(a))) tmp = 0.0 if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = Float64(Float64(b / cos(a)) * r); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r / -sin(a); tmp = 0.0; if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = (b / cos(a)) * r; else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r / (-N[Sin[a], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[b, -7e+15], t$95$0, If[LessEqual[b, 5.2e+18], N[(N[(b / N[Cos[a], $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{r}{-\sin a}\\
\mathbf{if}\;b \leq -7 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{b}{\cos a} \cdot r\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -7e15 or 5.2e18 < b Initial program 49.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-cos.f6410.6
Applied rewrites10.6%
Taylor expanded in b around inf
Applied rewrites10.5%
if -7e15 < b < 5.2e18Initial program 98.6%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f6495.8
Applied rewrites95.8%
Applied rewrites95.8%
(FPCore (r a b) :precision binary64 (let* ((t_0 (/ r (- (sin a))))) (if (<= b -7e+15) t_0 (if (<= b 5.2e+18) (* b r) t_0))))
double code(double r, double a, double b) {
double t_0 = r / -sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = b * r;
} else {
tmp = t_0;
}
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) :: t_0
real(8) :: tmp
t_0 = r / -sin(a)
if (b <= (-7d+15)) then
tmp = t_0
else if (b <= 5.2d+18) then
tmp = b * r
else
tmp = t_0
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double t_0 = r / -Math.sin(a);
double tmp;
if (b <= -7e+15) {
tmp = t_0;
} else if (b <= 5.2e+18) {
tmp = b * r;
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r / -math.sin(a) tmp = 0 if b <= -7e+15: tmp = t_0 elif b <= 5.2e+18: tmp = b * r else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r / Float64(-sin(a))) tmp = 0.0 if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = Float64(b * r); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r / -sin(a); tmp = 0.0; if (b <= -7e+15) tmp = t_0; elseif (b <= 5.2e+18) tmp = b * r; else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r / (-N[Sin[a], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[b, -7e+15], t$95$0, If[LessEqual[b, 5.2e+18], N[(b * r), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{r}{-\sin a}\\
\mathbf{if}\;b \leq -7 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+18}:\\
\;\;\;\;b \cdot r\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -7e15 or 5.2e18 < b Initial program 49.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6449.8
Applied rewrites49.8%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-cos.f6410.6
Applied rewrites10.6%
Taylor expanded in b around inf
Applied rewrites10.5%
if -7e15 < b < 5.2e18Initial program 98.6%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f6495.8
Applied rewrites95.8%
Taylor expanded in a around 0
Applied rewrites66.5%
(FPCore (r a b) :precision binary64 (if (<= b 3.6e+16) (/ (* b r) (cos (+ a b))) (/ r (- (sin a)))))
double code(double r, double a, double b) {
double tmp;
if (b <= 3.6e+16) {
tmp = (b * r) / cos((a + b));
} else {
tmp = r / -sin(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 <= 3.6d+16) then
tmp = (b * r) / cos((a + b))
else
tmp = r / -sin(a)
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if (b <= 3.6e+16) {
tmp = (b * r) / Math.cos((a + b));
} else {
tmp = r / -Math.sin(a);
}
return tmp;
}
def code(r, a, b): tmp = 0 if b <= 3.6e+16: tmp = (b * r) / math.cos((a + b)) else: tmp = r / -math.sin(a) return tmp
function code(r, a, b) tmp = 0.0 if (b <= 3.6e+16) tmp = Float64(Float64(b * r) / cos(Float64(a + b))); else tmp = Float64(r / Float64(-sin(a))); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if (b <= 3.6e+16) tmp = (b * r) / cos((a + b)); else tmp = r / -sin(a); end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[b, 3.6e+16], N[(N[(b * r), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(r / (-N[Sin[a], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.6 \cdot 10^{+16}:\\
\;\;\;\;\frac{b \cdot r}{\cos \left(a + b\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{r}{-\sin a}\\
\end{array}
\end{array}
if b < 3.6e16Initial program 83.5%
Taylor expanded in b around 0
lower-*.f6469.5
Applied rewrites69.5%
if 3.6e16 < b Initial program 53.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6453.5
Applied rewrites53.5%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-/.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-sin.f64N/A
lower-cos.f6410.3
Applied rewrites10.3%
Taylor expanded in b around inf
Applied rewrites10.0%
(FPCore (r a b) :precision binary64 (* b r))
double code(double r, double a, double b) {
return b * r;
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = b * r
end function
public static double code(double r, double a, double b) {
return b * r;
}
def code(r, a, b): return b * r
function code(r, a, b) return Float64(b * r) end
function tmp = code(r, a, b) tmp = b * r; end
code[r_, a_, b_] := N[(b * r), $MachinePrecision]
\begin{array}{l}
\\
b \cdot r
\end{array}
Initial program 76.3%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f6453.6
Applied rewrites53.6%
Taylor expanded in a around 0
Applied rewrites37.6%
herbie shell --seed 2024273
(FPCore (r a b)
:name "rsin A (should all be same)"
:precision binary64
(/ (* r (sin b)) (cos (+ a b))))