
(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 9 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 z) (tan y)) (fma (- (tan z)) (tan y) 1.0)) (tan a))))
double code(double x, double y, double z, double a) {
return x + (((tan(z) + tan(y)) / fma(-tan(z), tan(y), 1.0)) - tan(a));
}
function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(z) + tan(y)) / fma(Float64(-tan(z)), tan(y), 1.0)) - tan(a))) end
code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[((-N[Tan[z], $MachinePrecision]) * N[Tan[y], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{\tan z + \tan y}{\mathsf{fma}\left(-\tan z, \tan y, 1\right)} - \tan a\right)
\end{array}
Initial program 82.0%
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-tan.f64N/A
lower-tan.f64N/A
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-tan.f64N/A
lower-tan.f6499.6
Applied rewrites99.6%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (- (tan z))) (t_1 (- t_0 (tan y))))
(if (or (<= a -0.0285) (not (<= a 230000000000.0)))
(fma t_1 (pow -1.0 -1.0) (- x (tan a)))
(fma
t_1
(/ -1.0 (fma t_0 (tan y) 1.0))
(fma
(fma
(fma (* a a) -0.13333333333333333 -0.3333333333333333)
(* a a)
-1.0)
a
x)))))
double code(double x, double y, double z, double a) {
double t_0 = -tan(z);
double t_1 = t_0 - tan(y);
double tmp;
if ((a <= -0.0285) || !(a <= 230000000000.0)) {
tmp = fma(t_1, pow(-1.0, -1.0), (x - tan(a)));
} else {
tmp = fma(t_1, (-1.0 / fma(t_0, tan(y), 1.0)), fma(fma(fma((a * a), -0.13333333333333333, -0.3333333333333333), (a * a), -1.0), a, x));
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(-tan(z)) t_1 = Float64(t_0 - tan(y)) tmp = 0.0 if ((a <= -0.0285) || !(a <= 230000000000.0)) tmp = fma(t_1, (-1.0 ^ -1.0), Float64(x - tan(a))); else tmp = fma(t_1, Float64(-1.0 / fma(t_0, tan(y), 1.0)), fma(fma(fma(Float64(a * a), -0.13333333333333333, -0.3333333333333333), Float64(a * a), -1.0), a, x)); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = (-N[Tan[z], $MachinePrecision])}, Block[{t$95$1 = N[(t$95$0 - N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -0.0285], N[Not[LessEqual[a, 230000000000.0]], $MachinePrecision]], N[(t$95$1 * N[Power[-1.0, -1.0], $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(-1.0 / N[(t$95$0 * N[Tan[y], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(a * a), $MachinePrecision] * -0.13333333333333333 + -0.3333333333333333), $MachinePrecision] * N[(a * a), $MachinePrecision] + -1.0), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan z\\
t_1 := t\_0 - \tan y\\
\mathbf{if}\;a \leq -0.0285 \lor \neg \left(a \leq 230000000000\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, {-1}^{-1}, x - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \frac{-1}{\mathsf{fma}\left(t\_0, \tan y, 1\right)}, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, -0.13333333333333333, -0.3333333333333333\right), a \cdot a, -1\right), a, x\right)\right)\\
\end{array}
\end{array}
if a < -0.028500000000000001 or 2.3e11 < a Initial program 81.4%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
Applied rewrites82.2%
if -0.028500000000000001 < a < 2.3e11Initial program 82.6%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.1
Applied rewrites99.1%
Final simplification91.0%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (- (tan z))) (t_1 (- t_0 (tan y))))
(if (or (<= a -0.026) (not (<= a 230000000000.0)))
(fma t_1 (pow -1.0 -1.0) (- x (tan a)))
(fma
t_1
(/ -1.0 (fma t_0 (tan y) 1.0))
(fma (fma (* a a) -0.3333333333333333 -1.0) a x)))))
double code(double x, double y, double z, double a) {
double t_0 = -tan(z);
double t_1 = t_0 - tan(y);
double tmp;
if ((a <= -0.026) || !(a <= 230000000000.0)) {
tmp = fma(t_1, pow(-1.0, -1.0), (x - tan(a)));
} else {
tmp = fma(t_1, (-1.0 / fma(t_0, tan(y), 1.0)), fma(fma((a * a), -0.3333333333333333, -1.0), a, x));
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(-tan(z)) t_1 = Float64(t_0 - tan(y)) tmp = 0.0 if ((a <= -0.026) || !(a <= 230000000000.0)) tmp = fma(t_1, (-1.0 ^ -1.0), Float64(x - tan(a))); else tmp = fma(t_1, Float64(-1.0 / fma(t_0, tan(y), 1.0)), fma(fma(Float64(a * a), -0.3333333333333333, -1.0), a, x)); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = (-N[Tan[z], $MachinePrecision])}, Block[{t$95$1 = N[(t$95$0 - N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -0.026], N[Not[LessEqual[a, 230000000000.0]], $MachinePrecision]], N[(t$95$1 * N[Power[-1.0, -1.0], $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(-1.0 / N[(t$95$0 * N[Tan[y], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * a), $MachinePrecision] * -0.3333333333333333 + -1.0), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan z\\
t_1 := t\_0 - \tan y\\
\mathbf{if}\;a \leq -0.026 \lor \neg \left(a \leq 230000000000\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, {-1}^{-1}, x - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \frac{-1}{\mathsf{fma}\left(t\_0, \tan y, 1\right)}, \mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, -0.3333333333333333, -1\right), a, x\right)\right)\\
\end{array}
\end{array}
if a < -0.0259999999999999988 or 2.3e11 < a Initial program 81.4%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
Applied rewrites82.2%
if -0.0259999999999999988 < a < 2.3e11Initial program 82.6%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.0
Applied rewrites99.0%
Final simplification90.9%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (- (tan z))) (t_1 (- t_0 (tan y))))
(if (or (<= a -0.0135) (not (<= a 230000000000.0)))
(fma t_1 (pow -1.0 -1.0) (- x (tan a)))
(fma t_1 (/ -1.0 (fma t_0 (tan y) 1.0)) (- x a)))))
double code(double x, double y, double z, double a) {
double t_0 = -tan(z);
double t_1 = t_0 - tan(y);
double tmp;
if ((a <= -0.0135) || !(a <= 230000000000.0)) {
tmp = fma(t_1, pow(-1.0, -1.0), (x - tan(a)));
} else {
tmp = fma(t_1, (-1.0 / fma(t_0, tan(y), 1.0)), (x - a));
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(-tan(z)) t_1 = Float64(t_0 - tan(y)) tmp = 0.0 if ((a <= -0.0135) || !(a <= 230000000000.0)) tmp = fma(t_1, (-1.0 ^ -1.0), Float64(x - tan(a))); else tmp = fma(t_1, Float64(-1.0 / fma(t_0, tan(y), 1.0)), Float64(x - a)); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = (-N[Tan[z], $MachinePrecision])}, Block[{t$95$1 = N[(t$95$0 - N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -0.0135], N[Not[LessEqual[a, 230000000000.0]], $MachinePrecision]], N[(t$95$1 * N[Power[-1.0, -1.0], $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(-1.0 / N[(t$95$0 * N[Tan[y], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(x - a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\tan z\\
t_1 := t\_0 - \tan y\\
\mathbf{if}\;a \leq -0.0135 \lor \neg \left(a \leq 230000000000\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, {-1}^{-1}, x - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, \frac{-1}{\mathsf{fma}\left(t\_0, \tan y, 1\right)}, x - a\right)\\
\end{array}
\end{array}
if a < -0.0134999999999999998 or 2.3e11 < a Initial program 81.4%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
Applied rewrites82.2%
if -0.0134999999999999998 < a < 2.3e11Initial program 82.6%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
lower--.f6498.8
Applied rewrites98.8%
Final simplification90.9%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (- (- (tan z)) (tan y))))
(if (or (<= a -2.15e-14) (not (<= a 5.2e-14)))
(fma t_0 (pow -1.0 -1.0) (- x (tan a)))
(- (/ t_0 (fma (tan z) (tan y) -1.0)) (- x)))))
double code(double x, double y, double z, double a) {
double t_0 = -tan(z) - tan(y);
double tmp;
if ((a <= -2.15e-14) || !(a <= 5.2e-14)) {
tmp = fma(t_0, pow(-1.0, -1.0), (x - tan(a)));
} else {
tmp = (t_0 / fma(tan(z), tan(y), -1.0)) - -x;
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(Float64(-tan(z)) - tan(y)) tmp = 0.0 if ((a <= -2.15e-14) || !(a <= 5.2e-14)) tmp = fma(t_0, (-1.0 ^ -1.0), Float64(x - tan(a))); else tmp = Float64(Float64(t_0 / fma(tan(z), tan(y), -1.0)) - Float64(-x)); end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[((-N[Tan[z], $MachinePrecision]) - N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -2.15e-14], N[Not[LessEqual[a, 5.2e-14]], $MachinePrecision]], N[(t$95$0 * N[Power[-1.0, -1.0], $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(N[Tan[z], $MachinePrecision] * N[Tan[y], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] - (-x)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\tan z\right) - \tan y\\
\mathbf{if}\;a \leq -2.15 \cdot 10^{-14} \lor \neg \left(a \leq 5.2 \cdot 10^{-14}\right):\\
\;\;\;\;\mathsf{fma}\left(t\_0, {-1}^{-1}, x - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(\tan z, \tan y, -1\right)} - \left(-x\right)\\
\end{array}
\end{array}
if a < -2.14999999999999999e-14 or 5.19999999999999993e-14 < a Initial program 80.8%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.3%
Taylor expanded in y around 0
Applied rewrites81.6%
if -2.14999999999999999e-14 < a < 5.19999999999999993e-14Initial program 83.2%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6483.2
Applied rewrites83.2%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6483.2
Applied rewrites83.2%
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
lift-tan.f64N/A
lift-tan.f64N/A
*-commutativeN/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
+-commutativeN/A
lift-fma.f64N/A
lower-/.f64N/A
lift-tan.f64N/A
remove-double-negN/A
lift-neg.f64N/A
lift-tan.f64N/A
lower-+.f64N/A
lift-neg.f64N/A
remove-double-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
Final simplification90.7%
(FPCore (x y z a) :precision binary64 (fma (- (- (tan z)) (tan y)) (pow -1.0 -1.0) (- x (tan a))))
double code(double x, double y, double z, double a) {
return fma((-tan(z) - tan(y)), pow(-1.0, -1.0), (x - tan(a)));
}
function code(x, y, z, a) return fma(Float64(Float64(-tan(z)) - tan(y)), (-1.0 ^ -1.0), Float64(x - tan(a))) end
code[x_, y_, z_, a_] := N[(N[((-N[Tan[z], $MachinePrecision]) - N[Tan[y], $MachinePrecision]), $MachinePrecision] * N[Power[-1.0, -1.0], $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(-\tan z\right) - \tan y, {-1}^{-1}, x - \tan a\right)
\end{array}
Initial program 82.0%
lift-+.f64N/A
lift--.f64N/A
associate-+r-N/A
+-commutativeN/A
associate--l+N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in y around 0
Applied rewrites82.4%
Final simplification82.4%
(FPCore (x y z a) :precision binary64 (fma (/ (- (tan (+ z y)) (tan a)) x) x x))
double code(double x, double y, double z, double a) {
return fma(((tan((z + y)) - tan(a)) / x), x, x);
}
function code(x, y, z, a) return fma(Float64(Float64(tan(Float64(z + y)) - tan(a)) / x), x, x) end
code[x_, y_, z_, a_] := N[(N[(N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * x + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{\tan \left(z + y\right) - \tan a}{x}, x, x\right)
\end{array}
Initial program 82.0%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6482.0
Applied rewrites82.0%
Taylor expanded in x around inf
associate--l+N/A
+-commutativeN/A
associate-/l/N/A
associate-/l/N/A
div-subN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites82.0%
Applied rewrites82.1%
(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 82.0%
(FPCore (x y z a) :precision binary64 (- (tan (+ z y)) (- x)))
double code(double x, double y, double z, double a) {
return tan((z + y)) - -x;
}
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 = tan((z + y)) - -x
end function
public static double code(double x, double y, double z, double a) {
return Math.tan((z + y)) - -x;
}
def code(x, y, z, a): return math.tan((z + y)) - -x
function code(x, y, z, a) return Float64(tan(Float64(z + y)) - Float64(-x)) end
function tmp = code(x, y, z, a) tmp = tan((z + y)) - -x; end
code[x_, y_, z_, a_] := N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] - (-x)), $MachinePrecision]
\begin{array}{l}
\\
\tan \left(z + y\right) - \left(-x\right)
\end{array}
Initial program 82.0%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6482.0
Applied rewrites82.0%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6453.4
Applied rewrites53.4%
herbie shell --seed 2024322
(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))))