
(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 17 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 (- 0.0 (sin b)) (sin a) (* (cos a) (cos b)))))
double code(double r, double a, double b) {
return (r * sin(b)) / fma((0.0 - sin(b)), sin(a), (cos(a) * cos(b)));
}
function code(r, a, b) return Float64(Float64(r * sin(b)) / fma(Float64(0.0 - sin(b)), sin(a), Float64(cos(a) * cos(b)))) end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[(0.0 - N[Sin[b], $MachinePrecision]), $MachinePrecision] * N[Sin[a], $MachinePrecision] + N[(N[Cos[a], $MachinePrecision] * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r \cdot \sin b}{\mathsf{fma}\left(0 - \sin b, \sin a, \cos a \cdot \cos b\right)}
\end{array}
Initial program 77.5%
cos-sumN/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
cos-lowering-cos.f6499.6%
Applied egg-rr99.6%
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (- (* (cos a) (cos b)) (* (sin b) (sin a)))))
double code(double r, double a, double b) {
return (r * sin(b)) / ((cos(a) * cos(b)) - (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(a) * cos(b)) - (sin(b) * sin(a)))
end function
public static double code(double r, double a, double b) {
return (r * Math.sin(b)) / ((Math.cos(a) * Math.cos(b)) - (Math.sin(b) * Math.sin(a)));
}
def code(r, a, b): return (r * math.sin(b)) / ((math.cos(a) * math.cos(b)) - (math.sin(b) * math.sin(a)))
function code(r, a, b) return Float64(Float64(r * sin(b)) / Float64(Float64(cos(a) * cos(b)) - Float64(sin(b) * sin(a)))) end
function tmp = code(r, a, b) tmp = (r * sin(b)) / ((cos(a) * cos(b)) - (sin(b) * sin(a))); end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Cos[a], $MachinePrecision] * N[Cos[b], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r \cdot \sin b}{\cos a \cdot \cos b - \sin b \cdot \sin a}
\end{array}
Initial program 77.5%
cos-sumN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Applied egg-rr99.5%
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (- (* (cos a) (cos b)) (* (sin b) (sin a))))))
double code(double r, double a, double b) {
return r * (sin(b) / ((cos(a) * cos(b)) - (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(a) * cos(b)) - (sin(b) * sin(a))))
end function
public static double code(double r, double a, double b) {
return r * (Math.sin(b) / ((Math.cos(a) * Math.cos(b)) - (Math.sin(b) * Math.sin(a))));
}
def code(r, a, b): return r * (math.sin(b) / ((math.cos(a) * math.cos(b)) - (math.sin(b) * math.sin(a))))
function code(r, a, b) return Float64(r * Float64(sin(b) / Float64(Float64(cos(a) * cos(b)) - Float64(sin(b) * sin(a))))) end
function tmp = code(r, a, b) tmp = r * (sin(b) / ((cos(a) * cos(b)) - (sin(b) * sin(a)))); end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[(N[(N[Cos[a], $MachinePrecision] * N[Cos[b], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\cos a \cdot \cos b - \sin b \cdot \sin a}
\end{array}
Initial program 77.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6477.4%
Applied egg-rr77.4%
cos-sumN/A
*-commutativeN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f6499.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= a -4.2e-6)
(/ t_0 (cos a))
(if (<= a 1650.0) (/ t_0 (cos b)) (* r (/ (sin b) (cos a)))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (a <= -4.2e-6) {
tmp = t_0 / cos(a);
} else if (a <= 1650.0) {
tmp = t_0 / cos(b);
} else {
tmp = r * (sin(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) :: t_0
real(8) :: tmp
t_0 = r * sin(b)
if (a <= (-4.2d-6)) then
tmp = t_0 / cos(a)
else if (a <= 1650.0d0) then
tmp = t_0 / cos(b)
else
tmp = r * (sin(b) / cos(a))
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double t_0 = r * Math.sin(b);
double tmp;
if (a <= -4.2e-6) {
tmp = t_0 / Math.cos(a);
} else if (a <= 1650.0) {
tmp = t_0 / Math.cos(b);
} else {
tmp = r * (Math.sin(b) / Math.cos(a));
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if a <= -4.2e-6: tmp = t_0 / math.cos(a) elif a <= 1650.0: tmp = t_0 / math.cos(b) else: tmp = r * (math.sin(b) / math.cos(a)) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (a <= -4.2e-6) tmp = Float64(t_0 / cos(a)); elseif (a <= 1650.0) tmp = Float64(t_0 / cos(b)); else tmp = Float64(r * Float64(sin(b) / cos(a))); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (a <= -4.2e-6) tmp = t_0 / cos(a); elseif (a <= 1650.0) tmp = t_0 / cos(b); else tmp = r * (sin(b) / cos(a)); end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e-6], N[(t$95$0 / N[Cos[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1650.0], N[(t$95$0 / N[Cos[b], $MachinePrecision]), $MachinePrecision], N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{t\_0}{\cos a}\\
\mathbf{elif}\;a \leq 1650:\\
\;\;\;\;\frac{t\_0}{\cos b}\\
\mathbf{else}:\\
\;\;\;\;r \cdot \frac{\sin b}{\cos a}\\
\end{array}
\end{array}
if a < -4.1999999999999996e-6Initial program 57.2%
Taylor expanded in b around 0
cos-lowering-cos.f6459.1%
Simplified59.1%
if -4.1999999999999996e-6 < a < 1650Initial program 98.1%
Taylor expanded in a around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6497.8%
Simplified97.8%
if 1650 < a Initial program 54.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6454.0%
Applied egg-rr54.0%
Taylor expanded in b around 0
cos-lowering-cos.f6454.3%
Simplified54.3%
Final simplification77.9%
(FPCore (r a b) :precision binary64 (if (<= a -3.65e-6) (/ (* r (sin b)) (cos a)) (if (<= a 1650.0) (* r (/ (sin b) (cos b))) (* r (/ (sin b) (cos a))))))
double code(double r, double a, double b) {
double tmp;
if (a <= -3.65e-6) {
tmp = (r * sin(b)) / cos(a);
} else if (a <= 1650.0) {
tmp = r * (sin(b) / cos(b));
} else {
tmp = r * (sin(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 (a <= (-3.65d-6)) then
tmp = (r * sin(b)) / cos(a)
else if (a <= 1650.0d0) then
tmp = r * (sin(b) / cos(b))
else
tmp = r * (sin(b) / cos(a))
end if
code = tmp
end function
public static double code(double r, double a, double b) {
double tmp;
if (a <= -3.65e-6) {
tmp = (r * Math.sin(b)) / Math.cos(a);
} else if (a <= 1650.0) {
tmp = r * (Math.sin(b) / Math.cos(b));
} else {
tmp = r * (Math.sin(b) / Math.cos(a));
}
return tmp;
}
def code(r, a, b): tmp = 0 if a <= -3.65e-6: tmp = (r * math.sin(b)) / math.cos(a) elif a <= 1650.0: tmp = r * (math.sin(b) / math.cos(b)) else: tmp = r * (math.sin(b) / math.cos(a)) return tmp
function code(r, a, b) tmp = 0.0 if (a <= -3.65e-6) tmp = Float64(Float64(r * sin(b)) / cos(a)); elseif (a <= 1650.0) tmp = Float64(r * Float64(sin(b) / cos(b))); else tmp = Float64(r * Float64(sin(b) / cos(a))); end return tmp end
function tmp_2 = code(r, a, b) tmp = 0.0; if (a <= -3.65e-6) tmp = (r * sin(b)) / cos(a); elseif (a <= 1650.0) tmp = r * (sin(b) / cos(b)); else tmp = r * (sin(b) / cos(a)); end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[a, -3.65e-6], N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1650.0], N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.65 \cdot 10^{-6}:\\
\;\;\;\;\frac{r \cdot \sin b}{\cos a}\\
\mathbf{elif}\;a \leq 1650:\\
\;\;\;\;r \cdot \frac{\sin b}{\cos b}\\
\mathbf{else}:\\
\;\;\;\;r \cdot \frac{\sin b}{\cos a}\\
\end{array}
\end{array}
if a < -3.65000000000000021e-6Initial program 57.2%
Taylor expanded in b around 0
cos-lowering-cos.f6459.1%
Simplified59.1%
if -3.65000000000000021e-6 < a < 1650Initial program 98.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
Taylor expanded in a around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6497.7%
Simplified97.7%
if 1650 < a Initial program 54.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6454.0%
Applied egg-rr54.0%
Taylor expanded in b around 0
cos-lowering-cos.f6454.3%
Simplified54.3%
Final simplification77.9%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* r (/ (sin b) (cos a))))) (if (<= a -4.2e-6) t_0 (if (<= a 1650.0) (* r (/ (sin b) (cos b))) t_0))))
double code(double r, double a, double b) {
double t_0 = r * (sin(b) / cos(a));
double tmp;
if (a <= -4.2e-6) {
tmp = t_0;
} else if (a <= 1650.0) {
tmp = r * (sin(b) / cos(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(b) / cos(a))
if (a <= (-4.2d-6)) then
tmp = t_0
else if (a <= 1650.0d0) then
tmp = r * (sin(b) / cos(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(b) / Math.cos(a));
double tmp;
if (a <= -4.2e-6) {
tmp = t_0;
} else if (a <= 1650.0) {
tmp = r * (Math.sin(b) / Math.cos(b));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * (math.sin(b) / math.cos(a)) tmp = 0 if a <= -4.2e-6: tmp = t_0 elif a <= 1650.0: tmp = r * (math.sin(b) / math.cos(b)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * Float64(sin(b) / cos(a))) tmp = 0.0 if (a <= -4.2e-6) tmp = t_0; elseif (a <= 1650.0) tmp = Float64(r * Float64(sin(b) / cos(b))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * (sin(b) / cos(a)); tmp = 0.0; if (a <= -4.2e-6) tmp = t_0; elseif (a <= 1650.0) tmp = r * (sin(b) / cos(b)); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e-6], t$95$0, If[LessEqual[a, 1650.0], N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \frac{\sin b}{\cos a}\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 1650:\\
\;\;\;\;r \cdot \frac{\sin b}{\cos b}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -4.1999999999999996e-6 or 1650 < a Initial program 55.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6455.6%
Applied egg-rr55.6%
Taylor expanded in b around 0
cos-lowering-cos.f6456.7%
Simplified56.7%
if -4.1999999999999996e-6 < a < 1650Initial program 98.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Applied egg-rr98.0%
Taylor expanded in a around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6497.7%
Simplified97.7%
Final simplification77.8%
(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(Float64(r * 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[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{r \cdot \sin b}{\cos \left(b + a\right)}
\end{array}
Initial program 77.5%
Final simplification77.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 77.5%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6477.5%
Applied egg-rr77.5%
Final simplification77.5%
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (cos a))))
double code(double r, double a, double b) {
return r * (sin(b) / cos(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(a))
end function
public static double code(double r, double a, double b) {
return r * (Math.sin(b) / Math.cos(a));
}
def code(r, a, b): return r * (math.sin(b) / math.cos(a))
function code(r, a, b) return Float64(r * Float64(sin(b) / cos(a))) end
function tmp = code(r, a, b) tmp = r * (sin(b) / cos(a)); end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\cos a}
\end{array}
Initial program 77.5%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6477.4%
Applied egg-rr77.4%
Taylor expanded in b around 0
cos-lowering-cos.f6454.4%
Simplified54.4%
Final simplification54.4%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -3.3)
t_0
(if (<= b 61.0)
(/
(*
r
(*
b
(+
1.0
(*
(* b b)
(+ -0.16666666666666666 (* (* b b) 0.008333333333333333))))))
(cos (+ b a)))
t_0))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -3.3) {
tmp = t_0;
} else if (b <= 61.0) {
tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + ((b * b) * 0.008333333333333333)))))) / cos((b + 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(b)
if (b <= (-3.3d0)) then
tmp = t_0
else if (b <= 61.0d0) then
tmp = (r * (b * (1.0d0 + ((b * b) * ((-0.16666666666666666d0) + ((b * b) * 0.008333333333333333d0)))))) / cos((b + 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(b);
double tmp;
if (b <= -3.3) {
tmp = t_0;
} else if (b <= 61.0) {
tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + ((b * b) * 0.008333333333333333)))))) / Math.cos((b + a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -3.3: tmp = t_0 elif b <= 61.0: tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + ((b * b) * 0.008333333333333333)))))) / math.cos((b + a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -3.3) tmp = t_0; elseif (b <= 61.0) tmp = Float64(Float64(r * Float64(b * Float64(1.0 + Float64(Float64(b * b) * Float64(-0.16666666666666666 + Float64(Float64(b * b) * 0.008333333333333333)))))) / cos(Float64(b + a))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -3.3) tmp = t_0; elseif (b <= 61.0) tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + ((b * b) * 0.008333333333333333)))))) / cos((b + a)); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.3], t$95$0, If[LessEqual[b, 61.0], N[(N[(r * N[(b * N[(1.0 + N[(N[(b * b), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(b * b), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -3.3:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 61:\\
\;\;\;\;\frac{r \cdot \left(b \cdot \left(1 + \left(b \cdot b\right) \cdot \left(-0.16666666666666666 + \left(b \cdot b\right) \cdot 0.008333333333333333\right)\right)\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -3.2999999999999998 or 61 < b Initial program 57.0%
Taylor expanded in b around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f647.3%
Simplified7.3%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f6412.4%
Simplified12.4%
if -3.2999999999999998 < b < 61Initial program 98.6%
Taylor expanded in b around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6498.0%
Simplified98.0%
Final simplification54.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -270.0)
t_0
(if (<= b 1560000.0)
(/ (* (+ 1.0 (* b (* b -0.16666666666666666))) (* r b)) (cos (+ b a)))
t_0))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -270.0) {
tmp = t_0;
} else if (b <= 1560000.0) {
tmp = ((1.0 + (b * (b * -0.16666666666666666))) * (r * b)) / cos((b + 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(b)
if (b <= (-270.0d0)) then
tmp = t_0
else if (b <= 1560000.0d0) then
tmp = ((1.0d0 + (b * (b * (-0.16666666666666666d0)))) * (r * b)) / cos((b + 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(b);
double tmp;
if (b <= -270.0) {
tmp = t_0;
} else if (b <= 1560000.0) {
tmp = ((1.0 + (b * (b * -0.16666666666666666))) * (r * b)) / Math.cos((b + a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -270.0: tmp = t_0 elif b <= 1560000.0: tmp = ((1.0 + (b * (b * -0.16666666666666666))) * (r * b)) / math.cos((b + a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -270.0) tmp = t_0; elseif (b <= 1560000.0) tmp = Float64(Float64(Float64(1.0 + Float64(b * Float64(b * -0.16666666666666666))) * Float64(r * b)) / cos(Float64(b + a))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -270.0) tmp = t_0; elseif (b <= 1560000.0) tmp = ((1.0 + (b * (b * -0.16666666666666666))) * (r * b)) / cos((b + a)); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -270.0], t$95$0, If[LessEqual[b, 1560000.0], N[(N[(N[(1.0 + N[(b * N[(b * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(r * b), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -270:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 1560000:\\
\;\;\;\;\frac{\left(1 + b \cdot \left(b \cdot -0.16666666666666666\right)\right) \cdot \left(r \cdot b\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -270 or 1.56e6 < b Initial program 56.3%
Taylor expanded in b around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f647.1%
Simplified7.1%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f6412.5%
Simplified12.5%
if -270 < b < 1.56e6Initial program 98.4%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6495.7%
Simplified95.7%
Final simplification54.4%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -380.0)
t_0
(if (<= b 1800000.0)
(/ (* r (* b (+ 1.0 (* b (* b -0.16666666666666666))))) (cos (+ b a)))
t_0))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -380.0) {
tmp = t_0;
} else if (b <= 1800000.0) {
tmp = (r * (b * (1.0 + (b * (b * -0.16666666666666666))))) / cos((b + 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(b)
if (b <= (-380.0d0)) then
tmp = t_0
else if (b <= 1800000.0d0) then
tmp = (r * (b * (1.0d0 + (b * (b * (-0.16666666666666666d0)))))) / cos((b + 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(b);
double tmp;
if (b <= -380.0) {
tmp = t_0;
} else if (b <= 1800000.0) {
tmp = (r * (b * (1.0 + (b * (b * -0.16666666666666666))))) / Math.cos((b + a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -380.0: tmp = t_0 elif b <= 1800000.0: tmp = (r * (b * (1.0 + (b * (b * -0.16666666666666666))))) / math.cos((b + a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -380.0) tmp = t_0; elseif (b <= 1800000.0) tmp = Float64(Float64(r * Float64(b * Float64(1.0 + Float64(b * Float64(b * -0.16666666666666666))))) / cos(Float64(b + a))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -380.0) tmp = t_0; elseif (b <= 1800000.0) tmp = (r * (b * (1.0 + (b * (b * -0.16666666666666666))))) / cos((b + a)); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -380.0], t$95$0, If[LessEqual[b, 1800000.0], N[(N[(r * N[(b * N[(1.0 + N[(b * N[(b * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -380:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 1800000:\\
\;\;\;\;\frac{r \cdot \left(b \cdot \left(1 + b \cdot \left(b \cdot -0.16666666666666666\right)\right)\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -380 or 1.8e6 < b Initial program 56.3%
Taylor expanded in b around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f647.1%
Simplified7.1%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f6412.5%
Simplified12.5%
if -380 < b < 1.8e6Initial program 98.4%
Taylor expanded in b around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.7%
Simplified95.7%
Final simplification54.4%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -380.0)
t_0
(if (<= b 1800000.0)
(* (* r b) (/ (+ 1.0 (* (* b b) -0.16666666666666666)) (cos (+ b a))))
t_0))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -380.0) {
tmp = t_0;
} else if (b <= 1800000.0) {
tmp = (r * b) * ((1.0 + ((b * b) * -0.16666666666666666)) / cos((b + 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(b)
if (b <= (-380.0d0)) then
tmp = t_0
else if (b <= 1800000.0d0) then
tmp = (r * b) * ((1.0d0 + ((b * b) * (-0.16666666666666666d0))) / cos((b + 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(b);
double tmp;
if (b <= -380.0) {
tmp = t_0;
} else if (b <= 1800000.0) {
tmp = (r * b) * ((1.0 + ((b * b) * -0.16666666666666666)) / Math.cos((b + a)));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -380.0: tmp = t_0 elif b <= 1800000.0: tmp = (r * b) * ((1.0 + ((b * b) * -0.16666666666666666)) / math.cos((b + a))) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -380.0) tmp = t_0; elseif (b <= 1800000.0) tmp = Float64(Float64(r * b) * Float64(Float64(1.0 + Float64(Float64(b * b) * -0.16666666666666666)) / cos(Float64(b + a)))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -380.0) tmp = t_0; elseif (b <= 1800000.0) tmp = (r * b) * ((1.0 + ((b * b) * -0.16666666666666666)) / cos((b + a))); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -380.0], t$95$0, If[LessEqual[b, 1800000.0], N[(N[(r * b), $MachinePrecision] * N[(N[(1.0 + N[(N[(b * b), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -380:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 1800000:\\
\;\;\;\;\left(r \cdot b\right) \cdot \frac{1 + \left(b \cdot b\right) \cdot -0.16666666666666666}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -380 or 1.8e6 < b Initial program 56.3%
Taylor expanded in b around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f647.1%
Simplified7.1%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f6412.5%
Simplified12.5%
if -380 < b < 1.8e6Initial program 98.4%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-lft1-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6495.7%
Simplified95.7%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
cos-lowering-cos.f64N/A
+-lowering-+.f6495.6%
Applied egg-rr95.6%
Final simplification54.4%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* r (sin b)))) (if (<= b -2.85) t_0 (if (<= b 1400.0) (/ (* r b) (cos (+ b a))) t_0))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -2.85) {
tmp = t_0;
} else if (b <= 1400.0) {
tmp = (r * b) / cos((b + 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(b)
if (b <= (-2.85d0)) then
tmp = t_0
else if (b <= 1400.0d0) then
tmp = (r * b) / cos((b + 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(b);
double tmp;
if (b <= -2.85) {
tmp = t_0;
} else if (b <= 1400.0) {
tmp = (r * b) / Math.cos((b + a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -2.85: tmp = t_0 elif b <= 1400.0: tmp = (r * b) / math.cos((b + a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -2.85) tmp = t_0; elseif (b <= 1400.0) tmp = Float64(Float64(r * b) / cos(Float64(b + a))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -2.85) tmp = t_0; elseif (b <= 1400.0) tmp = (r * b) / cos((b + a)); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.85], t$95$0, If[LessEqual[b, 1400.0], N[(N[(r * b), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -2.85:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 1400:\\
\;\;\;\;\frac{r \cdot b}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -2.85000000000000009 or 1400 < b Initial program 57.0%
Taylor expanded in b around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f647.3%
Simplified7.3%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f6412.4%
Simplified12.4%
if -2.85000000000000009 < b < 1400Initial program 98.6%
Taylor expanded in b around 0
*-commutativeN/A
*-lowering-*.f6497.4%
Simplified97.4%
Final simplification54.2%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* r (sin b)))) (if (<= b -1.3) t_0 (if (<= b 1560000.0) (* b (/ r (cos a))) t_0))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -1.3) {
tmp = t_0;
} else if (b <= 1560000.0) {
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(b)
if (b <= (-1.3d0)) then
tmp = t_0
else if (b <= 1560000.0d0) 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(b);
double tmp;
if (b <= -1.3) {
tmp = t_0;
} else if (b <= 1560000.0) {
tmp = b * (r / Math.cos(a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -1.3: tmp = t_0 elif b <= 1560000.0: tmp = b * (r / math.cos(a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -1.3) tmp = t_0; elseif (b <= 1560000.0) tmp = Float64(b * Float64(r / cos(a))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -1.3) tmp = t_0; elseif (b <= 1560000.0) 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[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3], t$95$0, If[LessEqual[b, 1560000.0], N[(b * N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -1.3:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 1560000:\\
\;\;\;\;b \cdot \frac{r}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -1.30000000000000004 or 1.56e6 < b Initial program 56.9%
Taylor expanded in b around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f647.2%
Simplified7.2%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f6412.5%
Simplified12.5%
if -1.30000000000000004 < b < 1.56e6Initial program 98.4%
Taylor expanded in b around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6496.5%
Simplified96.5%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6496.6%
Applied egg-rr96.6%
Final simplification54.2%
(FPCore (r a b) :precision binary64 (* r (sin b)))
double code(double r, double a, double b) {
return r * 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 * sin(b)
end function
public static double code(double r, double a, double b) {
return r * Math.sin(b);
}
def code(r, a, b): return r * math.sin(b)
function code(r, a, b) return Float64(r * sin(b)) end
function tmp = code(r, a, b) tmp = r * sin(b); end
code[r_, a_, b_] := N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \sin b
\end{array}
Initial program 77.5%
Taylor expanded in b around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6451.7%
Simplified51.7%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f6437.2%
Simplified37.2%
Final simplification37.2%
(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 77.5%
Taylor expanded in b around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6449.6%
Simplified49.6%
Taylor expanded in a around 0
*-lowering-*.f6432.9%
Simplified32.9%
Final simplification32.9%
herbie shell --seed 2024192
(FPCore (r a b)
:name "rsin A (should all be same)"
:precision binary64
(/ (* r (sin b)) (cos (+ a b))))