
(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 19 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 (/ (* 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 80.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6480.2%
Simplified80.2%
+-commutativeN/A
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.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(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 80.1%
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 (let* ((t_0 (/ (* r (sin b)) (cos b)))) (if (<= b -2e-6) t_0 (if (<= b 6.8e-9) (* b (/ r (cos a))) t_0))))
double code(double r, double a, double b) {
double t_0 = (r * sin(b)) / cos(b);
double tmp;
if (b <= -2e-6) {
tmp = t_0;
} else if (b <= 6.8e-9) {
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)) / cos(b)
if (b <= (-2d-6)) then
tmp = t_0
else if (b <= 6.8d-9) 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)) / Math.cos(b);
double tmp;
if (b <= -2e-6) {
tmp = t_0;
} else if (b <= 6.8e-9) {
tmp = b * (r / Math.cos(a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = (r * math.sin(b)) / math.cos(b) tmp = 0 if b <= -2e-6: tmp = t_0 elif b <= 6.8e-9: tmp = b * (r / math.cos(a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(Float64(r * sin(b)) / cos(b)) tmp = 0.0 if (b <= -2e-6) tmp = t_0; elseif (b <= 6.8e-9) 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)) / cos(b); tmp = 0.0; if (b <= -2e-6) tmp = t_0; elseif (b <= 6.8e-9) tmp = b * (r / cos(a)); else tmp = t_0; end tmp_2 = tmp; end
code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2e-6], t$95$0, If[LessEqual[b, 6.8e-9], N[(b * N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{r \cdot \sin b}{\cos b}\\
\mathbf{if}\;b \leq -2 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{-9}:\\
\;\;\;\;b \cdot \frac{r}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -1.99999999999999991e-6 or 6.7999999999999997e-9 < b Initial program 59.4%
Taylor expanded in a around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6460.2%
Simplified60.2%
if -1.99999999999999991e-6 < b < 6.7999999999999997e-9Initial program 99.2%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6499.3%
Simplified99.3%
+-commutativeN/A
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.8%
Applied egg-rr99.8%
Taylor expanded in b around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6499.3%
Simplified99.3%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* r (/ (sin b) (cos b))))) (if (<= b -1.1e-6) t_0 (if (<= b 6.8e-9) (* b (/ r (cos a))) t_0))))
double code(double r, double a, double b) {
double t_0 = r * (sin(b) / cos(b));
double tmp;
if (b <= -1.1e-6) {
tmp = t_0;
} else if (b <= 6.8e-9) {
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) / cos(b))
if (b <= (-1.1d-6)) then
tmp = t_0
else if (b <= 6.8d-9) 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) / Math.cos(b));
double tmp;
if (b <= -1.1e-6) {
tmp = t_0;
} else if (b <= 6.8e-9) {
tmp = b * (r / Math.cos(a));
} else {
tmp = t_0;
}
return tmp;
}
def code(r, a, b): t_0 = r * (math.sin(b) / math.cos(b)) tmp = 0 if b <= -1.1e-6: tmp = t_0 elif b <= 6.8e-9: tmp = b * (r / math.cos(a)) else: tmp = t_0 return tmp
function code(r, a, b) t_0 = Float64(r * Float64(sin(b) / cos(b))) tmp = 0.0 if (b <= -1.1e-6) tmp = t_0; elseif (b <= 6.8e-9) 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) / cos(b)); tmp = 0.0; if (b <= -1.1e-6) tmp = t_0; elseif (b <= 6.8e-9) 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[(N[Sin[b], $MachinePrecision] / N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1e-6], t$95$0, If[LessEqual[b, 6.8e-9], N[(b * N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \frac{\sin b}{\cos b}\\
\mathbf{if}\;b \leq -1.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{-9}:\\
\;\;\;\;b \cdot \frac{r}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -1.1000000000000001e-6 or 6.7999999999999997e-9 < b Initial program 59.4%
Taylor expanded in a around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6460.1%
Simplified60.1%
if -1.1000000000000001e-6 < b < 6.7999999999999997e-9Initial program 99.2%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6499.3%
Simplified99.3%
+-commutativeN/A
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.8%
Applied egg-rr99.8%
Taylor expanded in b around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6499.3%
Simplified99.3%
(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 80.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6480.2%
Simplified80.2%
(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 80.1%
clear-numN/A
un-div-invN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6480.2%
Applied egg-rr80.2%
Final simplification80.2%
(FPCore (r a b) :precision binary64 (* r (/ (sin b) (cos (+ b a)))))
double code(double r, double a, double b) {
return r * (sin(b) / cos((b + a)));
}
real(8) function code(r, a, b)
real(8), intent (in) :: r
real(8), intent (in) :: a
real(8), intent (in) :: b
code = r * (sin(b) / cos((b + a)))
end function
public static double code(double r, double a, double b) {
return r * (Math.sin(b) / Math.cos((b + a)));
}
def code(r, a, b): return r * (math.sin(b) / math.cos((b + a)))
function code(r, a, b) return Float64(r * Float64(sin(b) / cos(Float64(b + a)))) end
function tmp = code(r, a, b) tmp = r * (sin(b) / cos((b + a))); end
code[r_, a_, b_] := N[(r * N[(N[Sin[b], $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
r \cdot \frac{\sin b}{\cos \left(b + a\right)}
\end{array}
Initial program 80.1%
Final simplification80.1%
(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 80.1%
Taylor expanded in b around 0
cos-lowering-cos.f6457.8%
Simplified57.8%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -1160000000.0)
t_0
(if (<= b 4.8)
(/
(*
r
(*
b
(+
1.0
(*
(* b b)
(+
-0.16666666666666666
(*
b
(*
b
(+
0.008333333333333333
(* (* b b) -0.0001984126984126984)))))))))
(cos (+ b a)))
(/ 1.0 (/ 1.0 t_0))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -1160000000.0) {
tmp = t_0;
} else if (b <= 4.8) {
tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + (b * (b * (0.008333333333333333 + ((b * b) * -0.0001984126984126984))))))))) / cos((b + a));
} else {
tmp = 1.0 / (1.0 / 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 <= (-1160000000.0d0)) then
tmp = t_0
else if (b <= 4.8d0) then
tmp = (r * (b * (1.0d0 + ((b * b) * ((-0.16666666666666666d0) + (b * (b * (0.008333333333333333d0 + ((b * b) * (-0.0001984126984126984d0)))))))))) / cos((b + a))
else
tmp = 1.0d0 / (1.0d0 / 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 <= -1160000000.0) {
tmp = t_0;
} else if (b <= 4.8) {
tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + (b * (b * (0.008333333333333333 + ((b * b) * -0.0001984126984126984))))))))) / Math.cos((b + a));
} else {
tmp = 1.0 / (1.0 / t_0);
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -1160000000.0: tmp = t_0 elif b <= 4.8: tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + (b * (b * (0.008333333333333333 + ((b * b) * -0.0001984126984126984))))))))) / math.cos((b + a)) else: tmp = 1.0 / (1.0 / t_0) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -1160000000.0) tmp = t_0; elseif (b <= 4.8) tmp = Float64(Float64(r * Float64(b * Float64(1.0 + Float64(Float64(b * b) * Float64(-0.16666666666666666 + Float64(b * Float64(b * Float64(0.008333333333333333 + Float64(Float64(b * b) * -0.0001984126984126984))))))))) / cos(Float64(b + a))); else tmp = Float64(1.0 / Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -1160000000.0) tmp = t_0; elseif (b <= 4.8) tmp = (r * (b * (1.0 + ((b * b) * (-0.16666666666666666 + (b * (b * (0.008333333333333333 + ((b * b) * -0.0001984126984126984))))))))) / cos((b + a)); else tmp = 1.0 / (1.0 / 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, -1160000000.0], t$95$0, If[LessEqual[b, 4.8], N[(N[(r * N[(b * N[(1.0 + N[(N[(b * b), $MachinePrecision] * N[(-0.16666666666666666 + N[(b * N[(b * N[(0.008333333333333333 + N[(N[(b * b), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -1160000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 4.8:\\
\;\;\;\;\frac{r \cdot \left(b \cdot \left(1 + \left(b \cdot b\right) \cdot \left(-0.16666666666666666 + b \cdot \left(b \cdot \left(0.008333333333333333 + \left(b \cdot b\right) \cdot -0.0001984126984126984\right)\right)\right)\right)\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if b < -1.16e9Initial program 55.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6455.1%
Simplified55.1%
Taylor expanded in b around 0
cos-lowering-cos.f6411.7%
Simplified11.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -1.16e9 < b < 4.79999999999999982Initial program 98.0%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Simplified98.0%
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
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.3%
Simplified97.3%
if 4.79999999999999982 < b Initial program 63.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6463.6%
Simplified63.6%
+-commutativeN/A
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.4%
Applied egg-rr99.4%
Taylor expanded in a around 0
Simplified68.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lft-identityN/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6468.2%
Applied egg-rr68.2%
Taylor expanded in b around 0
Simplified13.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -0.58)
t_0
(if (<= b 5000000000.0)
(/
(*
r
(*
b
(+
1.0
(*
b
(* b (+ -0.16666666666666666 (* (* b b) 0.008333333333333333)))))))
(cos (+ b a)))
(/ 1.0 (/ 1.0 t_0))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -0.58) {
tmp = t_0;
} else if (b <= 5000000000.0) {
tmp = (r * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333))))))) / cos((b + a));
} else {
tmp = 1.0 / (1.0 / 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 <= (-0.58d0)) then
tmp = t_0
else if (b <= 5000000000.0d0) then
tmp = (r * (b * (1.0d0 + (b * (b * ((-0.16666666666666666d0) + ((b * b) * 0.008333333333333333d0))))))) / cos((b + a))
else
tmp = 1.0d0 / (1.0d0 / 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 <= -0.58) {
tmp = t_0;
} else if (b <= 5000000000.0) {
tmp = (r * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333))))))) / Math.cos((b + a));
} else {
tmp = 1.0 / (1.0 / t_0);
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -0.58: tmp = t_0 elif b <= 5000000000.0: tmp = (r * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333))))))) / math.cos((b + a)) else: tmp = 1.0 / (1.0 / t_0) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -0.58) tmp = t_0; elseif (b <= 5000000000.0) tmp = Float64(Float64(r * Float64(b * Float64(1.0 + Float64(b * Float64(b * Float64(-0.16666666666666666 + Float64(Float64(b * b) * 0.008333333333333333))))))) / cos(Float64(b + a))); else tmp = Float64(1.0 / Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -0.58) tmp = t_0; elseif (b <= 5000000000.0) tmp = (r * (b * (1.0 + (b * (b * (-0.16666666666666666 + ((b * b) * 0.008333333333333333))))))) / cos((b + a)); else tmp = 1.0 / (1.0 / 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, -0.58], t$95$0, If[LessEqual[b, 5000000000.0], N[(N[(r * 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] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 5000000000:\\
\;\;\;\;\frac{r \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)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if b < -0.57999999999999996Initial program 53.6%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6453.6%
Simplified53.6%
Taylor expanded in b around 0
cos-lowering-cos.f6411.6%
Simplified11.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -0.57999999999999996 < b < 5e9Initial program 99.3%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6499.3%
Simplified99.3%
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-*.f6497.8%
Simplified97.8%
if 5e9 < b Initial program 62.8%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
+-commutativeN/A
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.4%
Applied egg-rr99.4%
Taylor expanded in a around 0
Simplified67.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lft-identityN/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6467.6%
Applied egg-rr67.6%
Taylor expanded in b around 0
Simplified13.7%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -0.58)
t_0
(if (<= b 920000000000.0)
(/ (/ (* r b) (cos (+ b a))) (+ 1.0 (* (* b b) 0.16666666666666666)))
(/ 1.0 (/ 1.0 t_0))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -0.58) {
tmp = t_0;
} else if (b <= 920000000000.0) {
tmp = ((r * b) / cos((b + a))) / (1.0 + ((b * b) * 0.16666666666666666));
} else {
tmp = 1.0 / (1.0 / 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 <= (-0.58d0)) then
tmp = t_0
else if (b <= 920000000000.0d0) then
tmp = ((r * b) / cos((b + a))) / (1.0d0 + ((b * b) * 0.16666666666666666d0))
else
tmp = 1.0d0 / (1.0d0 / 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 <= -0.58) {
tmp = t_0;
} else if (b <= 920000000000.0) {
tmp = ((r * b) / Math.cos((b + a))) / (1.0 + ((b * b) * 0.16666666666666666));
} else {
tmp = 1.0 / (1.0 / t_0);
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -0.58: tmp = t_0 elif b <= 920000000000.0: tmp = ((r * b) / math.cos((b + a))) / (1.0 + ((b * b) * 0.16666666666666666)) else: tmp = 1.0 / (1.0 / t_0) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -0.58) tmp = t_0; elseif (b <= 920000000000.0) tmp = Float64(Float64(Float64(r * b) / cos(Float64(b + a))) / Float64(1.0 + Float64(Float64(b * b) * 0.16666666666666666))); else tmp = Float64(1.0 / Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -0.58) tmp = t_0; elseif (b <= 920000000000.0) tmp = ((r * b) / cos((b + a))) / (1.0 + ((b * b) * 0.16666666666666666)); else tmp = 1.0 / (1.0 / 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, -0.58], t$95$0, If[LessEqual[b, 920000000000.0], N[(N[(N[(r * b), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(b * b), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 920000000000:\\
\;\;\;\;\frac{\frac{r \cdot b}{\cos \left(b + a\right)}}{1 + \left(b \cdot b\right) \cdot 0.16666666666666666}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if b < -0.57999999999999996Initial program 53.6%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6453.6%
Simplified53.6%
Taylor expanded in b around 0
cos-lowering-cos.f6411.6%
Simplified11.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -0.57999999999999996 < b < 9.2e11Initial program 99.3%
associate-*r/N/A
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6497.6%
Applied egg-rr97.6%
Taylor expanded in b around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f6495.8%
Simplified95.8%
Taylor expanded in r around 0
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.6%
Simplified97.6%
if 9.2e11 < b Initial program 62.8%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
+-commutativeN/A
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.4%
Applied egg-rr99.4%
Taylor expanded in a around 0
Simplified67.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lft-identityN/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6467.6%
Applied egg-rr67.6%
Taylor expanded in b around 0
Simplified13.7%
Final simplification58.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -1850000000.0)
t_0
(if (<= b 3100.0)
(/ (* r (* b (+ 1.0 (* (* b b) -0.16666666666666666)))) (cos (+ b a)))
(/ 1.0 (/ 1.0 t_0))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -1850000000.0) {
tmp = t_0;
} else if (b <= 3100.0) {
tmp = (r * (b * (1.0 + ((b * b) * -0.16666666666666666)))) / cos((b + a));
} else {
tmp = 1.0 / (1.0 / 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 <= (-1850000000.0d0)) then
tmp = t_0
else if (b <= 3100.0d0) then
tmp = (r * (b * (1.0d0 + ((b * b) * (-0.16666666666666666d0))))) / cos((b + a))
else
tmp = 1.0d0 / (1.0d0 / 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 <= -1850000000.0) {
tmp = t_0;
} else if (b <= 3100.0) {
tmp = (r * (b * (1.0 + ((b * b) * -0.16666666666666666)))) / Math.cos((b + a));
} else {
tmp = 1.0 / (1.0 / t_0);
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -1850000000.0: tmp = t_0 elif b <= 3100.0: tmp = (r * (b * (1.0 + ((b * b) * -0.16666666666666666)))) / math.cos((b + a)) else: tmp = 1.0 / (1.0 / t_0) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -1850000000.0) tmp = t_0; elseif (b <= 3100.0) tmp = Float64(Float64(r * Float64(b * Float64(1.0 + Float64(Float64(b * b) * -0.16666666666666666)))) / cos(Float64(b + a))); else tmp = Float64(1.0 / Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -1850000000.0) tmp = t_0; elseif (b <= 3100.0) tmp = (r * (b * (1.0 + ((b * b) * -0.16666666666666666)))) / cos((b + a)); else tmp = 1.0 / (1.0 / 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, -1850000000.0], t$95$0, If[LessEqual[b, 3100.0], N[(N[(r * N[(b * N[(1.0 + N[(N[(b * b), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -1850000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 3100:\\
\;\;\;\;\frac{r \cdot \left(b \cdot \left(1 + \left(b \cdot b\right) \cdot -0.16666666666666666\right)\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if b < -1.85e9Initial program 55.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6455.1%
Simplified55.1%
Taylor expanded in b around 0
cos-lowering-cos.f6411.7%
Simplified11.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -1.85e9 < b < 3100Initial program 98.0%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Simplified98.0%
Taylor expanded in b around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.0%
Simplified97.0%
if 3100 < b Initial program 63.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6463.6%
Simplified63.6%
+-commutativeN/A
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.4%
Applied egg-rr99.4%
Taylor expanded in a around 0
Simplified68.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lft-identityN/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6468.2%
Applied egg-rr68.2%
Taylor expanded in b around 0
Simplified13.5%
Final simplification58.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -1950000000.0)
t_0
(if (<= b 55.0)
(* r (/ (* b (+ 1.0 (* (* b b) -0.16666666666666666))) (cos (+ b a))))
(/ 1.0 (/ 1.0 t_0))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -1950000000.0) {
tmp = t_0;
} else if (b <= 55.0) {
tmp = r * ((b * (1.0 + ((b * b) * -0.16666666666666666))) / cos((b + a)));
} else {
tmp = 1.0 / (1.0 / 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 <= (-1950000000.0d0)) then
tmp = t_0
else if (b <= 55.0d0) then
tmp = r * ((b * (1.0d0 + ((b * b) * (-0.16666666666666666d0)))) / cos((b + a)))
else
tmp = 1.0d0 / (1.0d0 / 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 <= -1950000000.0) {
tmp = t_0;
} else if (b <= 55.0) {
tmp = r * ((b * (1.0 + ((b * b) * -0.16666666666666666))) / Math.cos((b + a)));
} else {
tmp = 1.0 / (1.0 / t_0);
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -1950000000.0: tmp = t_0 elif b <= 55.0: tmp = r * ((b * (1.0 + ((b * b) * -0.16666666666666666))) / math.cos((b + a))) else: tmp = 1.0 / (1.0 / t_0) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -1950000000.0) tmp = t_0; elseif (b <= 55.0) tmp = Float64(r * Float64(Float64(b * Float64(1.0 + Float64(Float64(b * b) * -0.16666666666666666))) / cos(Float64(b + a)))); else tmp = Float64(1.0 / Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -1950000000.0) tmp = t_0; elseif (b <= 55.0) tmp = r * ((b * (1.0 + ((b * b) * -0.16666666666666666))) / cos((b + a))); else tmp = 1.0 / (1.0 / 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, -1950000000.0], t$95$0, If[LessEqual[b, 55.0], N[(r * N[(N[(b * N[(1.0 + N[(N[(b * b), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -1950000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 55:\\
\;\;\;\;r \cdot \frac{b \cdot \left(1 + \left(b \cdot b\right) \cdot -0.16666666666666666\right)}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if b < -1.95e9Initial program 55.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6455.1%
Simplified55.1%
Taylor expanded in b around 0
cos-lowering-cos.f6411.7%
Simplified11.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -1.95e9 < b < 55Initial program 98.0%
Taylor expanded in b around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.0%
Simplified97.0%
if 55 < b Initial program 63.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6463.6%
Simplified63.6%
+-commutativeN/A
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.4%
Applied egg-rr99.4%
Taylor expanded in a around 0
Simplified68.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lft-identityN/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6468.2%
Applied egg-rr68.2%
Taylor expanded in b around 0
Simplified13.5%
Final simplification58.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -0.58)
t_0
(if (<= b 530000000000.0)
(/ (* r b) (cos (+ b a)))
(/ 1.0 (/ 1.0 t_0))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -0.58) {
tmp = t_0;
} else if (b <= 530000000000.0) {
tmp = (r * b) / cos((b + a));
} else {
tmp = 1.0 / (1.0 / 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 <= (-0.58d0)) then
tmp = t_0
else if (b <= 530000000000.0d0) then
tmp = (r * b) / cos((b + a))
else
tmp = 1.0d0 / (1.0d0 / 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 <= -0.58) {
tmp = t_0;
} else if (b <= 530000000000.0) {
tmp = (r * b) / Math.cos((b + a));
} else {
tmp = 1.0 / (1.0 / t_0);
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -0.58: tmp = t_0 elif b <= 530000000000.0: tmp = (r * b) / math.cos((b + a)) else: tmp = 1.0 / (1.0 / t_0) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -0.58) tmp = t_0; elseif (b <= 530000000000.0) tmp = Float64(Float64(r * b) / cos(Float64(b + a))); else tmp = Float64(1.0 / Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -0.58) tmp = t_0; elseif (b <= 530000000000.0) tmp = (r * b) / cos((b + a)); else tmp = 1.0 / (1.0 / 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, -0.58], t$95$0, If[LessEqual[b, 530000000000.0], N[(N[(r * b), $MachinePrecision] / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 530000000000:\\
\;\;\;\;\frac{r \cdot b}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if b < -0.57999999999999996Initial program 53.6%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6453.6%
Simplified53.6%
Taylor expanded in b around 0
cos-lowering-cos.f6411.6%
Simplified11.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -0.57999999999999996 < b < 5.3e11Initial program 99.3%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6499.3%
Simplified99.3%
Taylor expanded in b around 0
Simplified97.5%
if 5.3e11 < b Initial program 62.8%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
+-commutativeN/A
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.4%
Applied egg-rr99.4%
Taylor expanded in a around 0
Simplified67.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lft-identityN/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6467.6%
Applied egg-rr67.6%
Taylor expanded in b around 0
Simplified13.7%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -0.58)
t_0
(if (<= b 320000000000.0)
(* r (/ b (cos (+ b a))))
(/ 1.0 (/ 1.0 t_0))))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -0.58) {
tmp = t_0;
} else if (b <= 320000000000.0) {
tmp = r * (b / cos((b + a)));
} else {
tmp = 1.0 / (1.0 / 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 <= (-0.58d0)) then
tmp = t_0
else if (b <= 320000000000.0d0) then
tmp = r * (b / cos((b + a)))
else
tmp = 1.0d0 / (1.0d0 / 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 <= -0.58) {
tmp = t_0;
} else if (b <= 320000000000.0) {
tmp = r * (b / Math.cos((b + a)));
} else {
tmp = 1.0 / (1.0 / t_0);
}
return tmp;
}
def code(r, a, b): t_0 = r * math.sin(b) tmp = 0 if b <= -0.58: tmp = t_0 elif b <= 320000000000.0: tmp = r * (b / math.cos((b + a))) else: tmp = 1.0 / (1.0 / t_0) return tmp
function code(r, a, b) t_0 = Float64(r * sin(b)) tmp = 0.0 if (b <= -0.58) tmp = t_0; elseif (b <= 320000000000.0) tmp = Float64(r * Float64(b / cos(Float64(b + a)))); else tmp = Float64(1.0 / Float64(1.0 / t_0)); end return tmp end
function tmp_2 = code(r, a, b) t_0 = r * sin(b); tmp = 0.0; if (b <= -0.58) tmp = t_0; elseif (b <= 320000000000.0) tmp = r * (b / cos((b + a))); else tmp = 1.0 / (1.0 / 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, -0.58], t$95$0, If[LessEqual[b, 320000000000.0], N[(r * N[(b / N[Cos[N[(b + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
\mathbf{if}\;b \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 320000000000:\\
\;\;\;\;r \cdot \frac{b}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{t\_0}}\\
\end{array}
\end{array}
if b < -0.57999999999999996Initial program 53.6%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6453.6%
Simplified53.6%
Taylor expanded in b around 0
cos-lowering-cos.f6411.6%
Simplified11.6%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -0.57999999999999996 < b < 3.2e11Initial program 99.3%
Taylor expanded in b around 0
Simplified97.5%
if 3.2e11 < b Initial program 62.8%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6463.0%
Simplified63.0%
+-commutativeN/A
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.4%
Applied egg-rr99.4%
Taylor expanded in a around 0
Simplified67.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lft-identityN/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6467.6%
Applied egg-rr67.6%
Taylor expanded in b around 0
Simplified13.7%
Final simplification58.5%
(FPCore (r a b)
:precision binary64
(let* ((t_0 (* r (sin b))))
(if (<= b -0.58)
t_0
(if (<= b 160000000000.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 <= -0.58) {
tmp = t_0;
} else if (b <= 160000000000.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 <= (-0.58d0)) then
tmp = t_0
else if (b <= 160000000000.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 <= -0.58) {
tmp = t_0;
} else if (b <= 160000000000.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 <= -0.58: tmp = t_0 elif b <= 160000000000.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 <= -0.58) tmp = t_0; elseif (b <= 160000000000.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 = r * sin(b); tmp = 0.0; if (b <= -0.58) tmp = t_0; elseif (b <= 160000000000.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, -0.58], t$95$0, If[LessEqual[b, 160000000000.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 := r \cdot \sin b\\
\mathbf{if}\;b \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 160000000000:\\
\;\;\;\;r \cdot \frac{b}{\cos \left(b + a\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -0.57999999999999996 or 1.6e11 < b Initial program 58.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6458.2%
Simplified58.2%
Taylor expanded in b around 0
cos-lowering-cos.f6412.2%
Simplified12.2%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.6%
Simplified13.6%
if -0.57999999999999996 < b < 1.6e11Initial program 99.3%
Taylor expanded in b around 0
Simplified97.5%
Final simplification58.5%
(FPCore (r a b) :precision binary64 (let* ((t_0 (* r (sin b)))) (if (<= b -0.58) t_0 (if (<= b 1.75) (* b (/ r (cos a))) t_0))))
double code(double r, double a, double b) {
double t_0 = r * sin(b);
double tmp;
if (b <= -0.58) {
tmp = t_0;
} else if (b <= 1.75) {
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 <= (-0.58d0)) then
tmp = t_0
else if (b <= 1.75d0) 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 <= -0.58) {
tmp = t_0;
} else if (b <= 1.75) {
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 <= -0.58: tmp = t_0 elif b <= 1.75: 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 <= -0.58) tmp = t_0; elseif (b <= 1.75) 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 <= -0.58) tmp = t_0; elseif (b <= 1.75) 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, -0.58], t$95$0, If[LessEqual[b, 1.75], 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 -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 1.75:\\
\;\;\;\;b \cdot \frac{r}{\cos a}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if b < -0.57999999999999996 or 1.75 < b Initial program 58.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6458.5%
Simplified58.5%
Taylor expanded in b around 0
cos-lowering-cos.f6412.1%
Simplified12.1%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6413.4%
Simplified13.4%
if -0.57999999999999996 < b < 1.75Initial program 99.2%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6499.3%
Simplified99.3%
+-commutativeN/A
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.8%
Applied egg-rr99.8%
Taylor expanded in b around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f6498.1%
Simplified98.1%
(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 80.1%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f64N/A
+-commutativeN/A
+-lowering-+.f6480.2%
Simplified80.2%
Taylor expanded in b around 0
cos-lowering-cos.f6457.8%
Simplified57.8%
Taylor expanded in a around 0
*-lowering-*.f64N/A
sin-lowering-sin.f6441.6%
Simplified41.6%
(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 80.1%
Taylor expanded in b around 0
/-lowering-/.f64N/A
cos-lowering-cos.f6453.7%
Simplified53.7%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f6437.0%
Simplified37.0%
herbie shell --seed 2024163
(FPCore (r a b)
:name "rsin B (should all be same)"
:precision binary64
(* r (/ (sin b) (cos (+ a b)))))