
(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 16 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
(let* ((t_0 (- 1.0 (* (tan y) (tan z)))))
(fma
(- (* (cos a) (+ (tan y) (tan z))) (* (sin a) t_0))
(/ 1.0 (* (cos a) t_0))
x)))
double code(double x, double y, double z, double a) {
double t_0 = 1.0 - (tan(y) * tan(z));
return fma(((cos(a) * (tan(y) + tan(z))) - (sin(a) * t_0)), (1.0 / (cos(a) * t_0)), x);
}
function code(x, y, z, a) t_0 = Float64(1.0 - Float64(tan(y) * tan(z))) return fma(Float64(Float64(cos(a) * Float64(tan(y) + tan(z))) - Float64(sin(a) * t_0)), Float64(1.0 / Float64(cos(a) * t_0)), x) end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[Cos[a], $MachinePrecision] * N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sin[a], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[Cos[a], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \tan y \cdot \tan z\\
\mathsf{fma}\left(\cos a \cdot \left(\tan y + \tan z\right) - \sin a \cdot t\_0, \frac{1}{\cos a \cdot t\_0}, x\right)
\end{array}
\end{array}
Initial program 82.0%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-tan.f64N/A
lift-+.f64N/A
tan-sumN/A
lift-tan.f64N/A
tan-quotN/A
frac-subN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan y) (tan z)))
(t_1
(+
x
(-
(/
t_0
(- 1.0 (/ (tan z) (/ (fma -0.3333333333333333 (* y y) 1.0) y))))
(tan a)))))
(if (<= (tan a) -0.05)
t_1
(if (<= (tan a) 2.6e-14)
(fma
(/ 1.0 (- 1.0 (* (tan y) (tan z))))
t_0
(- x (fma a (* 0.3333333333333333 (* a a)) a)))
t_1))))
double code(double x, double y, double z, double a) {
double t_0 = tan(y) + tan(z);
double t_1 = x + ((t_0 / (1.0 - (tan(z) / (fma(-0.3333333333333333, (y * y), 1.0) / y)))) - tan(a));
double tmp;
if (tan(a) <= -0.05) {
tmp = t_1;
} else if (tan(a) <= 2.6e-14) {
tmp = fma((1.0 / (1.0 - (tan(y) * tan(z)))), t_0, (x - fma(a, (0.3333333333333333 * (a * a)), a)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, a) t_0 = Float64(tan(y) + tan(z)) t_1 = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(z) / Float64(fma(-0.3333333333333333, Float64(y * y), 1.0) / y)))) - tan(a))) tmp = 0.0 if (tan(a) <= -0.05) tmp = t_1; elseif (tan(a) <= 2.6e-14) tmp = fma(Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z)))), t_0, Float64(x - fma(a, Float64(0.3333333333333333 * Float64(a * a)), 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[(N[(t$95$0 / N[(1.0 - N[(N[Tan[z], $MachinePrecision] / N[(N[(-0.3333333333333333 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.05], t$95$1, If[LessEqual[N[Tan[a], $MachinePrecision], 2.6e-14], N[(N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + N[(x - N[(a * N[(0.3333333333333333 * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
t_1 := x + \left(\frac{t\_0}{1 - \frac{\tan z}{\frac{\mathsf{fma}\left(-0.3333333333333333, y \cdot y, 1\right)}{y}}} - \tan a\right)\\
\mathbf{if}\;\tan a \leq -0.05:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\tan a \leq 2.6 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{1 - \tan y \cdot \tan z}, t\_0, x - \mathsf{fma}\left(a, 0.3333333333333333 \cdot \left(a \cdot a\right), a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (tan.f64 a) < -0.050000000000000003 or 2.59999999999999997e-14 < (tan.f64 a) Initial program 83.4%
lift-tan.f64N/A
lift-+.f64N/A
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.5
Applied rewrites99.5%
lift-*.f64N/A
*-commutativeN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in y around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.1
Applied rewrites84.1%
if -0.050000000000000003 < (tan.f64 a) < 2.59999999999999997e-14Initial 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-*.f6480.7
Applied rewrites80.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-tan.f64N/A
tan-quotN/A
div-invN/A
lower-fma.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-+.f64N/A
Applied rewrites80.7%
Applied rewrites99.7%
(FPCore (x y z a) :precision binary64 (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (/ (* (tan y) (sin z)) (cos z)))) (tan a))))
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) / (1.0 - ((tan(y) * sin(z)) / cos(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) * sin(z)) / cos(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.sin(z)) / Math.cos(z)))) - Math.tan(a));
}
def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) / (1.0 - ((math.tan(y) * math.sin(z)) / math.cos(z)))) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(Float64(tan(y) * sin(z)) / cos(z)))) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (((tan(y) + tan(z)) / (1.0 - ((tan(y) * sin(z)) / cos(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[(N[Tan[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision] / N[Cos[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{\tan y + \tan z}{1 - \frac{\tan y \cdot \sin z}{\cos z}} - \tan a\right)
\end{array}
Initial program 82.0%
lift-tan.f64N/A
lift-+.f64N/A
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%
lift-*.f64N/A
lift-tan.f64N/A
tan-quotN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-cos.f6499.6
Applied rewrites99.6%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (/ -1.0 (tan y))))
(+
x
(- (/ (fma -1.0 (/ 1.0 t_0) (tan z)) (+ 1.0 (/ (tan z) t_0))) (tan a)))))
double code(double x, double y, double z, double a) {
double t_0 = -1.0 / tan(y);
return x + ((fma(-1.0, (1.0 / t_0), tan(z)) / (1.0 + (tan(z) / t_0))) - tan(a));
}
function code(x, y, z, a) t_0 = Float64(-1.0 / tan(y)) return Float64(x + Float64(Float64(fma(-1.0, Float64(1.0 / t_0), tan(z)) / Float64(1.0 + Float64(tan(z) / t_0))) - tan(a))) end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision]}, N[(x + N[(N[(N[(-1.0 * N[(1.0 / t$95$0), $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[Tan[z], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\tan y}\\
x + \left(\frac{\mathsf{fma}\left(-1, \frac{1}{t\_0}, \tan z\right)}{1 + \frac{\tan z}{t\_0}} - \tan a\right)
\end{array}
\end{array}
Initial program 82.0%
lift-tan.f64N/A
lift-+.f64N/A
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%
lift-*.f64N/A
*-commutativeN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
lift-+.f64N/A
remove-double-divN/A
lift-/.f64N/A
inv-powN/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
unpow-prod-downN/A
metadata-evalN/A
inv-powN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z a) :precision binary64 (+ x (- (/ (fma -1.0 (/ 1.0 (/ -1.0 (tan y))) (tan z)) (- 1.0 (* (tan y) (tan z)))) (tan a))))
double code(double x, double y, double z, double a) {
return x + ((fma(-1.0, (1.0 / (-1.0 / tan(y))), tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
}
function code(x, y, z, a) return Float64(x + Float64(Float64(fma(-1.0, Float64(1.0 / Float64(-1.0 / tan(y))), tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a))) end
code[x_, y_, z_, a_] := N[(x + N[(N[(N[(-1.0 * N[(1.0 / N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision]), $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{\mathsf{fma}\left(-1, \frac{1}{\frac{-1}{\tan y}}, \tan z\right)}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Initial program 82.0%
lift-tan.f64N/A
lift-+.f64N/A
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%
lift-*.f64N/A
*-commutativeN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
lift-+.f64N/A
remove-double-divN/A
lift-/.f64N/A
inv-powN/A
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
div-invN/A
distribute-neg-frac2N/A
lift-/.f64N/A
unpow-prod-downN/A
metadata-evalN/A
inv-powN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6499.6
Applied rewrites99.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
lower-*.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(FPCore (x y z a) :precision binary64 (+ x (- (/ (+ (tan y) (tan z)) (+ 1.0 (/ (tan z) (/ -1.0 (tan y))))) (tan a))))
double code(double x, double y, double z, double a) {
return x + (((tan(y) + tan(z)) / (1.0 + (tan(z) / (-1.0 / tan(y))))) - 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(z) / ((-1.0d0) / tan(y))))) - 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(z) / (-1.0 / Math.tan(y))))) - Math.tan(a));
}
def code(x, y, z, a): return x + (((math.tan(y) + math.tan(z)) / (1.0 + (math.tan(z) / (-1.0 / math.tan(y))))) - math.tan(a))
function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 + Float64(tan(z) / Float64(-1.0 / tan(y))))) - tan(a))) end
function tmp = code(x, y, z, a) tmp = x + (((tan(y) + tan(z)) / (1.0 + (tan(z) / (-1.0 / tan(y))))) - 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[z], $MachinePrecision] / N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{\tan y + \tan z}{1 + \frac{\tan z}{\frac{-1}{\tan y}}} - \tan a\right)
\end{array}
Initial program 82.0%
lift-tan.f64N/A
lift-+.f64N/A
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%
lift-*.f64N/A
*-commutativeN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
clear-numN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
Final simplification99.6%
(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 82.0%
lift-tan.f64N/A
lift-+.f64N/A
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%
(FPCore (x y z a)
:precision binary64
(if (<= a -0.0102)
(+ x (- (tan (+ y z)) (tan a)))
(if (<= a 2.7e-14)
(fma
(/ 1.0 (- 1.0 (* (tan y) (tan z))))
(+ (tan y) (tan z))
(- x (fma a (* 0.3333333333333333 (* a a)) a)))
(+ x (fma (/ 1.0 (cos (+ y z))) (sin (+ y z)) (- (tan a)))))))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -0.0102) {
tmp = x + (tan((y + z)) - tan(a));
} else if (a <= 2.7e-14) {
tmp = fma((1.0 / (1.0 - (tan(y) * tan(z)))), (tan(y) + tan(z)), (x - fma(a, (0.3333333333333333 * (a * a)), a)));
} else {
tmp = x + fma((1.0 / cos((y + z))), sin((y + z)), -tan(a));
}
return tmp;
}
function code(x, y, z, a) tmp = 0.0 if (a <= -0.0102) tmp = Float64(x + Float64(tan(Float64(y + z)) - tan(a))); elseif (a <= 2.7e-14) tmp = fma(Float64(1.0 / Float64(1.0 - Float64(tan(y) * tan(z)))), Float64(tan(y) + tan(z)), Float64(x - fma(a, Float64(0.3333333333333333 * Float64(a * a)), a))); else tmp = Float64(x + fma(Float64(1.0 / cos(Float64(y + z))), sin(Float64(y + z)), Float64(-tan(a)))); end return tmp end
code[x_, y_, z_, a_] := If[LessEqual[a, -0.0102], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e-14], N[(N[(1.0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] + N[(x - N[(a * N[(0.3333333333333333 * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0102:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{1 - \tan y \cdot \tan z}, \tan y + \tan z, x - \mathsf{fma}\left(a, 0.3333333333333333 \cdot \left(a \cdot a\right), a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(\frac{1}{\cos \left(y + z\right)}, \sin \left(y + z\right), -\tan a\right)\\
\end{array}
\end{array}
if a < -0.010200000000000001Initial program 81.9%
if -0.010200000000000001 < a < 2.6999999999999999e-14Initial 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-*.f6480.7
Applied rewrites80.7%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-tan.f64N/A
tan-quotN/A
div-invN/A
lower-fma.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-+.f64N/A
Applied rewrites80.7%
Applied rewrites99.7%
if 2.6999999999999999e-14 < a Initial program 85.2%
lift--.f64N/A
sub-negN/A
lift-tan.f64N/A
tan-quotN/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
lower-neg.f6485.2
Applied rewrites85.2%
(FPCore (x y z a)
:precision binary64
(if (<= a -0.0102)
(+ x (- (tan (+ y z)) (tan a)))
(if (<= a 2.7e-14)
(+
x
(-
(/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z))))
(fma (* a a) (* a 0.3333333333333333) a)))
(+ x (fma (/ 1.0 (cos (+ y z))) (sin (+ y z)) (- (tan a)))))))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -0.0102) {
tmp = x + (tan((y + z)) - tan(a));
} else if (a <= 2.7e-14) {
tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - fma((a * a), (a * 0.3333333333333333), a));
} else {
tmp = x + fma((1.0 / cos((y + z))), sin((y + z)), -tan(a));
}
return tmp;
}
function code(x, y, z, a) tmp = 0.0 if (a <= -0.0102) tmp = Float64(x + Float64(tan(Float64(y + z)) - tan(a))); elseif (a <= 2.7e-14) tmp = Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - fma(Float64(a * a), Float64(a * 0.3333333333333333), a))); else tmp = Float64(x + fma(Float64(1.0 / cos(Float64(y + z))), sin(Float64(y + z)), Float64(-tan(a)))); end return tmp end
code[x_, y_, z_, a_] := If[LessEqual[a, -0.0102], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e-14], 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[(N[(a * a), $MachinePrecision] * N[(a * 0.3333333333333333), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0102:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-14}:\\
\;\;\;\;x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(a \cdot a, a \cdot 0.3333333333333333, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(\frac{1}{\cos \left(y + z\right)}, \sin \left(y + z\right), -\tan a\right)\\
\end{array}
\end{array}
if a < -0.010200000000000001Initial program 81.9%
if -0.010200000000000001 < a < 2.6999999999999999e-14Initial 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-*.f6480.7
Applied rewrites80.7%
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
lift-/.f6499.7
Applied rewrites99.7%
if 2.6999999999999999e-14 < a Initial program 85.2%
lift--.f64N/A
sub-negN/A
lift-tan.f64N/A
tan-quotN/A
clear-numN/A
associate-/r/N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
lower-neg.f6485.2
Applied rewrites85.2%
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ x (- (tan y) (tan a)))))
(if (<= (tan a) -0.05)
t_0
(if (<= (tan a) 5e-14)
(+
x
(-
(tan (+ y z))
(fma
(fma a (* a 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(y) - tan(a));
double tmp;
if (tan(a) <= -0.05) {
tmp = t_0;
} else if (tan(a) <= 5e-14) {
tmp = x + (tan((y + z)) - fma(fma(a, (a * 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(y) - tan(a))) tmp = 0.0 if (tan(a) <= -0.05) tmp = t_0; elseif (tan(a) <= 5e-14) 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 = t_0; end return tmp end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.05], t$95$0, If[LessEqual[N[Tan[a], $MachinePrecision], 5e-14], 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], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(\tan y - \tan a\right)\\
\mathbf{if}\;\tan a \leq -0.05:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-14}:\\
\;\;\;\;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}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (tan.f64 a) < -0.050000000000000003 or 5.0000000000000002e-14 < (tan.f64 a) Initial program 83.3%
Taylor expanded in z around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6463.0
Applied rewrites63.0%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.0
Applied rewrites63.0%
if -0.050000000000000003 < (tan.f64 a) < 5.0000000000000002e-14Initial program 80.8%
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-*.f6480.8
Applied rewrites80.8%
Final simplification72.0%
(FPCore (x y z a)
:precision binary64
(if (<= (tan a) -0.0002)
(/ 1.0 (/ 1.0 x))
(if (<= (tan a) 0.08)
(+ x (- (tan (+ y z)) (fma (* a a) (* a 0.3333333333333333) a)))
(+ x (- (fma y (* (* y y) 0.3333333333333333) y) (tan a))))))
double code(double x, double y, double z, double a) {
double tmp;
if (tan(a) <= -0.0002) {
tmp = 1.0 / (1.0 / x);
} else if (tan(a) <= 0.08) {
tmp = x + (tan((y + z)) - fma((a * a), (a * 0.3333333333333333), a));
} else {
tmp = x + (fma(y, ((y * y) * 0.3333333333333333), y) - tan(a));
}
return tmp;
}
function code(x, y, z, a) tmp = 0.0 if (tan(a) <= -0.0002) tmp = Float64(1.0 / Float64(1.0 / x)); elseif (tan(a) <= 0.08) tmp = Float64(x + Float64(tan(Float64(y + z)) - fma(Float64(a * a), Float64(a * 0.3333333333333333), a))); else tmp = Float64(x + Float64(fma(y, Float64(Float64(y * y) * 0.3333333333333333), y) - tan(a))); end return tmp end
code[x_, y_, z_, a_] := If[LessEqual[N[Tan[a], $MachinePrecision], -0.0002], N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 0.08], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[(a * a), $MachinePrecision] * N[(a * 0.3333333333333333), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(N[(y * y), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + y), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\tan a \leq -0.0002:\\
\;\;\;\;\frac{1}{\frac{1}{x}}\\
\mathbf{elif}\;\tan a \leq 0.08:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \mathsf{fma}\left(a \cdot a, a \cdot 0.3333333333333333, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot 0.3333333333333333, y\right) - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -2.0000000000000001e-4Initial program 78.5%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
lift-+.f64N/A
lower-/.f6478.3
Applied rewrites78.1%
Taylor expanded in x around inf
lower-/.f6422.9
Applied rewrites22.9%
if -2.0000000000000001e-4 < (tan.f64 a) < 0.0800000000000000017Initial program 81.3%
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.4
Applied rewrites80.4%
if 0.0800000000000000017 < (tan.f64 a) Initial program 85.8%
Taylor expanded in z around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6466.1
Applied rewrites66.1%
Taylor expanded in y around 0
Applied rewrites40.2%
Final simplification57.5%
(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
(if (<= a -1.05e+22)
(+
x
(-
(fma (fma (* y y) 0.13333333333333333 0.3333333333333333) (* y (* y y)) y)
(tan a)))
(if (<= a 6.9e-12)
(+ x (- (tan (+ y z)) (fma (* a a) (* a 0.3333333333333333) a)))
(+ x (- (fma y (* (* y y) 0.3333333333333333) y) (tan a))))))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.05e+22) {
tmp = x + (fma(fma((y * y), 0.13333333333333333, 0.3333333333333333), (y * (y * y)), y) - tan(a));
} else if (a <= 6.9e-12) {
tmp = x + (tan((y + z)) - fma((a * a), (a * 0.3333333333333333), a));
} else {
tmp = x + (fma(y, ((y * y) * 0.3333333333333333), y) - tan(a));
}
return tmp;
}
function code(x, y, z, a) tmp = 0.0 if (a <= -1.05e+22) tmp = Float64(x + Float64(fma(fma(Float64(y * y), 0.13333333333333333, 0.3333333333333333), Float64(y * Float64(y * y)), y) - tan(a))); elseif (a <= 6.9e-12) tmp = Float64(x + Float64(tan(Float64(y + z)) - fma(Float64(a * a), Float64(a * 0.3333333333333333), a))); else tmp = Float64(x + Float64(fma(y, Float64(Float64(y * y) * 0.3333333333333333), y) - tan(a))); end return tmp end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.05e+22], N[(x + N[(N[(N[(N[(y * y), $MachinePrecision] * 0.13333333333333333 + 0.3333333333333333), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.9e-12], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[(a * a), $MachinePrecision] * N[(a * 0.3333333333333333), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(N[(y * y), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + y), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{+22}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.13333333333333333, 0.3333333333333333\right), y \cdot \left(y \cdot y\right), y\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 6.9 \cdot 10^{-12}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \mathsf{fma}\left(a \cdot a, a \cdot 0.3333333333333333, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot 0.3333333333333333, y\right) - \tan a\right)\\
\end{array}
\end{array}
if a < -1.0499999999999999e22Initial program 84.4%
Taylor expanded in z around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6465.5
Applied rewrites65.5%
Taylor expanded in y around 0
Applied rewrites32.5%
if -1.0499999999999999e22 < a < 6.9000000000000001e-12Initial program 79.6%
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-*.f6478.6
Applied rewrites78.6%
if 6.9000000000000001e-12 < a Initial program 84.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6461.7
Applied rewrites61.7%
Taylor expanded in y around 0
Applied rewrites37.5%
Final simplification57.6%
(FPCore (x y z a) :precision binary64 (if (<= y -1.45) (/ 1.0 (/ 1.0 x)) (+ x (- (fma y (* (* y y) 0.3333333333333333) y) (tan a)))))
double code(double x, double y, double z, double a) {
double tmp;
if (y <= -1.45) {
tmp = 1.0 / (1.0 / x);
} else {
tmp = x + (fma(y, ((y * y) * 0.3333333333333333), y) - tan(a));
}
return tmp;
}
function code(x, y, z, a) tmp = 0.0 if (y <= -1.45) tmp = Float64(1.0 / Float64(1.0 / x)); else tmp = Float64(x + Float64(fma(y, Float64(Float64(y * y) * 0.3333333333333333), y) - tan(a))); end return tmp end
code[x_, y_, z_, a_] := If[LessEqual[y, -1.45], N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(N[(y * y), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + y), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45:\\
\;\;\;\;\frac{1}{\frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot 0.3333333333333333, y\right) - \tan a\right)\\
\end{array}
\end{array}
if y < -1.44999999999999996Initial program 65.7%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
lift-+.f64N/A
lower-/.f6465.6
Applied rewrites65.4%
Taylor expanded in x around inf
lower-/.f6424.1
Applied rewrites24.1%
if -1.44999999999999996 < y Initial program 86.6%
Taylor expanded in z around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6459.6
Applied rewrites59.6%
Taylor expanded in y around 0
Applied rewrites43.1%
Final simplification39.0%
(FPCore (x y z a) :precision binary64 (/ 1.0 (/ 1.0 x)))
double code(double x, double y, double z, double a) {
return 1.0 / (1.0 / 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 = 1.0d0 / (1.0d0 / x)
end function
public static double code(double x, double y, double z, double a) {
return 1.0 / (1.0 / x);
}
def code(x, y, z, a): return 1.0 / (1.0 / x)
function code(x, y, z, a) return Float64(1.0 / Float64(1.0 / x)) end
function tmp = code(x, y, z, a) tmp = 1.0 / (1.0 / x); end
code[x_, y_, z_, a_] := N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{1}{x}}
\end{array}
Initial program 82.0%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
lift-+.f64N/A
lower-/.f6481.9
Applied rewrites81.8%
Taylor expanded in x around inf
lower-/.f6432.4
Applied rewrites32.4%
(FPCore (x y z a) :precision binary64 (/ 1.0 (/ -1.0 x)))
double code(double x, double y, double z, double a) {
return 1.0 / (-1.0 / 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 = 1.0d0 / ((-1.0d0) / x)
end function
public static double code(double x, double y, double z, double a) {
return 1.0 / (-1.0 / x);
}
def code(x, y, z, a): return 1.0 / (-1.0 / x)
function code(x, y, z, a) return Float64(1.0 / Float64(-1.0 / x)) end
function tmp = code(x, y, z, a) tmp = 1.0 / (-1.0 / x); end
code[x_, y_, z_, a_] := N[(1.0 / N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{-1}{x}}
\end{array}
Initial program 82.0%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3-+N/A
lift-+.f64N/A
lower-/.f6481.9
Applied rewrites81.8%
Taylor expanded in x around inf
lower-/.f6432.4
Applied rewrites32.4%
Applied rewrites32.4%
Taylor expanded in x around -inf
Applied rewrites3.0%
herbie shell --seed 2024220
(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))))