
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
(FPCore (x y z a) :precision binary64 (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))) (tan a))))
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (((tan(y) + tan(z)) / (1.0d0 - (tan(y) * tan(z)))) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(y) + Math.tan(z)) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a));
}
def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Initial program 80.7%
tan-sumN/A
lower-/.f64N/A
lower-+.f64N/A
lower-tan.f64N/A
lower-tan.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-tan.f64N/A
lower-tan.f6499.8
Applied rewrites99.8%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
(if (<= (tan a) -0.02)
t_1
(if (<= (tan a) 1e-14)
(fma
(/ 1.0 (fma (tan y) (- (tan z)) 1.0))
t_0
(- x (fma (* a a) (* a 0.3333333333333333) a)))
t_1))))
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double t_1 = x + fma(1.0, t_0, -tan(a));
double tmp;
if (tan(a) <= -0.02) {
tmp = t_1;
} else if (tan(a) <= 1e-14) {
tmp = fma((1.0 / fma(tan(y), -tan(z), 1.0)), t_0, (x - fma((a * a), (a * 0.3333333333333333), a)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a)))) tmp = 0.0 if (tan(a) <= -0.02) tmp = t_1; elseif (tan(a) <= 1e-14) tmp = fma(Float64(1.0 / fma(tan(y), Float64(-tan(z)), 1.0)), t_0, Float64(x - fma(Float64(a * a), Float64(a * 0.3333333333333333), a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.02], t$95$1, If[LessEqual[N[Tan[a], $MachinePrecision], 1e-14], N[(N[(1.0 / N[(N[Tan[y], $MachinePrecision] * (-N[Tan[z], $MachinePrecision]) + 1.0), $MachinePrecision]), $MachinePrecision] * t$95$0 + N[(x - N[(N[(a * a), $MachinePrecision] * N[(a * 0.3333333333333333), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
\mathbf{if}\;\tan a \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\tan a \leq 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\mathsf{fma}\left(\tan y, -\tan z, 1\right)}, t\_0, x - \mathsf{fma}\left(a \cdot a, a \cdot 0.3333333333333333, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0200000000000000004 or 9.99999999999999999e-15 < (tan.f64 a) Initial program 81.3%
tan-sumN/A
lower-/.f64N/A
lower-+.f64N/A
lower-tan.f64N/A
lower-tan.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-tan.f64N/A
lower-tan.f6499.6
Applied rewrites99.6%
tan-sumN/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
sub-negN/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-*.f64N/A
lift--.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites81.9%
if -0.0200000000000000004 < (tan.f64 a) < 9.99999999999999999e-15Initial program 80.0%
Taylor expanded in a around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6480.0
Applied rewrites80.0%
lift-+.f64N/A
lift-tan.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
Applied rewrites99.9%
Final simplification90.8%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
(if (<= (tan a) -0.02)
t_1
(if (<= (tan a) 1e-14)
(+
x
(-
(/ t_0 (fma (tan y) (- (tan z)) 1.0))
(fma (* a a) (* a 0.3333333333333333) a)))
t_1))))
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double t_1 = x + fma(1.0, t_0, -tan(a));
double tmp;
if (tan(a) <= -0.02) {
tmp = t_1;
} else if (tan(a) <= 1e-14) {
tmp = x + ((t_0 / fma(tan(y), -tan(z), 1.0)) - fma((a * a), (a * 0.3333333333333333), a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a)))) tmp = 0.0 if (tan(a) <= -0.02) tmp = t_1; elseif (tan(a) <= 1e-14) tmp = Float64(x + Float64(Float64(t_0 / fma(tan(y), Float64(-tan(z)), 1.0)) - fma(Float64(a * a), Float64(a * 0.3333333333333333), a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.02], t$95$1, If[LessEqual[N[Tan[a], $MachinePrecision], 1e-14], N[(x + N[(N[(t$95$0 / N[(N[Tan[y], $MachinePrecision] * (-N[Tan[z], $MachinePrecision]) + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * a), $MachinePrecision] * N[(a * 0.3333333333333333), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
\mathbf{if}\;\tan a \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\tan a \leq 10^{-14}:\\
\;\;\;\;x + \left(\frac{t\_0}{\mathsf{fma}\left(\tan y, -\tan z, 1\right)} - \mathsf{fma}\left(a \cdot a, a \cdot 0.3333333333333333, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0200000000000000004 or 9.99999999999999999e-15 < (tan.f64 a) Initial program 81.3%
tan-sumN/A
lower-/.f64N/A
lower-+.f64N/A
lower-tan.f64N/A
lower-tan.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-tan.f64N/A
lower-tan.f6499.6
Applied rewrites99.6%
tan-sumN/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
sub-negN/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-*.f64N/A
lift--.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites81.9%
if -0.0200000000000000004 < (tan.f64 a) < 9.99999999999999999e-15Initial program 80.0%
Taylor expanded in a around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6480.0
Applied rewrites80.0%
tan-sumN/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-/.f6499.9
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.9
Applied rewrites99.9%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
(if (<= (tan a) -0.02)
t_1
(if (<= (tan a) 1e-14)
(+ (/ t_0 (- 1.0 (* (tan y) (tan z)))) (- x a))
t_1))))
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double t_1 = x + fma(1.0, t_0, -tan(a));
double tmp;
if (tan(a) <= -0.02) {
tmp = t_1;
} else if (tan(a) <= 1e-14) {
tmp = (t_0 / (1.0 - (tan(y) * tan(z)))) + (x - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a)))) tmp = 0.0 if (tan(a) <= -0.02) tmp = t_1; elseif (tan(a) <= 1e-14) tmp = Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) + Float64(x - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.02], t$95$1, If[LessEqual[N[Tan[a], $MachinePrecision], 1e-14], N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
\mathbf{if}\;\tan a \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\tan a \leq 10^{-14}:\\
\;\;\;\;\frac{t\_0}{1 - \tan y \cdot \tan z} + \left(x - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0200000000000000004 or 9.99999999999999999e-15 < (tan.f64 a) Initial program 81.3%
tan-sumN/A
lower-/.f64N/A
lower-+.f64N/A
lower-tan.f64N/A
lower-tan.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-tan.f64N/A
lower-tan.f6499.6
Applied rewrites99.6%
tan-sumN/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
sub-negN/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-*.f64N/A
lift--.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in y around 0
Applied rewrites81.9%
if -0.0200000000000000004 < (tan.f64 a) < 9.99999999999999999e-15Initial program 80.0%
Taylor expanded in y around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6467.5
Applied rewrites67.5%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6480.0
Applied rewrites80.0%
lift-+.f64N/A
lift-+.f64N/A
quot-tanN/A
lift-+.f64N/A
+-commutativeN/A
tan-sumN/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
un-div-invN/A
lift-/.f64N/A
lift-tan.f64N/A
lift-fma.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
un-div-invN/A
lift-/.f64N/A
lift-tan.f64N/A
unsub-negN/A
Applied rewrites99.9%
Final simplification90.7%
(FPCore (x y z a) :precision binary64 (+ x (fma 1.0 (+ (tan y) (tan z)) (- (tan a)))))
double code(double x, double y, double z, double a) {
return x + fma(1.0, (tan(y) + tan(z)), -tan(a));
}
function code(x, y, z, a) return Float64(x + fma(1.0, Float64(tan(y) + tan(z)), Float64(-tan(a)))) end
code[x_, y_, z_, a_] := N[(x + N[(1.0 * N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \mathsf{fma}\left(1, \tan y + \tan z, -\tan a\right)
\end{array}
Initial program 80.7%
tan-sumN/A
lower-/.f64N/A
lower-+.f64N/A
lower-tan.f64N/A
lower-tan.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-tan.f64N/A
lower-tan.f6499.8
Applied rewrites99.8%
tan-sumN/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
sub-negN/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-+.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
lift-*.f64N/A
lift--.f64N/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in y around 0
Applied rewrites81.1%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ x (- (tan z) (tan a)))))
(if (<= a -1.9e-8)
t_0
(if (<= a 0.6)
(+
x
(-
(tan (+ y z))
(fma
(fma
a
(* a (fma (* a a) 0.05396825396825397 0.13333333333333333))
0.3333333333333333)
(* a (* a a))
a)))
t_0))))
double code(double x, double y, double z, double a) {
double t_0 = x + (tan(z) - tan(a));
double tmp;
if (a <= -1.9e-8) {
tmp = t_0;
} else if (a <= 0.6) {
tmp = x + (tan((y + z)) - fma(fma(a, (a * fma((a * a), 0.05396825396825397, 0.13333333333333333)), 0.3333333333333333), (a * (a * a)), a));
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(x + Float64(tan(z) - tan(a))) tmp = 0.0 if (a <= -1.9e-8) tmp = t_0; elseif (a <= 0.6) tmp = Float64(x + Float64(tan(Float64(y + z)) - fma(fma(a, Float64(a * fma(Float64(a * a), 0.05396825396825397, 0.13333333333333333)), 0.3333333333333333), Float64(a * Float64(a * a)), a))); else tmp = t_0; end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.9e-8], t$95$0, If[LessEqual[a, 0.6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[(a * N[(a * N[(N[(a * a), $MachinePrecision] * 0.05396825396825397 + 0.13333333333333333), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(\tan z - \tan a\right)\\
\mathbf{if}\;a \leq -1.9 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 0.6:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(a \cdot a, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.90000000000000014e-8 or 0.599999999999999978 < a Initial program 80.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6459.6
Applied rewrites59.6%
lift-sin.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6459.6
lift-/.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f6459.6
Applied rewrites59.6%
if -1.90000000000000014e-8 < a < 0.599999999999999978Initial program 80.9%
Taylor expanded in a around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites80.3%
Final simplification69.9%
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (tan((y + z)) - tan(a));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a): return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(tan(Float64(y + z)) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (tan((y + z)) - tan(a)); end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}
Initial program 80.7%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (* z (* z z))))
(if (<= a -520000000000.0)
(+
x
(-
(fma
(fma
(* z z)
(fma (* z z) 0.05396825396825397 0.13333333333333333)
0.3333333333333333)
t_0
z)
(tan a)))
(if (<= a 1.4)
(+
x
(-
(tan (+ y z))
(fma
(fma
a
(* a (fma (* a a) 0.05396825396825397 0.13333333333333333))
0.3333333333333333)
(* a (* a a))
a)))
(+ x (- (fma 0.3333333333333333 t_0 z) (tan a)))))))
double code(double x, double y, double z, double a) {
double t_0 = z * (z * z);
double tmp;
if (a <= -520000000000.0) {
tmp = x + (fma(fma((z * z), fma((z * z), 0.05396825396825397, 0.13333333333333333), 0.3333333333333333), t_0, z) - tan(a));
} else if (a <= 1.4) {
tmp = x + (tan((y + z)) - fma(fma(a, (a * fma((a * a), 0.05396825396825397, 0.13333333333333333)), 0.3333333333333333), (a * (a * a)), a));
} else {
tmp = x + (fma(0.3333333333333333, t_0, z) - tan(a));
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(z * Float64(z * z)) tmp = 0.0 if (a <= -520000000000.0) tmp = Float64(x + Float64(fma(fma(Float64(z * z), fma(Float64(z * z), 0.05396825396825397, 0.13333333333333333), 0.3333333333333333), t_0, z) - tan(a))); elseif (a <= 1.4) tmp = Float64(x + Float64(tan(Float64(y + z)) - fma(fma(a, Float64(a * fma(Float64(a * a), 0.05396825396825397, 0.13333333333333333)), 0.3333333333333333), Float64(a * Float64(a * a)), a))); else tmp = Float64(x + Float64(fma(0.3333333333333333, t_0, z) - tan(a))); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -520000000000.0], N[(x + N[(N[(N[(N[(z * z), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] * 0.05396825396825397 + 0.13333333333333333), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[(a * N[(a * N[(N[(a * a), $MachinePrecision] * 0.05396825396825397 + 0.13333333333333333), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot z\right)\\
\mathbf{if}\;a \leq -520000000000:\\
\;\;\;\;x + \left(\mathsf{fma}\left(\mathsf{fma}\left(z \cdot z, \mathsf{fma}\left(z \cdot z, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), t\_0, z\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 1.4:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(a \cdot a, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(0.3333333333333333, t\_0, z\right) - \tan a\right)\\
\end{array}
\end{array}
if a < -5.2e11Initial program 79.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6464.8
Applied rewrites64.8%
Taylor expanded in z around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites29.2%
if -5.2e11 < a < 1.3999999999999999Initial program 80.2%
Taylor expanded in a around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites78.7%
if 1.3999999999999999 < a Initial program 82.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6457.3
Applied rewrites57.3%
Taylor expanded in z around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (* z (* z z))))
(if (<= a -520000000000.0)
(+
x
(-
(fma
(fma
(* z z)
(fma (* z z) 0.05396825396825397 0.13333333333333333)
0.3333333333333333)
t_0
z)
(tan a)))
(if (<= a 1.3)
(+
x
(-
(tan (+ y z))
(fma
(fma a (* a 0.13333333333333333) 0.3333333333333333)
(* a (* a a))
a)))
(+ x (- (fma 0.3333333333333333 t_0 z) (tan a)))))))
double code(double x, double y, double z, double a) {
double t_0 = z * (z * z);
double tmp;
if (a <= -520000000000.0) {
tmp = x + (fma(fma((z * z), fma((z * z), 0.05396825396825397, 0.13333333333333333), 0.3333333333333333), t_0, z) - tan(a));
} else if (a <= 1.3) {
tmp = x + (tan((y + z)) - fma(fma(a, (a * 0.13333333333333333), 0.3333333333333333), (a * (a * a)), a));
} else {
tmp = x + (fma(0.3333333333333333, t_0, z) - tan(a));
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(z * Float64(z * z)) tmp = 0.0 if (a <= -520000000000.0) tmp = Float64(x + Float64(fma(fma(Float64(z * z), fma(Float64(z * z), 0.05396825396825397, 0.13333333333333333), 0.3333333333333333), t_0, z) - tan(a))); elseif (a <= 1.3) tmp = Float64(x + Float64(tan(Float64(y + z)) - fma(fma(a, Float64(a * 0.13333333333333333), 0.3333333333333333), Float64(a * Float64(a * a)), a))); else tmp = Float64(x + Float64(fma(0.3333333333333333, t_0, z) - tan(a))); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -520000000000.0], N[(x + N[(N[(N[(N[(z * z), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] * 0.05396825396825397 + 0.13333333333333333), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[(a * N[(a * 0.13333333333333333), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot z\right)\\
\mathbf{if}\;a \leq -520000000000:\\
\;\;\;\;x + \left(\mathsf{fma}\left(\mathsf{fma}\left(z \cdot z, \mathsf{fma}\left(z \cdot z, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), t\_0, z\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 1.3:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot 0.13333333333333333, 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(0.3333333333333333, t\_0, z\right) - \tan a\right)\\
\end{array}
\end{array}
if a < -5.2e11Initial program 79.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6464.8
Applied rewrites64.8%
Taylor expanded in z around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites29.2%
if -5.2e11 < a < 1.30000000000000004Initial program 80.2%
Taylor expanded in a around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.7
Applied rewrites78.7%
if 1.30000000000000004 < a Initial program 82.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6457.3
Applied rewrites57.3%
Taylor expanded in z around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (* z (* z z))))
(if (<= a -520000000000.0)
(+
x
(-
(fma (fma 0.13333333333333333 (* z z) 0.3333333333333333) t_0 z)
(tan a)))
(if (<= a 1.3)
(+
x
(-
(tan (+ y z))
(fma
(fma a (* a 0.13333333333333333) 0.3333333333333333)
(* a (* a a))
a)))
(+ x (- (fma 0.3333333333333333 t_0 z) (tan a)))))))
double code(double x, double y, double z, double a) {
double t_0 = z * (z * z);
double tmp;
if (a <= -520000000000.0) {
tmp = x + (fma(fma(0.13333333333333333, (z * z), 0.3333333333333333), t_0, z) - tan(a));
} else if (a <= 1.3) {
tmp = x + (tan((y + z)) - fma(fma(a, (a * 0.13333333333333333), 0.3333333333333333), (a * (a * a)), a));
} else {
tmp = x + (fma(0.3333333333333333, t_0, z) - tan(a));
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(z * Float64(z * z)) tmp = 0.0 if (a <= -520000000000.0) tmp = Float64(x + Float64(fma(fma(0.13333333333333333, Float64(z * z), 0.3333333333333333), t_0, z) - tan(a))); elseif (a <= 1.3) tmp = Float64(x + Float64(tan(Float64(y + z)) - fma(fma(a, Float64(a * 0.13333333333333333), 0.3333333333333333), Float64(a * Float64(a * a)), a))); else tmp = Float64(x + Float64(fma(0.3333333333333333, t_0, z) - tan(a))); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -520000000000.0], N[(x + N[(N[(N[(0.13333333333333333 * N[(z * z), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[(a * N[(a * 0.13333333333333333), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot z\right)\\
\mathbf{if}\;a \leq -520000000000:\\
\;\;\;\;x + \left(\mathsf{fma}\left(\mathsf{fma}\left(0.13333333333333333, z \cdot z, 0.3333333333333333\right), t\_0, z\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 1.3:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot 0.13333333333333333, 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(0.3333333333333333, t\_0, z\right) - \tan a\right)\\
\end{array}
\end{array}
if a < -5.2e11Initial program 79.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6464.8
Applied rewrites64.8%
Taylor expanded in z around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.2
Applied rewrites29.2%
if -5.2e11 < a < 1.30000000000000004Initial program 80.2%
Taylor expanded in a around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.7
Applied rewrites78.7%
if 1.30000000000000004 < a Initial program 82.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6457.3
Applied rewrites57.3%
Taylor expanded in z around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (* z (* z z))))
(if (<= a -520000000000.0)
(+
x
(-
(fma (fma 0.13333333333333333 (* z z) 0.3333333333333333) t_0 z)
(tan a)))
(if (<= a 1.4e+17)
(- (+ x (tan (+ y z))) a)
(+ x (- (fma 0.3333333333333333 t_0 z) (tan a)))))))
double code(double x, double y, double z, double a) {
double t_0 = z * (z * z);
double tmp;
if (a <= -520000000000.0) {
tmp = x + (fma(fma(0.13333333333333333, (z * z), 0.3333333333333333), t_0, z) - tan(a));
} else if (a <= 1.4e+17) {
tmp = (x + tan((y + z))) - a;
} else {
tmp = x + (fma(0.3333333333333333, t_0, z) - tan(a));
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(z * Float64(z * z)) tmp = 0.0 if (a <= -520000000000.0) tmp = Float64(x + Float64(fma(fma(0.13333333333333333, Float64(z * z), 0.3333333333333333), t_0, z) - tan(a))); elseif (a <= 1.4e+17) tmp = Float64(Float64(x + tan(Float64(y + z))) - a); else tmp = Float64(x + Float64(fma(0.3333333333333333, t_0, z) - tan(a))); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -520000000000.0], N[(x + N[(N[(N[(0.13333333333333333 * N[(z * z), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4e+17], N[(N[(x + N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 * t$95$0 + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z \cdot z\right)\\
\mathbf{if}\;a \leq -520000000000:\\
\;\;\;\;x + \left(\mathsf{fma}\left(\mathsf{fma}\left(0.13333333333333333, z \cdot z, 0.3333333333333333\right), t\_0, z\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+17}:\\
\;\;\;\;\left(x + \tan \left(y + z\right)\right) - a\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(0.3333333333333333, t\_0, z\right) - \tan a\right)\\
\end{array}
\end{array}
if a < -5.2e11Initial program 79.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6464.8
Applied rewrites64.8%
Taylor expanded in z around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6429.2
Applied rewrites29.2%
if -5.2e11 < a < 1.4e17Initial program 79.5%
Taylor expanded in y around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6467.6
Applied rewrites67.6%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6476.8
Applied rewrites76.8%
Applied rewrites76.8%
if 1.4e17 < a Initial program 83.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6458.7
Applied rewrites58.7%
Taylor expanded in z around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.2
Applied rewrites37.2%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ x (- (fma 0.3333333333333333 (* z (* z z)) z) (tan a)))))
(if (<= a -520000000000.0)
t_0
(if (<= a 1.4e+17) (- (+ x (tan (+ y z))) a) t_0))))
double code(double x, double y, double z, double a) {
double t_0 = x + (fma(0.3333333333333333, (z * (z * z)), z) - tan(a));
double tmp;
if (a <= -520000000000.0) {
tmp = t_0;
} else if (a <= 1.4e+17) {
tmp = (x + tan((y + z))) - a;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(x + Float64(fma(0.3333333333333333, Float64(z * Float64(z * z)), z) - tan(a))) tmp = 0.0 if (a <= -520000000000.0) tmp = t_0; elseif (a <= 1.4e+17) tmp = Float64(Float64(x + tan(Float64(y + z))) - a); else tmp = t_0; end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(N[(0.3333333333333333 * N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -520000000000.0], t$95$0, If[LessEqual[a, 1.4e+17], N[(N[(x + N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(\mathsf{fma}\left(0.3333333333333333, z \cdot \left(z \cdot z\right), z\right) - \tan a\right)\\
\mathbf{if}\;a \leq -520000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+17}:\\
\;\;\;\;\left(x + \tan \left(y + z\right)\right) - a\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -5.2e11 or 1.4e17 < a Initial program 81.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6461.4
Applied rewrites61.4%
Taylor expanded in z around 0
distribute-rgt-inN/A
*-lft-identityN/A
+-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
pow-plusN/A
metadata-evalN/A
cube-unmultN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6433.7
Applied rewrites33.7%
if -5.2e11 < a < 1.4e17Initial program 79.5%
Taylor expanded in y around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6467.6
Applied rewrites67.6%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6476.8
Applied rewrites76.8%
Applied rewrites76.8%
(FPCore (x y z a) :precision binary64 (- (+ x (tan (+ y z))) a))
double code(double x, double y, double z, double a) {
return (x + tan((y + z))) - a;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = (x + tan((y + z))) - a
end function
public static double code(double x, double y, double z, double a) {
return (x + Math.tan((y + z))) - a;
}
def code(x, y, z, a): return (x + math.tan((y + z))) - a
function code(x, y, z, a) return Float64(Float64(x + tan(Float64(y + z))) - a) end
function tmp = code(x, y, z, a) tmp = (x + tan((y + z))) - a; end
code[x_, y_, z_, a_] := N[(N[(x + N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \tan \left(y + z\right)\right) - a
\end{array}
Initial program 80.7%
Taylor expanded in y around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6465.9
Applied rewrites65.9%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6441.5
Applied rewrites41.5%
Applied rewrites41.4%
(FPCore (x y z a) :precision binary64 (+ x (* a (* a (* a -0.3333333333333333)))))
double code(double x, double y, double z, double a) {
return x + (a * (a * (a * -0.3333333333333333)));
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = x + (a * (a * (a * (-0.3333333333333333d0))))
end function
public static double code(double x, double y, double z, double a) {
return x + (a * (a * (a * -0.3333333333333333)));
}
def code(x, y, z, a): return x + (a * (a * (a * -0.3333333333333333)))
function code(x, y, z, a) return Float64(x + Float64(a * Float64(a * Float64(a * -0.3333333333333333)))) end
function tmp = code(x, y, z, a) tmp = x + (a * (a * (a * -0.3333333333333333))); end
code[x_, y_, z_, a_] := N[(x + N[(a * N[(a * N[(a * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \left(a \cdot \left(a \cdot -0.3333333333333333\right)\right)
\end{array}
Initial program 80.7%
Taylor expanded in a around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
*-commutativeN/A
*-rgt-identityN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f6441.0
Applied rewrites41.0%
Taylor expanded in a around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z a) :precision binary64 (- a))
double code(double x, double y, double z, double a) {
return -a;
}
real(8) function code(x, y, z, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: a
code = -a
end function
public static double code(double x, double y, double z, double a) {
return -a;
}
def code(x, y, z, a): return -a
function code(x, y, z, a) return Float64(-a) end
function tmp = code(x, y, z, a) tmp = -a; end
code[x_, y_, z_, a_] := (-a)
\begin{array}{l}
\\
-a
\end{array}
Initial program 80.7%
Taylor expanded in y around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-/.f6465.9
Applied rewrites65.9%
Taylor expanded in a around 0
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-cos.f64N/A
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f6441.5
Applied rewrites41.5%
Taylor expanded in a around inf
mul-1-negN/A
lower-neg.f643.4
Applied rewrites3.4%
herbie shell --seed 2024219
(FPCore (x y z a)
:name "tan-example (used to crash)"
:precision binary64
:pre (and (and (and (or (== x 0.0) (and (<= 0.5884142 x) (<= x 505.5909))) (or (and (<= -1.796658e+308 y) (<= y -9.425585e-310)) (and (<= 1.284938e-309 y) (<= y 1.751224e+308)))) (or (and (<= -1.776707e+308 z) (<= z -8.599796e-310)) (and (<= 3.293145e-311 z) (<= z 1.725154e+308)))) (or (and (<= -1.796658e+308 a) (<= a -9.425585e-310)) (and (<= 1.284938e-309 a) (<= a 1.751224e+308))))
(+ x (- (tan (+ y z)) (tan a))))