
(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 17 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
(+
(/
(+
(/ (pow (tan y) 2.0) (- (tan y) (tan z)))
(/ (pow (tan z) 2.0) (- (tan z) (tan y))))
(- 1.0 (* (tan y) (tan z))))
(- x (tan a))))
double code(double x, double y, double z, double a) {
return (((pow(tan(y), 2.0) / (tan(y) - tan(z))) + (pow(tan(z), 2.0) / (tan(z) - tan(y)))) / (1.0 - (tan(y) * tan(z)))) + (x - 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 = ((((tan(y) ** 2.0d0) / (tan(y) - tan(z))) + ((tan(z) ** 2.0d0) / (tan(z) - tan(y)))) / (1.0d0 - (tan(y) * tan(z)))) + (x - tan(a))
end function
public static double code(double x, double y, double z, double a) {
return (((Math.pow(Math.tan(y), 2.0) / (Math.tan(y) - Math.tan(z))) + (Math.pow(Math.tan(z), 2.0) / (Math.tan(z) - Math.tan(y)))) / (1.0 - (Math.tan(y) * Math.tan(z)))) + (x - Math.tan(a));
}
def code(x, y, z, a): return (((math.pow(math.tan(y), 2.0) / (math.tan(y) - math.tan(z))) + (math.pow(math.tan(z), 2.0) / (math.tan(z) - math.tan(y)))) / (1.0 - (math.tan(y) * math.tan(z)))) + (x - math.tan(a))
function code(x, y, z, a) return Float64(Float64(Float64(Float64((tan(y) ^ 2.0) / Float64(tan(y) - tan(z))) + Float64((tan(z) ^ 2.0) / Float64(tan(z) - tan(y)))) / Float64(1.0 - Float64(tan(y) * tan(z)))) + Float64(x - tan(a))) end
function tmp = code(x, y, z, a) tmp = ((((tan(y) ^ 2.0) / (tan(y) - tan(z))) + ((tan(z) ^ 2.0) / (tan(z) - tan(y)))) / (1.0 - (tan(y) * tan(z)))) + (x - tan(a)); end
code[x_, y_, z_, a_] := N[(N[(N[(N[(N[Power[N[Tan[y], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Tan[y], $MachinePrecision] - N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[Tan[z], $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Tan[z], $MachinePrecision] - N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{{\tan y}^{2}}{\tan y - \tan z} + \frac{{\tan z}^{2}}{\tan z - \tan y}}{1 - \tan y \cdot \tan z} + \left(x - \tan a\right)
\end{array}
Initial program 81.1%
+-commutative81.1%
associate-+l-81.1%
tan-sum99.7%
div-inv99.6%
fmm-def99.7%
Applied egg-rr99.7%
fmm-undef99.6%
add-cube-cbrt97.9%
prod-diff97.9%
pow297.9%
Applied egg-rr97.9%
Simplified99.7%
flip-+99.6%
div-sub99.7%
pow299.7%
pow299.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.7%
Final simplification99.7%
(FPCore (x y z a)
:precision binary64
(if (<= (tan a) -0.01)
(+ x (- (tan (+ y z)) (tan a)))
(if (<= (tan a) 5e-51)
(+ x (- (* (+ (tan y) (tan z)) (/ -1.0 (+ (* (tan y) (tan z)) -1.0))) a))
(+ (/ (sin (+ y z)) (cos (+ y z))) (- x (tan a))))))
double code(double x, double y, double z, double a) {
double tmp;
if (tan(a) <= -0.01) {
tmp = x + (tan((y + z)) - tan(a));
} else if (tan(a) <= 5e-51) {
tmp = x + (((tan(y) + tan(z)) * (-1.0 / ((tan(y) * tan(z)) + -1.0))) - a);
} else {
tmp = (sin((y + z)) / cos((y + z))) + (x - tan(a));
}
return tmp;
}
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
real(8) :: tmp
if (tan(a) <= (-0.01d0)) then
tmp = x + (tan((y + z)) - tan(a))
else if (tan(a) <= 5d-51) then
tmp = x + (((tan(y) + tan(z)) * ((-1.0d0) / ((tan(y) * tan(z)) + (-1.0d0)))) - a)
else
tmp = (sin((y + z)) / cos((y + z))) + (x - tan(a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (Math.tan(a) <= -0.01) {
tmp = x + (Math.tan((y + z)) - Math.tan(a));
} else if (Math.tan(a) <= 5e-51) {
tmp = x + (((Math.tan(y) + Math.tan(z)) * (-1.0 / ((Math.tan(y) * Math.tan(z)) + -1.0))) - a);
} else {
tmp = (Math.sin((y + z)) / Math.cos((y + z))) + (x - Math.tan(a));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if math.tan(a) <= -0.01: tmp = x + (math.tan((y + z)) - math.tan(a)) elif math.tan(a) <= 5e-51: tmp = x + (((math.tan(y) + math.tan(z)) * (-1.0 / ((math.tan(y) * math.tan(z)) + -1.0))) - a) else: tmp = (math.sin((y + z)) / math.cos((y + z))) + (x - math.tan(a)) return tmp
function code(x, y, z, a) tmp = 0.0 if (tan(a) <= -0.01) tmp = Float64(x + Float64(tan(Float64(y + z)) - tan(a))); elseif (tan(a) <= 5e-51) tmp = Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) * Float64(-1.0 / Float64(Float64(tan(y) * tan(z)) + -1.0))) - a)); else tmp = Float64(Float64(sin(Float64(y + z)) / cos(Float64(y + z))) + Float64(x - tan(a))); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (tan(a) <= -0.01) tmp = x + (tan((y + z)) - tan(a)); elseif (tan(a) <= 5e-51) tmp = x + (((tan(y) + tan(z)) * (-1.0 / ((tan(y) * tan(z)) + -1.0))) - a); else tmp = (sin((y + z)) / cos((y + z))) + (x - tan(a)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[Tan[a], $MachinePrecision], -0.01], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-51], N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\tan a \leq -0.01:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-51}:\\
\;\;\;\;x + \left(\left(\tan y + \tan z\right) \cdot \frac{-1}{\tan y \cdot \tan z + -1} - a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} + \left(x - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0100000000000000002Initial program 83.6%
if -0.0100000000000000002 < (tan.f64 a) < 5.00000000000000004e-51Initial program 81.4%
Taylor expanded in a around 0 81.4%
tan-sum99.8%
div-inv99.8%
Applied egg-rr99.8%
if 5.00000000000000004e-51 < (tan.f64 a) Initial program 77.9%
+-commutative77.9%
sub-neg77.9%
associate-+l+78.0%
tan-quot78.0%
div-inv77.9%
fma-define77.9%
neg-mul-177.9%
fma-define77.9%
Applied egg-rr77.9%
fma-undefine77.9%
neg-mul-177.9%
neg-sub077.9%
associate-+l-77.9%
neg-sub077.9%
fmm-undef77.9%
associate-*r/78.0%
*-rgt-identity78.0%
Simplified78.0%
Final simplification89.3%
(FPCore (x y z a)
:precision binary64
(if (<= (tan a) -0.01)
(+ x (- (tan (+ y z)) (tan a)))
(if (<= (tan a) 5e-51)
(- x (+ a (/ (+ (tan y) (tan z)) (+ (* (tan y) (tan z)) -1.0))))
(+ (/ (sin (+ y z)) (cos (+ y z))) (- x (tan a))))))
double code(double x, double y, double z, double a) {
double tmp;
if (tan(a) <= -0.01) {
tmp = x + (tan((y + z)) - tan(a));
} else if (tan(a) <= 5e-51) {
tmp = x - (a + ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + -1.0)));
} else {
tmp = (sin((y + z)) / cos((y + z))) + (x - tan(a));
}
return tmp;
}
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
real(8) :: tmp
if (tan(a) <= (-0.01d0)) then
tmp = x + (tan((y + z)) - tan(a))
else if (tan(a) <= 5d-51) then
tmp = x - (a + ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + (-1.0d0))))
else
tmp = (sin((y + z)) / cos((y + z))) + (x - tan(a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (Math.tan(a) <= -0.01) {
tmp = x + (Math.tan((y + z)) - Math.tan(a));
} else if (Math.tan(a) <= 5e-51) {
tmp = x - (a + ((Math.tan(y) + Math.tan(z)) / ((Math.tan(y) * Math.tan(z)) + -1.0)));
} else {
tmp = (Math.sin((y + z)) / Math.cos((y + z))) + (x - Math.tan(a));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if math.tan(a) <= -0.01: tmp = x + (math.tan((y + z)) - math.tan(a)) elif math.tan(a) <= 5e-51: tmp = x - (a + ((math.tan(y) + math.tan(z)) / ((math.tan(y) * math.tan(z)) + -1.0))) else: tmp = (math.sin((y + z)) / math.cos((y + z))) + (x - math.tan(a)) return tmp
function code(x, y, z, a) tmp = 0.0 if (tan(a) <= -0.01) tmp = Float64(x + Float64(tan(Float64(y + z)) - tan(a))); elseif (tan(a) <= 5e-51) tmp = Float64(x - Float64(a + Float64(Float64(tan(y) + tan(z)) / Float64(Float64(tan(y) * tan(z)) + -1.0)))); else tmp = Float64(Float64(sin(Float64(y + z)) / cos(Float64(y + z))) + Float64(x - tan(a))); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (tan(a) <= -0.01) tmp = x + (tan((y + z)) - tan(a)); elseif (tan(a) <= 5e-51) tmp = x - (a + ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + -1.0))); else tmp = (sin((y + z)) / cos((y + z))) + (x - tan(a)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[N[Tan[a], $MachinePrecision], -0.01], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-51], N[(x - N[(a + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\tan a \leq -0.01:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - \tan a\right)\\
\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-51}:\\
\;\;\;\;x - \left(a + \frac{\tan y + \tan z}{\tan y \cdot \tan z + -1}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} + \left(x - \tan a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0100000000000000002Initial program 83.6%
if -0.0100000000000000002 < (tan.f64 a) < 5.00000000000000004e-51Initial program 81.4%
Taylor expanded in a around 0 81.4%
tan-sum99.8%
div-inv99.8%
fmm-def99.8%
Applied egg-rr99.8%
fmm-undef99.8%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
if 5.00000000000000004e-51 < (tan.f64 a) Initial program 77.9%
+-commutative77.9%
sub-neg77.9%
associate-+l+78.0%
tan-quot78.0%
div-inv77.9%
fma-define77.9%
neg-mul-177.9%
fma-define77.9%
Applied egg-rr77.9%
fma-undefine77.9%
neg-mul-177.9%
neg-sub077.9%
associate-+l-77.9%
neg-sub077.9%
fmm-undef77.9%
associate-*r/78.0%
*-rgt-identity78.0%
Simplified78.0%
Final simplification89.3%
(FPCore (x y z a) :precision binary64 (- (- x (tan a)) (/ (+ (tan y) (tan z)) (+ (* (tan y) (tan z)) -1.0))))
double code(double x, double y, double z, double a) {
return (x - tan(a)) - ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + -1.0));
}
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(a)) - ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + (-1.0d0)))
end function
public static double code(double x, double y, double z, double a) {
return (x - Math.tan(a)) - ((Math.tan(y) + Math.tan(z)) / ((Math.tan(y) * Math.tan(z)) + -1.0));
}
def code(x, y, z, a): return (x - math.tan(a)) - ((math.tan(y) + math.tan(z)) / ((math.tan(y) * math.tan(z)) + -1.0))
function code(x, y, z, a) return Float64(Float64(x - tan(a)) - Float64(Float64(tan(y) + tan(z)) / Float64(Float64(tan(y) * tan(z)) + -1.0))) end
function tmp = code(x, y, z, a) tmp = (x - tan(a)) - ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + -1.0)); end
code[x_, y_, z_, a_] := N[(N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \tan a\right) - \frac{\tan y + \tan z}{\tan y \cdot \tan z + -1}
\end{array}
Initial program 81.1%
+-commutative81.1%
associate-+l-81.1%
tan-sum99.7%
div-inv99.6%
fmm-def99.7%
Applied egg-rr99.7%
fmm-undef99.6%
add-cube-cbrt97.9%
prod-diff97.9%
pow297.9%
Applied egg-rr97.9%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Final simplification99.7%
(FPCore (x y z a) :precision binary64 (- x (+ (tan a) (/ (+ (tan y) (tan z)) (+ (* (tan y) (tan z)) -1.0)))))
double code(double x, double y, double z, double a) {
return x - (tan(a) + ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + -1.0)));
}
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(a) + ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + (-1.0d0))))
end function
public static double code(double x, double y, double z, double a) {
return x - (Math.tan(a) + ((Math.tan(y) + Math.tan(z)) / ((Math.tan(y) * Math.tan(z)) + -1.0)));
}
def code(x, y, z, a): return x - (math.tan(a) + ((math.tan(y) + math.tan(z)) / ((math.tan(y) * math.tan(z)) + -1.0)))
function code(x, y, z, a) return Float64(x - Float64(tan(a) + Float64(Float64(tan(y) + tan(z)) / Float64(Float64(tan(y) * tan(z)) + -1.0)))) end
function tmp = code(x, y, z, a) tmp = x - (tan(a) + ((tan(y) + tan(z)) / ((tan(y) * tan(z)) + -1.0))); end
code[x_, y_, z_, a_] := N[(x - N[(N[Tan[a], $MachinePrecision] + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(\tan a + \frac{\tan y + \tan z}{\tan y \cdot \tan z + -1}\right)
\end{array}
Initial program 81.1%
+-commutative81.1%
sub-neg81.1%
associate-+l+81.1%
tan-sum99.7%
div-inv99.6%
fma-define99.7%
neg-mul-199.7%
fma-define99.7%
Applied egg-rr99.7%
fma-undefine99.6%
fma-undefine99.6%
neg-mul-199.6%
associate-+r+99.6%
sub-neg99.6%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z a) :precision binary64 (if (or (<= (tan a) -0.01) (not (<= (tan a) 1e-12))) (+ x (- (tan y) (tan a))) (+ x (- (tan (+ y z)) a))))
double code(double x, double y, double z, double a) {
double tmp;
if ((tan(a) <= -0.01) || !(tan(a) <= 1e-12)) {
tmp = x + (tan(y) - tan(a));
} else {
tmp = x + (tan((y + z)) - a);
}
return tmp;
}
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
real(8) :: tmp
if ((tan(a) <= (-0.01d0)) .or. (.not. (tan(a) <= 1d-12))) then
tmp = x + (tan(y) - tan(a))
else
tmp = x + (tan((y + z)) - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if ((Math.tan(a) <= -0.01) || !(Math.tan(a) <= 1e-12)) {
tmp = x + (Math.tan(y) - Math.tan(a));
} else {
tmp = x + (Math.tan((y + z)) - a);
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if (math.tan(a) <= -0.01) or not (math.tan(a) <= 1e-12): tmp = x + (math.tan(y) - math.tan(a)) else: tmp = x + (math.tan((y + z)) - a) return tmp
function code(x, y, z, a) tmp = 0.0 if ((tan(a) <= -0.01) || !(tan(a) <= 1e-12)) tmp = Float64(x + Float64(tan(y) - tan(a))); else tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if ((tan(a) <= -0.01) || ~((tan(a) <= 1e-12))) tmp = x + (tan(y) - tan(a)); else tmp = x + (tan((y + z)) - a); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[Or[LessEqual[N[Tan[a], $MachinePrecision], -0.01], N[Not[LessEqual[N[Tan[a], $MachinePrecision], 1e-12]], $MachinePrecision]], N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\tan a \leq -0.01 \lor \neg \left(\tan a \leq 10^{-12}\right):\\
\;\;\;\;x + \left(\tan y - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\end{array}
\end{array}
if (tan.f64 a) < -0.0100000000000000002 or 9.9999999999999998e-13 < (tan.f64 a) Initial program 80.4%
Taylor expanded in y around inf 63.9%
if -0.0100000000000000002 < (tan.f64 a) < 9.9999999999999998e-13Initial program 81.9%
Taylor expanded in a around 0 81.9%
Final simplification72.1%
(FPCore (x y z a) :precision binary64 (log (exp (+ (tan (+ y z)) (- x (tan a))))))
double code(double x, double y, double z, double a) {
return log(exp((tan((y + z)) + (x - 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 = log(exp((tan((y + z)) + (x - tan(a)))))
end function
public static double code(double x, double y, double z, double a) {
return Math.log(Math.exp((Math.tan((y + z)) + (x - Math.tan(a)))));
}
def code(x, y, z, a): return math.log(math.exp((math.tan((y + z)) + (x - math.tan(a)))))
function code(x, y, z, a) return log(exp(Float64(tan(Float64(y + z)) + Float64(x - tan(a))))) end
function tmp = code(x, y, z, a) tmp = log(exp((tan((y + z)) + (x - tan(a))))); end
code[x_, y_, z_, a_] := N[Log[N[Exp[N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\log \left(e^{\tan \left(y + z\right) + \left(x - \tan a\right)}\right)
\end{array}
Initial program 81.1%
add-log-exp81.1%
+-commutative81.1%
associate-+l-81.1%
Applied egg-rr81.1%
Final simplification81.1%
(FPCore (x y z a) :precision binary64 (if (<= a -1.4) (pow (pow x 3.0) 0.3333333333333333) (if (<= a 1.56) (+ x (- (tan (+ y z)) a)) (exp (log x)))))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.4) {
tmp = pow(pow(x, 3.0), 0.3333333333333333);
} else if (a <= 1.56) {
tmp = x + (tan((y + z)) - a);
} else {
tmp = exp(log(x));
}
return tmp;
}
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
real(8) :: tmp
if (a <= (-1.4d0)) then
tmp = (x ** 3.0d0) ** 0.3333333333333333d0
else if (a <= 1.56d0) then
tmp = x + (tan((y + z)) - a)
else
tmp = exp(log(x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.4) {
tmp = Math.pow(Math.pow(x, 3.0), 0.3333333333333333);
} else if (a <= 1.56) {
tmp = x + (Math.tan((y + z)) - a);
} else {
tmp = Math.exp(Math.log(x));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.4: tmp = math.pow(math.pow(x, 3.0), 0.3333333333333333) elif a <= 1.56: tmp = x + (math.tan((y + z)) - a) else: tmp = math.exp(math.log(x)) return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.4) tmp = (x ^ 3.0) ^ 0.3333333333333333; elseif (a <= 1.56) tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); else tmp = exp(log(x)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (a <= -1.4) tmp = (x ^ 3.0) ^ 0.3333333333333333; elseif (a <= 1.56) tmp = x + (tan((y + z)) - a); else tmp = exp(log(x)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.4], N[Power[N[Power[x, 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], If[LessEqual[a, 1.56], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[x], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4:\\
\;\;\;\;{\left({x}^{3}\right)}^{0.3333333333333333}\\
\mathbf{elif}\;a \leq 1.56:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log x}\\
\end{array}
\end{array}
if a < -1.3999999999999999Initial program 82.9%
add-cbrt-cube82.5%
pow1/371.4%
pow371.4%
+-commutative71.4%
associate-+l-71.4%
Applied egg-rr71.4%
Taylor expanded in x around inf 20.9%
if -1.3999999999999999 < a < 1.5600000000000001Initial program 81.9%
Taylor expanded in a around 0 81.9%
if 1.5600000000000001 < a Initial program 77.7%
add-cbrt-cube77.3%
pow1/367.7%
pow367.7%
+-commutative67.7%
associate-+l-67.7%
Applied egg-rr67.7%
add-exp-log67.9%
log-pow67.6%
associate--r-67.6%
pow167.6%
metadata-eval67.6%
sqrt-pow150.5%
+-commutative50.5%
sqrt-pow167.6%
metadata-eval67.6%
pow167.6%
Applied egg-rr67.6%
Taylor expanded in x around inf 20.7%
mul-1-neg20.7%
log-rec20.7%
remove-double-neg20.7%
Simplified20.7%
*-commutative20.7%
pow-to-exp20.7%
pow320.7%
pow1/320.7%
add-cbrt-cube20.7%
add-exp-log20.7%
Applied egg-rr20.7%
(FPCore (x y z a) :precision binary64 (if (<= a -1.5) (expm1 (log1p x)) (if (<= a 1.3) (+ x (- (tan (+ y z)) a)) (exp (log x)))))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.5) {
tmp = expm1(log1p(x));
} else if (a <= 1.3) {
tmp = x + (tan((y + z)) - a);
} else {
tmp = exp(log(x));
}
return tmp;
}
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.5) {
tmp = Math.expm1(Math.log1p(x));
} else if (a <= 1.3) {
tmp = x + (Math.tan((y + z)) - a);
} else {
tmp = Math.exp(Math.log(x));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.5: tmp = math.expm1(math.log1p(x)) elif a <= 1.3: tmp = x + (math.tan((y + z)) - a) else: tmp = math.exp(math.log(x)) return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.5) tmp = expm1(log1p(x)); elseif (a <= 1.3) tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); else tmp = exp(log(x)); end return tmp end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.5], N[(Exp[N[Log[1 + x], $MachinePrecision]] - 1), $MachinePrecision], If[LessEqual[a, 1.3], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[x], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)\\
\mathbf{elif}\;a \leq 1.3:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log x}\\
\end{array}
\end{array}
if a < -1.5Initial program 82.9%
add-cbrt-cube82.5%
pow1/371.4%
pow371.4%
+-commutative71.4%
associate-+l-71.4%
Applied egg-rr71.4%
add-exp-log71.5%
log-pow71.2%
associate--r-71.2%
pow171.2%
metadata-eval71.2%
sqrt-pow157.1%
+-commutative57.1%
sqrt-pow171.2%
metadata-eval71.2%
pow171.2%
Applied egg-rr71.2%
Taylor expanded in x around inf 20.9%
mul-1-neg20.9%
log-rec20.9%
remove-double-neg20.9%
Simplified20.9%
*-commutative20.9%
pow-to-exp20.9%
pow320.9%
pow1/320.9%
expm1-log1p-u20.9%
add-cbrt-cube20.9%
expm1-undefine20.9%
Applied egg-rr20.9%
expm1-define20.9%
Simplified20.9%
if -1.5 < a < 1.30000000000000004Initial program 81.9%
Taylor expanded in a around 0 81.9%
if 1.30000000000000004 < a Initial program 77.7%
add-cbrt-cube77.3%
pow1/367.7%
pow367.7%
+-commutative67.7%
associate-+l-67.7%
Applied egg-rr67.7%
add-exp-log67.9%
log-pow67.6%
associate--r-67.6%
pow167.6%
metadata-eval67.6%
sqrt-pow150.5%
+-commutative50.5%
sqrt-pow167.6%
metadata-eval67.6%
pow167.6%
Applied egg-rr67.6%
Taylor expanded in x around inf 20.7%
mul-1-neg20.7%
log-rec20.7%
remove-double-neg20.7%
Simplified20.7%
*-commutative20.7%
pow-to-exp20.7%
pow320.7%
pow1/320.7%
add-cbrt-cube20.7%
add-exp-log20.7%
Applied egg-rr20.7%
(FPCore (x y z a) :precision binary64 (if (<= a -1.6) x (if (<= a 7.8) (+ x (- (tan (+ y z)) a)) (exp (log x)))))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.6) {
tmp = x;
} else if (a <= 7.8) {
tmp = x + (tan((y + z)) - a);
} else {
tmp = exp(log(x));
}
return tmp;
}
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
real(8) :: tmp
if (a <= (-1.6d0)) then
tmp = x
else if (a <= 7.8d0) then
tmp = x + (tan((y + z)) - a)
else
tmp = exp(log(x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.6) {
tmp = x;
} else if (a <= 7.8) {
tmp = x + (Math.tan((y + z)) - a);
} else {
tmp = Math.exp(Math.log(x));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.6: tmp = x elif a <= 7.8: tmp = x + (math.tan((y + z)) - a) else: tmp = math.exp(math.log(x)) return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.6) tmp = x; elseif (a <= 7.8) tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); else tmp = exp(log(x)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (a <= -1.6) tmp = x; elseif (a <= 7.8) tmp = x + (tan((y + z)) - a); else tmp = exp(log(x)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.6], x, If[LessEqual[a, 7.8], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[x], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7.8:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log x}\\
\end{array}
\end{array}
if a < -1.6000000000000001Initial program 82.9%
Taylor expanded in x around inf 20.9%
if -1.6000000000000001 < a < 7.79999999999999982Initial program 81.9%
Taylor expanded in a around 0 81.9%
if 7.79999999999999982 < a Initial program 77.7%
add-cbrt-cube77.3%
pow1/367.7%
pow367.7%
+-commutative67.7%
associate-+l-67.7%
Applied egg-rr67.7%
add-exp-log67.9%
log-pow67.6%
associate--r-67.6%
pow167.6%
metadata-eval67.6%
sqrt-pow150.5%
+-commutative50.5%
sqrt-pow167.6%
metadata-eval67.6%
pow167.6%
Applied egg-rr67.6%
Taylor expanded in x around inf 20.7%
mul-1-neg20.7%
log-rec20.7%
remove-double-neg20.7%
Simplified20.7%
*-commutative20.7%
pow-to-exp20.7%
pow320.7%
pow1/320.7%
add-cbrt-cube20.7%
add-exp-log20.7%
Applied egg-rr20.7%
(FPCore (x y z a) :precision binary64 (if (<= z 1.55e-7) (- (+ (tan y) x) (tan a)) (+ x (- (tan z) (tan a)))))
double code(double x, double y, double z, double a) {
double tmp;
if (z <= 1.55e-7) {
tmp = (tan(y) + x) - tan(a);
} else {
tmp = x + (tan(z) - tan(a));
}
return tmp;
}
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
real(8) :: tmp
if (z <= 1.55d-7) then
tmp = (tan(y) + x) - tan(a)
else
tmp = x + (tan(z) - tan(a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (z <= 1.55e-7) {
tmp = (Math.tan(y) + x) - Math.tan(a);
} else {
tmp = x + (Math.tan(z) - Math.tan(a));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if z <= 1.55e-7: tmp = (math.tan(y) + x) - math.tan(a) else: tmp = x + (math.tan(z) - math.tan(a)) return tmp
function code(x, y, z, a) tmp = 0.0 if (z <= 1.55e-7) tmp = Float64(Float64(tan(y) + x) - tan(a)); else tmp = Float64(x + Float64(tan(z) - tan(a))); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (z <= 1.55e-7) tmp = (tan(y) + x) - tan(a); else tmp = x + (tan(z) - tan(a)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[z, 1.55e-7], N[(N[(N[Tan[y], $MachinePrecision] + x), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.55 \cdot 10^{-7}:\\
\;\;\;\;\left(\tan y + x\right) - \tan a\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - \tan a\right)\\
\end{array}
\end{array}
if z < 1.55e-7Initial program 87.9%
Taylor expanded in a around inf 87.9%
Taylor expanded in y around inf 74.9%
tan-quot74.9%
associate-+r-74.9%
Applied egg-rr74.9%
if 1.55e-7 < z Initial program 60.0%
Taylor expanded in y around 0 60.0%
Final simplification71.3%
(FPCore (x y z a) :precision binary64 (if (<= z 1.8e-7) (+ x (- (tan y) (tan a))) (+ x (- (tan z) (tan a)))))
double code(double x, double y, double z, double a) {
double tmp;
if (z <= 1.8e-7) {
tmp = x + (tan(y) - tan(a));
} else {
tmp = x + (tan(z) - tan(a));
}
return tmp;
}
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
real(8) :: tmp
if (z <= 1.8d-7) then
tmp = x + (tan(y) - tan(a))
else
tmp = x + (tan(z) - tan(a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (z <= 1.8e-7) {
tmp = x + (Math.tan(y) - Math.tan(a));
} else {
tmp = x + (Math.tan(z) - Math.tan(a));
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if z <= 1.8e-7: tmp = x + (math.tan(y) - math.tan(a)) else: tmp = x + (math.tan(z) - math.tan(a)) return tmp
function code(x, y, z, a) tmp = 0.0 if (z <= 1.8e-7) tmp = Float64(x + Float64(tan(y) - tan(a))); else tmp = Float64(x + Float64(tan(z) - tan(a))); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (z <= 1.8e-7) tmp = x + (tan(y) - tan(a)); else tmp = x + (tan(z) - tan(a)); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[z, 1.8e-7], N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;x + \left(\tan y - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - \tan a\right)\\
\end{array}
\end{array}
if z < 1.79999999999999997e-7Initial program 87.9%
Taylor expanded in y around inf 74.9%
if 1.79999999999999997e-7 < z Initial program 60.0%
Taylor expanded in y around 0 60.0%
(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 81.1%
(FPCore (x y z a) :precision binary64 (if (<= a -1.35) x (if (<= a 1.56) (+ x (- (tan (+ y z)) a)) x)))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.35) {
tmp = x;
} else if (a <= 1.56) {
tmp = x + (tan((y + z)) - a);
} else {
tmp = x;
}
return tmp;
}
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
real(8) :: tmp
if (a <= (-1.35d0)) then
tmp = x
else if (a <= 1.56d0) then
tmp = x + (tan((y + z)) - a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.35) {
tmp = x;
} else if (a <= 1.56) {
tmp = x + (Math.tan((y + z)) - a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.35: tmp = x elif a <= 1.56: tmp = x + (math.tan((y + z)) - a) else: tmp = x return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.35) tmp = x; elseif (a <= 1.56) tmp = Float64(x + Float64(tan(Float64(y + z)) - a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (a <= -1.35) tmp = x; elseif (a <= 1.56) tmp = x + (tan((y + z)) - a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.35], x, If[LessEqual[a, 1.56], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.56:\\
\;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.3500000000000001 or 1.5600000000000001 < a Initial program 80.4%
Taylor expanded in x around inf 20.8%
if -1.3500000000000001 < a < 1.5600000000000001Initial program 81.9%
Taylor expanded in a around 0 81.9%
(FPCore (x y z a) :precision binary64 (if (<= a -1.35e-5) x (if (<= a 5.7e-46) (+ x (- (tan y) a)) x)))
double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.35e-5) {
tmp = x;
} else if (a <= 5.7e-46) {
tmp = x + (tan(y) - a);
} else {
tmp = x;
}
return tmp;
}
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
real(8) :: tmp
if (a <= (-1.35d-5)) then
tmp = x
else if (a <= 5.7d-46) then
tmp = x + (tan(y) - a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (a <= -1.35e-5) {
tmp = x;
} else if (a <= 5.7e-46) {
tmp = x + (Math.tan(y) - a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if a <= -1.35e-5: tmp = x elif a <= 5.7e-46: tmp = x + (math.tan(y) - a) else: tmp = x return tmp
function code(x, y, z, a) tmp = 0.0 if (a <= -1.35e-5) tmp = x; elseif (a <= 5.7e-46) tmp = Float64(x + Float64(tan(y) - a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (a <= -1.35e-5) tmp = x; elseif (a <= 5.7e-46) tmp = x + (tan(y) - a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[a, -1.35e-5], x, If[LessEqual[a, 5.7e-46], N[(x + N[(N[Tan[y], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.7 \cdot 10^{-46}:\\
\;\;\;\;x + \left(\tan y - a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.3499999999999999e-5 or 5.7000000000000003e-46 < a Initial program 80.9%
Taylor expanded in x around inf 20.8%
if -1.3499999999999999e-5 < a < 5.7000000000000003e-46Initial program 81.2%
Taylor expanded in a around 0 81.2%
Taylor expanded in y around inf 59.4%
(FPCore (x y z a) :precision binary64 (if (<= z 3.6e-7) (+ x (- (tan y) a)) (+ x (- (tan z) a))))
double code(double x, double y, double z, double a) {
double tmp;
if (z <= 3.6e-7) {
tmp = x + (tan(y) - a);
} else {
tmp = x + (tan(z) - a);
}
return tmp;
}
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
real(8) :: tmp
if (z <= 3.6d-7) then
tmp = x + (tan(y) - a)
else
tmp = x + (tan(z) - a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double a) {
double tmp;
if (z <= 3.6e-7) {
tmp = x + (Math.tan(y) - a);
} else {
tmp = x + (Math.tan(z) - a);
}
return tmp;
}
def code(x, y, z, a): tmp = 0 if z <= 3.6e-7: tmp = x + (math.tan(y) - a) else: tmp = x + (math.tan(z) - a) return tmp
function code(x, y, z, a) tmp = 0.0 if (z <= 3.6e-7) tmp = Float64(x + Float64(tan(y) - a)); else tmp = Float64(x + Float64(tan(z) - a)); end return tmp end
function tmp_2 = code(x, y, z, a) tmp = 0.0; if (z <= 3.6e-7) tmp = x + (tan(y) - a); else tmp = x + (tan(z) - a); end tmp_2 = tmp; end
code[x_, y_, z_, a_] := If[LessEqual[z, 3.6e-7], N[(x + N[(N[Tan[y], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.6 \cdot 10^{-7}:\\
\;\;\;\;x + \left(\tan y - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - a\right)\\
\end{array}
\end{array}
if z < 3.59999999999999994e-7Initial program 87.9%
Taylor expanded in a around 0 42.0%
Taylor expanded in y around inf 34.4%
if 3.59999999999999994e-7 < z Initial program 60.0%
Taylor expanded in a around 0 29.6%
Taylor expanded in y around 0 29.6%
(FPCore (x y z a) :precision binary64 x)
double code(double x, double y, double z, double a) {
return 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 = x
end function
public static double code(double x, double y, double z, double a) {
return x;
}
def code(x, y, z, a): return x
function code(x, y, z, a) return x end
function tmp = code(x, y, z, a) tmp = x; end
code[x_, y_, z_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 81.1%
Taylor expanded in x around inf 28.9%
herbie shell --seed 2024191
(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))))