
(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(r * Float64(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[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\cos \left(a + b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 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(r * Float64(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[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\cos \left(a + b\right)}
\end{array}
(FPCore (r a b) :precision binary64 (/ (* (sin b) r) (fma (- 0.0 (sin b)) (sin a) (* (cos a) (cos b)))))
double code(double r, double a, double b) {
return (sin(b) * r) / fma((0.0 - sin(b)), sin(a), (cos(a) * cos(b)));
}
function code(r, a, b) return Float64(Float64(sin(b) * r) / fma(Float64(0.0 - sin(b)), sin(a), Float64(cos(a) * cos(b)))) end
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $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{\sin b \cdot r}{\mathsf{fma}\left(0 - \sin b, \sin a, \cos a \cdot \cos b\right)}
\end{array}
Initial program 77.4%
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%
Taylor expanded in r around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/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%
Simplified99.5%
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 (/ (* (sin b) r) (- (* (cos a) (cos b)) (* (sin b) (sin a)))))
double code(double r, double a, double b) {
return (sin(b) * r) / ((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 = (sin(b) * r) / ((cos(a) * cos(b)) - (sin(b) * sin(a)))
end function
public static double code(double r, double a, double b) {
return (Math.sin(b) * r) / ((Math.cos(a) * Math.cos(b)) - (Math.sin(b) * Math.sin(a)));
}
def code(r, a, b): return (math.sin(b) * r) / ((math.cos(a) * math.cos(b)) - (math.sin(b) * math.sin(a)))
function code(r, a, b) return Float64(Float64(sin(b) * r) / Float64(Float64(cos(a) * cos(b)) - Float64(sin(b) * sin(a)))) end
function tmp = code(r, a, b) tmp = (sin(b) * r) / ((cos(a) * cos(b)) - (sin(b) * sin(a))); end
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $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{\sin b \cdot r}{\cos a \cdot \cos b - \sin b \cdot \sin a}
\end{array}
Initial program 77.4%
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%
Taylor expanded in r around 0
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/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%
Simplified99.5%
Final simplification99.5%
(FPCore (r a b) :precision binary64 (* (sin b) (/ r (- (* (cos a) (cos b)) (* (sin b) (sin a))))))
double code(double r, double a, double b) {
return sin(b) * (r / ((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 = sin(b) * (r / ((cos(a) * cos(b)) - (sin(b) * sin(a))))
end function
public static double code(double r, double a, double b) {
return Math.sin(b) * (r / ((Math.cos(a) * Math.cos(b)) - (Math.sin(b) * Math.sin(a))));
}
def code(r, a, b): return math.sin(b) * (r / ((math.cos(a) * math.cos(b)) - (math.sin(b) * math.sin(a))))
function code(r, a, b) return Float64(sin(b) * Float64(r / Float64(Float64(cos(a) * cos(b)) - Float64(sin(b) * sin(a))))) end
function tmp = code(r, a, b) tmp = sin(b) * (r / ((cos(a) * cos(b)) - (sin(b) * sin(a)))); end
code[r_, a_, b_] := N[(N[Sin[b], $MachinePrecision] * N[(r / 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}
\\
\sin b \cdot \frac{r}{\cos a \cdot \cos b - \sin b \cdot \sin a}
\end{array}
Initial program 77.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6477.5%
Applied egg-rr77.5%
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 (* 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.4%
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 (if (<= a -4.2e-6) (* (sin b) (/ r (cos a))) (if (<= a 1650.0) (/ (* (sin b) r) (cos b)) (* r (/ (sin b) (cos a))))))
double code(double r, double a, double b) {
double tmp;
if (a <= -4.2e-6) {
tmp = sin(b) * (r / cos(a));
} else if (a <= 1650.0) {
tmp = (sin(b) * r) / 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 <= (-4.2d-6)) then
tmp = sin(b) * (r / cos(a))
else if (a <= 1650.0d0) then
tmp = (sin(b) * r) / 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 <= -4.2e-6) {
tmp = Math.sin(b) * (r / Math.cos(a));
} else if (a <= 1650.0) {
tmp = (Math.sin(b) * r) / Math.cos(b);
} else {
tmp = r * (Math.sin(b) / Math.cos(a));
}
return tmp;
}
def code(r, a, b): tmp = 0 if a <= -4.2e-6: tmp = math.sin(b) * (r / math.cos(a)) elif a <= 1650.0: tmp = (math.sin(b) * r) / math.cos(b) else: tmp = r * (math.sin(b) / math.cos(a)) return tmp
function code(r, a, b) tmp = 0.0 if (a <= -4.2e-6) tmp = Float64(sin(b) * Float64(r / cos(a))); elseif (a <= 1650.0) tmp = Float64(Float64(sin(b) * r) / 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 <= -4.2e-6) tmp = sin(b) * (r / cos(a)); elseif (a <= 1650.0) tmp = (sin(b) * r) / cos(b); else tmp = r * (sin(b) / cos(a)); end tmp_2 = tmp; end
code[r_, a_, b_] := If[LessEqual[a, -4.2e-6], N[(N[Sin[b], $MachinePrecision] * N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1650.0], N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[Cos[b], $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 -4.2 \cdot 10^{-6}:\\
\;\;\;\;\sin b \cdot \frac{r}{\cos a}\\
\mathbf{elif}\;a \leq 1650:\\
\;\;\;\;\frac{\sin b \cdot r}{\cos b}\\
\mathbf{else}:\\
\;\;\;\;r \cdot \frac{\sin b}{\cos a}\\
\end{array}
\end{array}
if a < -4.1999999999999996e-6Initial program 57.1%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6457.3%
Applied egg-rr57.3%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6459.2%
Simplified59.2%
if -4.1999999999999996e-6 < a < 1650Initial program 98.0%
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%
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) (* (sin b) (/ r (cos a))) (if (<= a 1650.0) (* (sin b) (/ r (cos b))) (* r (/ (sin b) (cos a))))))
double code(double r, double a, double b) {
double tmp;
if (a <= -3.65e-6) {
tmp = sin(b) * (r / cos(a));
} else if (a <= 1650.0) {
tmp = sin(b) * (r / 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 = sin(b) * (r / cos(a))
else if (a <= 1650.0d0) then
tmp = sin(b) * (r / 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 = Math.sin(b) * (r / Math.cos(a));
} else if (a <= 1650.0) {
tmp = Math.sin(b) * (r / 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 = math.sin(b) * (r / math.cos(a)) elif a <= 1650.0: tmp = math.sin(b) * (r / 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(sin(b) * Float64(r / cos(a))); elseif (a <= 1650.0) tmp = Float64(sin(b) * Float64(r / 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 = sin(b) * (r / cos(a)); elseif (a <= 1650.0) tmp = sin(b) * (r / 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[Sin[b], $MachinePrecision] * N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1650.0], N[(N[Sin[b], $MachinePrecision] * N[(r / 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}:\\
\;\;\;\;\sin b \cdot \frac{r}{\cos a}\\
\mathbf{elif}\;a \leq 1650:\\
\;\;\;\;\sin b \cdot \frac{r}{\cos b}\\
\mathbf{else}:\\
\;\;\;\;r \cdot \frac{\sin b}{\cos a}\\
\end{array}
\end{array}
if a < -3.65000000000000021e-6Initial program 57.1%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6457.3%
Applied egg-rr57.3%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6459.2%
Simplified59.2%
if -3.65000000000000021e-6 < a < 1650Initial program 98.0%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6498.0%
Applied egg-rr98.0%
Taylor expanded in a around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6497.8%
Simplified97.8%
if 1650 < a Initial program 54.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 -4.2e-6) (* (sin b) (/ r (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 <= -4.2e-6) {
tmp = sin(b) * (r / 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 <= (-4.2d-6)) then
tmp = sin(b) * (r / 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 <= -4.2e-6) {
tmp = Math.sin(b) * (r / 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 <= -4.2e-6: tmp = math.sin(b) * (r / 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 <= -4.2e-6) tmp = Float64(sin(b) * Float64(r / 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 <= -4.2e-6) tmp = sin(b) * (r / 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, -4.2e-6], N[(N[Sin[b], $MachinePrecision] * N[(r / N[Cos[a], $MachinePrecision]), $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 -4.2 \cdot 10^{-6}:\\
\;\;\;\;\sin b \cdot \frac{r}{\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 < -4.1999999999999996e-6Initial program 57.1%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6457.3%
Applied egg-rr57.3%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6459.2%
Simplified59.2%
if -4.1999999999999996e-6 < a < 1650Initial program 98.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%
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%
Taylor expanded in b around 0
cos-lowering-cos.f6456.7%
Simplified56.7%
if -4.1999999999999996e-6 < a < 1650Initial program 98.0%
Taylor expanded in a around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6497.7%
Simplified97.7%
(FPCore (r a b) :precision binary64 (* (sin b) (/ r (cos (* (- b a) (/ (+ b a) (- b a)))))))
double code(double r, double a, double b) {
return sin(b) * (r / cos(((b - a) * ((b + a) / (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) * ((b + a) / (b - a)))))
end function
public static double code(double r, double a, double b) {
return Math.sin(b) * (r / Math.cos(((b - a) * ((b + a) / (b - a)))));
}
def code(r, a, b): return math.sin(b) * (r / math.cos(((b - a) * ((b + a) / (b - a)))))
function code(r, a, b) return Float64(sin(b) * Float64(r / cos(Float64(Float64(b - a) * Float64(Float64(b + a) / Float64(b - a)))))) end
function tmp = code(r, a, b) tmp = sin(b) * (r / cos(((b - a) * ((b + a) / (b - a))))); end
code[r_, a_, b_] := N[(N[Sin[b], $MachinePrecision] * N[(r / N[Cos[N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] / N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin b \cdot \frac{r}{\cos \left(\left(b - a\right) \cdot \frac{b + a}{b - a}\right)}
\end{array}
Initial program 77.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6477.5%
Applied egg-rr77.5%
flip-+N/A
div-invN/A
difference-of-squaresN/A
associate-*l*N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6472.7%
Applied egg-rr72.7%
associate-*r*N/A
un-div-invN/A
*-rgt-identityN/A
times-fracN/A
/-rgt-identityN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
--lowering--.f64N/A
--lowering--.f6477.5%
Applied egg-rr77.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(Float64(sin(b) * 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[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin b \cdot r}{\cos \left(b + a\right)}
\end{array}
Initial program 77.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6477.5%
Applied egg-rr77.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.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/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 (+ 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 77.4%
Final simplification77.4%
(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.4%
Taylor expanded in b around 0
cos-lowering-cos.f6454.4%
Simplified54.4%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* (sin b) r)))
(if (<= b -4.4)
t_0
(if (<= b 3700.0)
(*
(/ r (cos (+ b a)))
(*
b
(+
1.0
(*
b
(* b (+ -0.16666666666666666 (* (* b b) 0.008333333333333333)))))))
t_0))))
double code(double r, double a, double b) {
double t_0 = sin(b) * r;
double tmp;
if (b <= -4.4) {
tmp = t_0;
} else if (b <= 3700.0) {
tmp = (r / cos((b + a))) * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333))))));
} 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 = sin(b) * r
if (b <= (-4.4d0)) then
tmp = t_0
else if (b <= 3700.0d0) then
tmp = (r / cos((b + a))) * (b * (1.0d0 + (b * (b * ((-0.16666666666666666d0) + ((b * b) * 0.008333333333333333d0))))))
else
tmp = t_0
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 (b <= -4.4) {
tmp = t_0;
} else if (b <= 3700.0) {
tmp = (r / Math.cos((b + a))) * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333))))));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = math.sin(b) * r tmp = 0 if b <= -4.4: tmp = t_0 elif b <= 3700.0: tmp = (r / math.cos((b + a))) * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333)))))) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(sin(b) * r) tmp = 0.0 if (b <= -4.4) tmp = t_0; elseif (b <= 3700.0) tmp = Float64(Float64(r / cos(Float64(b + a))) * Float64(b * Float64(1.0 + Float64(b * Float64(b * Float64(-0.16666666666666666 + Float64(Float64(b * b) * 0.008333333333333333))))))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = sin(b) * r; tmp = 0.0; if (b <= -4.4) tmp = t_0; elseif (b <= 3700.0) tmp = (r / cos((b + a))) * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333)))))); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -4.4], t$95$0, If[LessEqual[b, 3700.0], N[(N[(r / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(b * N[(1.0 + N[(b * N[(b * N[(-0.16666666666666666 + N[(N[(b * b), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;b \leq -4.4:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 3700:\\
\;\;\;\;\frac{r}{\cos \left(b + a\right)} \cdot \left(b \cdot \left(1 + b \cdot \left(b \cdot \left(-0.16666666666666666 + \left(b \cdot b\right) \cdot 0.008333333333333333\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -4.4000000000000004 or 3700 < b Initial program 56.9%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6456.9%
Applied egg-rr56.9%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6412.9%
Simplified12.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6412.4%
Simplified12.4%
if -4.4000000000000004 < b < 3700Initial program 98.6%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6498.6%
Applied egg-rr98.6%
Taylor expanded in b around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/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 (* (sin b) r)))
(if (<= b -7.0)
t_0
(if (<= b 10.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 = sin(b) * r;
double tmp;
if (b <= -7.0) {
tmp = t_0;
} else if (b <= 10.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 = sin(b) * r
if (b <= (-7.0d0)) then
tmp = t_0
else if (b <= 10.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 = Math.sin(b) * r;
double tmp;
if (b <= -7.0) {
tmp = t_0;
} else if (b <= 10.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 = math.sin(b) * r tmp = 0 if b <= -7.0: tmp = t_0 elif b <= 10.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(sin(b) * r) tmp = 0.0 if (b <= -7.0) tmp = t_0; elseif (b <= 10.0) tmp = Float64(r * Float64(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 = sin(b) * r; tmp = 0.0; if (b <= -7.0) tmp = t_0; elseif (b <= 10.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[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -7.0], t$95$0, If[LessEqual[b, 10.0], N[(r * N[(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] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;b \leq -7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 10:\\
\;\;\;\;r \cdot \frac{b \cdot \left(1 + \left(b \cdot b\right) \cdot \left(-0.16666666666666666 + \left(b \cdot b\right) \cdot 0.008333333333333333\right)\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -7 or 10 < b Initial program 56.9%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6456.9%
Applied egg-rr56.9%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6412.9%
Simplified12.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6412.4%
Simplified12.4%
if -7 < b < 10Initial 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-*.f6497.9%
Simplified97.9%
Final simplification54.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* (sin b) r)))
(if (<= b -1950.0)
t_0
(if (<= b 3200000.0)
(* (/ r (cos (+ b a))) (* b (+ 1.0 (* -0.16666666666666666 (* b b)))))
t_0))))
double code(double r, double a, double b) {
double t_0 = sin(b) * r;
double tmp;
if (b <= -1950.0) {
tmp = t_0;
} else if (b <= 3200000.0) {
tmp = (r / cos((b + a))) * (b * (1.0 + (-0.16666666666666666 * (b * 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 = sin(b) * r
if (b <= (-1950.0d0)) then
tmp = t_0
else if (b <= 3200000.0d0) then
tmp = (r / cos((b + a))) * (b * (1.0d0 + ((-0.16666666666666666d0) * (b * b))))
else
tmp = t_0
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 (b <= -1950.0) {
tmp = t_0;
} else if (b <= 3200000.0) {
tmp = (r / Math.cos((b + a))) * (b * (1.0 + (-0.16666666666666666 * (b * b))));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = math.sin(b) * r tmp = 0 if b <= -1950.0: tmp = t_0 elif b <= 3200000.0: tmp = (r / math.cos((b + a))) * (b * (1.0 + (-0.16666666666666666 * (b * b)))) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(sin(b) * r) tmp = 0.0 if (b <= -1950.0) tmp = t_0; elseif (b <= 3200000.0) tmp = Float64(Float64(r / cos(Float64(b + a))) * Float64(b * Float64(1.0 + Float64(-0.16666666666666666 * Float64(b * b))))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = sin(b) * r; tmp = 0.0; if (b <= -1950.0) tmp = t_0; elseif (b <= 3200000.0) tmp = (r / cos((b + a))) * (b * (1.0 + (-0.16666666666666666 * (b * b)))); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -1950.0], t$95$0, If[LessEqual[b, 3200000.0], N[(N[(r / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(b * N[(1.0 + N[(-0.16666666666666666 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;b \leq -1950:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 3200000:\\
\;\;\;\;\frac{r}{\cos \left(b + a\right)} \cdot \left(b \cdot \left(1 + -0.16666666666666666 \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -1950 or 3.2e6 < b Initial program 56.1%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6456.2%
Applied egg-rr56.2%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6413.0%
Simplified13.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6412.5%
Simplified12.5%
if -1950 < b < 3.2e6Initial program 98.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6498.4%
Applied egg-rr98.4%
Taylor expanded in b around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
Final simplification54.4%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* (sin b) r)))
(if (<= b -500.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 = sin(b) * r;
double tmp;
if (b <= -500.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 = sin(b) * r
if (b <= (-500.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 = Math.sin(b) * r;
double tmp;
if (b <= -500.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 = math.sin(b) * r tmp = 0 if b <= -500.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(sin(b) * r) tmp = 0.0 if (b <= -500.0) tmp = t_0; elseif (b <= 1800000.0) tmp = Float64(r * Float64(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 = sin(b) * r; tmp = 0.0; if (b <= -500.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[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -500.0], t$95$0, If[LessEqual[b, 1800000.0], N[(r * N[(N[(b * N[(1.0 + N[(b * N[(b * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;b \leq -500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 1800000:\\
\;\;\;\;r \cdot \frac{b \cdot \left(1 + b \cdot \left(b \cdot -0.16666666666666666\right)\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -500 or 1.8e6 < b Initial program 56.1%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6456.2%
Applied egg-rr56.2%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6413.0%
Simplified13.0%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6412.5%
Simplified12.5%
if -500 < b < 1.8e6Initial program 98.4%
Taylor expanded in b around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6495.6%
Simplified95.6%
Final simplification54.4%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* (sin b) r))) (if (<= b -0.95) t_0 (if (<= b 17.5) (* b (/ r (cos (+ b a)))) t_0))))
double code(double r, double a, double b) {
double t_0 = sin(b) * r;
double tmp;
if (b <= -0.95) {
tmp = t_0;
} else if (b <= 17.5) {
tmp = b * (r / 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 = sin(b) * r
if (b <= (-0.95d0)) then
tmp = t_0
else if (b <= 17.5d0) then
tmp = b * (r / 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 = Math.sin(b) * r;
double tmp;
if (b <= -0.95) {
tmp = t_0;
} else if (b <= 17.5) {
tmp = b * (r / Math.cos((b + a)));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = math.sin(b) * r tmp = 0 if b <= -0.95: tmp = t_0 elif b <= 17.5: tmp = b * (r / math.cos((b + a))) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(sin(b) * r) tmp = 0.0 if (b <= -0.95) tmp = t_0; elseif (b <= 17.5) tmp = Float64(b * Float64(r / cos(Float64(b + a)))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = sin(b) * r; tmp = 0.0; if (b <= -0.95) tmp = t_0; elseif (b <= 17.5) tmp = b * (r / cos((b + a))); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -0.95], t$95$0, If[LessEqual[b, 17.5], N[(b * N[(r / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;b \leq -0.95:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 17.5:\\
\;\;\;\;b \cdot \frac{r}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -0.94999999999999996 or 17.5 < b Initial program 56.9%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6456.9%
Applied egg-rr56.9%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6412.9%
Simplified12.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6412.4%
Simplified12.4%
if -0.94999999999999996 < b < 17.5Initial program 98.6%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6498.6%
Applied egg-rr98.6%
Taylor expanded in b around 0
Simplified97.4%
Final simplification54.2%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* (sin b) r))) (if (<= b -4.2) t_0 (if (<= b 330.0) (* r (/ b (cos (+ b a)))) t_0))))
double code(double r, double a, double b) {
double t_0 = sin(b) * r;
double tmp;
if (b <= -4.2) {
tmp = t_0;
} else if (b <= 330.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 = sin(b) * r
if (b <= (-4.2d0)) then
tmp = t_0
else if (b <= 330.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 = Math.sin(b) * r;
double tmp;
if (b <= -4.2) {
tmp = t_0;
} else if (b <= 330.0) {
tmp = r * (b / Math.cos((b + a)));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = math.sin(b) * r tmp = 0 if b <= -4.2: tmp = t_0 elif b <= 330.0: tmp = r * (b / math.cos((b + a))) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(sin(b) * r) tmp = 0.0 if (b <= -4.2) tmp = t_0; elseif (b <= 330.0) tmp = Float64(r * Float64(b / cos(Float64(b + a)))); else tmp = t_0; end return tmp end
function tmp_2 = code(r, a, b) t_0 = sin(b) * r; tmp = 0.0; if (b <= -4.2) tmp = t_0; elseif (b <= 330.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[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -4.2], t$95$0, If[LessEqual[b, 330.0], N[(r * N[(b / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;b \leq -4.2:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 330:\\
\;\;\;\;r \cdot \frac{b}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -4.20000000000000018 or 330 < b Initial program 56.9%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6456.9%
Applied egg-rr56.9%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6412.9%
Simplified12.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6412.4%
Simplified12.4%
if -4.20000000000000018 < b < 330Initial program 98.6%
Taylor expanded in b around 0
Simplified97.3%
Final simplification54.2%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* (sin b) r))) (if (<= b -4.7) t_0 (if (<= b 2020000.0) (* b (/ r (cos a))) t_0))))
double code(double r, double a, double b) {
double t_0 = sin(b) * r;
double tmp;
if (b <= -4.7) {
tmp = t_0;
} else if (b <= 2020000.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 = sin(b) * r
if (b <= (-4.7d0)) then
tmp = t_0
else if (b <= 2020000.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 = Math.sin(b) * r;
double tmp;
if (b <= -4.7) {
tmp = t_0;
} else if (b <= 2020000.0) {
tmp = b * (r / Math.cos(a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = math.sin(b) * r tmp = 0 if b <= -4.7: tmp = t_0 elif b <= 2020000.0: tmp = b * (r / math.cos(a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(sin(b) * r) tmp = 0.0 if (b <= -4.7) tmp = t_0; elseif (b <= 2020000.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 = sin(b) * r; tmp = 0.0; if (b <= -4.7) tmp = t_0; elseif (b <= 2020000.0) tmp = b * (r / cos(a)); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -4.7], t$95$0, If[LessEqual[b, 2020000.0], N[(b * N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin b \cdot r\\
\mathbf{if}\;b \leq -4.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 2020000:\\
\;\;\;\;b \cdot \frac{r}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -4.70000000000000018 or 2.02e6 < b Initial program 56.8%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6456.8%
Applied egg-rr56.8%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6412.9%
Simplified12.9%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6412.5%
Simplified12.5%
if -4.70000000000000018 < b < 2.02e6Initial program 98.4%
Taylor expanded in b around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6496.6%
Simplified96.6%
Final simplification54.2%
(FPCore (r a b) :precision binary64 (* (sin b) r))
double code(double r, double a, double b) {
return sin(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) * r
end function
public static double code(double r, double a, double b) {
return Math.sin(b) * r;
}
def code(r, a, b): return math.sin(b) * r
function code(r, a, b) return Float64(sin(b) * r) end
function tmp = code(r, a, b) tmp = sin(b) * r; end
code[r_, a_, b_] := N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision]
\begin{array}{l}
\\
\sin b \cdot r
\end{array}
Initial program 77.4%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6477.5%
Applied egg-rr77.5%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6454.4%
Simplified54.4%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6437.2%
Simplified37.2%
Final simplification37.2%
(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 77.4%
Taylor expanded in b around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6449.6%
Simplified49.6%
Taylor expanded in a around 0
*-lowering-*.f6432.9%
Simplified32.9%
herbie shell --seed 2024192
(FPCore (r a b)
:name "rsin B (should all be same)"
:precision binary64
(* r (/ (sin b) (cos (+ a b)))))