
(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 21 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}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (* (/ 1.0 (- 1.0 (/ (* (tan z) (sin y)) (cos y)))) (+ (tan z) (tan y))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((1.0 / (1.0 - ((tan(z) * sin(y)) / cos(y)))) * (tan(z) + tan(y))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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 + (((1.0d0 / (1.0d0 - ((tan(z) * sin(y)) / cos(y)))) * (tan(z) + tan(y))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((1.0 / (1.0 - ((Math.tan(z) * Math.sin(y)) / Math.cos(y)))) * (Math.tan(z) + Math.tan(y))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((1.0 / (1.0 - ((math.tan(z) * math.sin(y)) / math.cos(y)))) * (math.tan(z) + math.tan(y))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(1.0 / Float64(1.0 - Float64(Float64(tan(z) * sin(y)) / cos(y)))) * Float64(tan(z) + tan(y))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((1.0 / (1.0 - ((tan(z) * sin(y)) / cos(y)))) * (tan(z) + tan(y))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(1.0 / N[(1.0 - N[(N[(N[Tan[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{1}{1 - \frac{\tan z \cdot \sin y}{\cos y}} \cdot \left(\tan z + \tan y\right) - \tan a\right)
\end{array}
Initial program 80.7%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (* (+ (tan z) (tan y)) (/ 1.0 (+ 1.0 (/ 1.0 (/ (/ -1.0 (tan y)) (tan z)))))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((tan(z) + tan(y)) * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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(z) + tan(y)) * (1.0d0 / (1.0d0 + (1.0d0 / (((-1.0d0) / tan(y)) / tan(z)))))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(z) + Math.tan(y)) * (1.0 / (1.0 + (1.0 / ((-1.0 / Math.tan(y)) / Math.tan(z)))))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((math.tan(z) + math.tan(y)) * (1.0 / (1.0 + (1.0 / ((-1.0 / math.tan(y)) / math.tan(z)))))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(z) + tan(y)) * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(-1.0 / tan(y)) / tan(z)))))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((tan(z) + tan(y)) * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\left(\tan z + \tan y\right) \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1}{\tan y}}{\tan z}}} - \tan a\right)
\end{array}
Initial program 80.7%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (* (+ (tan z) (tan y)) (/ 1.0 (- 1.0 (* (tan z) (tan y))))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((tan(z) + tan(y)) * (1.0 / (1.0 - (tan(z) * tan(y))))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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(z) + tan(y)) * (1.0d0 / (1.0d0 - (tan(z) * tan(y))))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(z) + Math.tan(y)) * (1.0 / (1.0 - (Math.tan(z) * Math.tan(y))))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((math.tan(z) + math.tan(y)) * (1.0 / (1.0 - (math.tan(z) * math.tan(y))))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(z) + tan(y)) * Float64(1.0 / Float64(1.0 - Float64(tan(z) * tan(y))))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((tan(z) + tan(y)) * (1.0 / (1.0 - (tan(z) * tan(y))))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 - N[(N[Tan[z], $MachinePrecision] * N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\left(\tan z + \tan y\right) \cdot \frac{1}{1 - \tan z \cdot \tan y} - \tan a\right)
\end{array}
Initial program 80.7%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (/ (+ (tan z) (tan y)) (- 1.0 (* (tan z) (tan y)))) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (((tan(z) + tan(y)) / (1.0 - (tan(z) * tan(y)))) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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(z) + tan(y)) / (1.0d0 - (tan(z) * tan(y)))) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (((Math.tan(z) + Math.tan(y)) / (1.0 - (Math.tan(z) * Math.tan(y)))) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (((math.tan(z) + math.tan(y)) / (1.0 - (math.tan(z) * math.tan(y)))) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(Float64(tan(z) + tan(y)) / Float64(1.0 - Float64(tan(z) * tan(y)))) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (((tan(z) + tan(y)) / (1.0 - (tan(z) * tan(y)))) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[z], $MachinePrecision] * N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{\tan z + \tan y}{1 - \tan z \cdot \tan y} - \tan a\right)
\end{array}
Initial program 80.7%
tan-sumN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Final simplification99.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan z) (tan y))))
(if (<= a -0.1)
(+
x
(-
(*
t_0
(/
1.0
(+
1.0
(/ 1.0 (/ (/ (- -1.0 (* -0.3333333333333333 (* y y))) y) (tan z))))))
(tan a)))
(if (<= a 0.44)
(+
x
(+
(* t_0 (/ 1.0 (+ 1.0 (/ 1.0 (/ (/ -1.0 (tan y)) (tan z))))))
(*
a
(-
-1.0
(*
(* a a)
(+
0.3333333333333333
(*
(* a a)
(+ 0.13333333333333333 (* (* a a) 0.05396825396825397)))))))))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(z) + tan(y);
double tmp;
if (a <= -0.1) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = tan(z) + tan(y)
if (a <= (-0.1d0)) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / ((((-1.0d0) - ((-0.3333333333333333d0) * (y * y))) / y) / tan(z)))))) - tan(a))
else if (a <= 0.44d0) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / (((-1.0d0) / tan(y)) / tan(z)))))) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * (0.13333333333333333d0 + ((a * a) * 0.05396825396825397d0))))))))
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(z) + Math.tan(y);
double tmp;
if (a <= -0.1) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / Math.tan(z)))))) - Math.tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / Math.tan(y)) / Math.tan(z)))))) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(z) + math.tan(y) tmp = 0 if a <= -0.1: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / math.tan(z)))))) - math.tan(a)) elif a <= 0.44: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / math.tan(y)) / math.tan(z)))))) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397)))))))) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(z) + tan(y)) tmp = 0.0 if (a <= -0.1) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(y * y))) / y) / tan(z)))))) - tan(a))); elseif (a <= 0.44) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(-1.0 / tan(y)) / tan(z)))))) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * Float64(0.13333333333333333 + Float64(Float64(a * a) * 0.05396825396825397))))))))); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(z) + tan(y);
tmp = 0.0;
if (a <= -0.1)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
elseif (a <= 0.44)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.1], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(N[(-1.0 - N[(-0.3333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.44], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * N[(0.13333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.05396825396825397), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan z + \tan y\\
\mathbf{if}\;a \leq -0.1:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1 - -0.3333333333333333 \cdot \left(y \cdot y\right)}{y}}{\tan z}}} - \tan a\right)\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1}{\tan y}}{\tan z}}} + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\end{array}
\end{array}
if a < -0.10000000000000001Initial program 81.3%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.2%
Simplified83.2%
if -0.10000000000000001 < a < 0.440000000000000002Initial program 80.8%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.4%
Simplified99.4%
if 0.440000000000000002 < a Initial program 79.6%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
Simplified80.1%
Final simplification91.4%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan z) (tan y))))
(if (<= a -0.07)
(+
x
(-
(*
t_0
(/
1.0
(+
1.0
(/ 1.0 (/ (/ (- -1.0 (* -0.3333333333333333 (* y y))) y) (tan z))))))
(tan a)))
(if (<= a 0.44)
(+
x
(+
(* t_0 (/ 1.0 (+ 1.0 (/ 1.0 (/ (/ -1.0 (tan y)) (tan z))))))
(*
a
(-
-1.0
(*
a
(* a (+ 0.3333333333333333 (* (* a a) 0.13333333333333333))))))))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(z) + tan(y);
double tmp;
if (a <= -0.07) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) + (a * (-1.0 - (a * (a * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))));
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = tan(z) + tan(y)
if (a <= (-0.07d0)) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / ((((-1.0d0) - ((-0.3333333333333333d0) * (y * y))) / y) / tan(z)))))) - tan(a))
else if (a <= 0.44d0) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / (((-1.0d0) / tan(y)) / tan(z)))))) + (a * ((-1.0d0) - (a * (a * (0.3333333333333333d0 + ((a * a) * 0.13333333333333333d0)))))))
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(z) + Math.tan(y);
double tmp;
if (a <= -0.07) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / Math.tan(z)))))) - Math.tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / Math.tan(y)) / Math.tan(z)))))) + (a * (-1.0 - (a * (a * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))));
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(z) + math.tan(y) tmp = 0 if a <= -0.07: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / math.tan(z)))))) - math.tan(a)) elif a <= 0.44: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / math.tan(y)) / math.tan(z)))))) + (a * (-1.0 - (a * (a * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))))) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(z) + tan(y)) tmp = 0.0 if (a <= -0.07) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(y * y))) / y) / tan(z)))))) - tan(a))); elseif (a <= 0.44) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(-1.0 / tan(y)) / tan(z)))))) + Float64(a * Float64(-1.0 - Float64(a * Float64(a * Float64(0.3333333333333333 + Float64(Float64(a * a) * 0.13333333333333333)))))))); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(z) + tan(y);
tmp = 0.0;
if (a <= -0.07)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
elseif (a <= 0.44)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) + (a * (-1.0 - (a * (a * (0.3333333333333333 + ((a * a) * 0.13333333333333333)))))));
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.07], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(N[(-1.0 - N[(-0.3333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.44], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(-1.0 - N[(a * N[(a * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.13333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan z + \tan y\\
\mathbf{if}\;a \leq -0.07:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1 - -0.3333333333333333 \cdot \left(y \cdot y\right)}{y}}{\tan z}}} - \tan a\right)\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1}{\tan y}}{\tan z}}} + a \cdot \left(-1 - a \cdot \left(a \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\end{array}
\end{array}
if a < -0.070000000000000007Initial program 81.3%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.2%
Simplified83.2%
if -0.070000000000000007 < a < 0.440000000000000002Initial program 80.8%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.3%
Simplified99.3%
if 0.440000000000000002 < a Initial program 79.6%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
Simplified80.1%
Final simplification91.4%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan z) (tan y))))
(if (<= a -0.0034)
(+
x
(-
(*
t_0
(/
1.0
(+
1.0
(/ 1.0 (/ (/ (- -1.0 (* -0.3333333333333333 (* y y))) y) (tan z))))))
(tan a)))
(if (<= a 0.44)
(+
x
(+
(* t_0 (/ 1.0 (+ 1.0 (/ 1.0 (/ (/ -1.0 (tan y)) (tan z))))))
(* a (- -1.0 (* a (* a 0.3333333333333333))))))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(z) + tan(y);
double tmp;
if (a <= -0.0034) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = tan(z) + tan(y)
if (a <= (-0.0034d0)) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / ((((-1.0d0) - ((-0.3333333333333333d0) * (y * y))) / y) / tan(z)))))) - tan(a))
else if (a <= 0.44d0) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / (((-1.0d0) / tan(y)) / tan(z)))))) + (a * ((-1.0d0) - (a * (a * 0.3333333333333333d0)))))
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(z) + Math.tan(y);
double tmp;
if (a <= -0.0034) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / Math.tan(z)))))) - Math.tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / Math.tan(y)) / Math.tan(z)))))) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(z) + math.tan(y) tmp = 0 if a <= -0.0034: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / math.tan(z)))))) - math.tan(a)) elif a <= 0.44: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / math.tan(y)) / math.tan(z)))))) + (a * (-1.0 - (a * (a * 0.3333333333333333))))) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(z) + tan(y)) tmp = 0.0 if (a <= -0.0034) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(y * y))) / y) / tan(z)))))) - tan(a))); elseif (a <= 0.44) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(-1.0 / tan(y)) / tan(z)))))) + Float64(a * Float64(-1.0 - Float64(a * Float64(a * 0.3333333333333333)))))); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(z) + tan(y);
tmp = 0.0;
if (a <= -0.0034)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
elseif (a <= 0.44)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0034], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(N[(-1.0 - N[(-0.3333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.44], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(-1.0 - N[(a * N[(a * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan z + \tan y\\
\mathbf{if}\;a \leq -0.0034:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1 - -0.3333333333333333 \cdot \left(y \cdot y\right)}{y}}{\tan z}}} - \tan a\right)\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1}{\tan y}}{\tan z}}} + a \cdot \left(-1 - a \cdot \left(a \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\end{array}
\end{array}
if a < -0.00339999999999999981Initial program 81.3%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.2%
Simplified83.2%
if -0.00339999999999999981 < a < 0.440000000000000002Initial program 80.8%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.3%
Simplified99.3%
if 0.440000000000000002 < a Initial program 79.6%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
Simplified80.1%
Final simplification91.4%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan z) (tan y))))
(if (<= a -0.00014)
(+
x
(-
(*
t_0
(/
1.0
(+
1.0
(/ 1.0 (/ (/ (- -1.0 (* -0.3333333333333333 (* y y))) y) (tan z))))))
(tan a)))
(if (<= a 0.44)
(+ x (- (* t_0 (/ 1.0 (+ 1.0 (/ 1.0 (/ (/ -1.0 (tan y)) (tan z)))))) a))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(z) + tan(y);
double tmp;
if (a <= -0.00014) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) - a);
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = tan(z) + tan(y)
if (a <= (-0.00014d0)) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / ((((-1.0d0) - ((-0.3333333333333333d0) * (y * y))) / y) / tan(z)))))) - tan(a))
else if (a <= 0.44d0) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / (((-1.0d0) / tan(y)) / tan(z)))))) - a)
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(z) + Math.tan(y);
double tmp;
if (a <= -0.00014) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / Math.tan(z)))))) - Math.tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / Math.tan(y)) / Math.tan(z)))))) - a);
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(z) + math.tan(y) tmp = 0 if a <= -0.00014: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / math.tan(z)))))) - math.tan(a)) elif a <= 0.44: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / math.tan(y)) / math.tan(z)))))) - a) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(z) + tan(y)) tmp = 0.0 if (a <= -0.00014) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(y * y))) / y) / tan(z)))))) - tan(a))); elseif (a <= 0.44) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(-1.0 / tan(y)) / tan(z)))))) - a)); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(z) + tan(y);
tmp = 0.0;
if (a <= -0.00014)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / (((-1.0 - (-0.3333333333333333 * (y * y))) / y) / tan(z)))))) - tan(a));
elseif (a <= 0.44)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) - a);
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00014], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(N[(-1.0 - N[(-0.3333333333333333 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.44], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan z + \tan y\\
\mathbf{if}\;a \leq -0.00014:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1 - -0.3333333333333333 \cdot \left(y \cdot y\right)}{y}}{\tan z}}} - \tan a\right)\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1}{\tan y}}{\tan z}}} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\end{array}
\end{array}
if a < -1.3999999999999999e-4Initial program 81.9%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.7%
Simplified83.7%
if -1.3999999999999999e-4 < a < 0.440000000000000002Initial program 80.5%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
Simplified99.3%
if 0.440000000000000002 < a Initial program 79.6%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
Simplified80.1%
Final simplification91.4%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan z) (tan y))))
(if (<= a -0.00042)
(+ x (- (tan (+ z y)) (tan a)))
(if (<= a 0.44)
(+ x (- (* t_0 (/ 1.0 (+ 1.0 (/ 1.0 (/ (/ -1.0 (tan y)) (tan z)))))) a))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(z) + tan(y);
double tmp;
if (a <= -0.00042) {
tmp = x + (tan((z + y)) - tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) - a);
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = tan(z) + tan(y)
if (a <= (-0.00042d0)) then
tmp = x + (tan((z + y)) - tan(a))
else if (a <= 0.44d0) then
tmp = x + ((t_0 * (1.0d0 / (1.0d0 + (1.0d0 / (((-1.0d0) / tan(y)) / tan(z)))))) - a)
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(z) + Math.tan(y);
double tmp;
if (a <= -0.00042) {
tmp = x + (Math.tan((z + y)) - Math.tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / Math.tan(y)) / Math.tan(z)))))) - a);
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(z) + math.tan(y) tmp = 0 if a <= -0.00042: tmp = x + (math.tan((z + y)) - math.tan(a)) elif a <= 0.44: tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / math.tan(y)) / math.tan(z)))))) - a) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(z) + tan(y)) tmp = 0.0 if (a <= -0.00042) tmp = Float64(x + Float64(tan(Float64(z + y)) - tan(a))); elseif (a <= 0.44) tmp = Float64(x + Float64(Float64(t_0 * Float64(1.0 / Float64(1.0 + Float64(1.0 / Float64(Float64(-1.0 / tan(y)) / tan(z)))))) - a)); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(z) + tan(y);
tmp = 0.0;
if (a <= -0.00042)
tmp = x + (tan((z + y)) - tan(a));
elseif (a <= 0.44)
tmp = x + ((t_0 * (1.0 / (1.0 + (1.0 / ((-1.0 / tan(y)) / tan(z)))))) - a);
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00042], N[(x + N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.44], N[(x + N[(N[(t$95$0 * N[(1.0 / N[(1.0 + N[(1.0 / N[(N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision] / N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan z + \tan y\\
\mathbf{if}\;a \leq -0.00042:\\
\;\;\;\;x + \left(\tan \left(z + y\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(t\_0 \cdot \frac{1}{1 + \frac{1}{\frac{\frac{-1}{\tan y}}{\tan z}}} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\end{array}
\end{array}
if a < -4.2000000000000002e-4Initial program 81.9%
if -4.2000000000000002e-4 < a < 0.440000000000000002Initial program 80.5%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
*-commutativeN/A
tan-quotN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.8%
Applied egg-rr99.8%
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
clear-numN/A
tan-quotN/A
/-lowering-/.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in a around 0
Simplified99.3%
if 0.440000000000000002 < a Initial program 79.6%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
Simplified80.1%
Final simplification90.9%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ (tan z) (tan y))))
(if (<= a -0.00043)
(+ x (- (tan (+ z y)) (tan a)))
(if (<= a 0.44)
(+ x (- (/ t_0 (- 1.0 (* (tan z) (tan y)))) a))
(+ x (- t_0 (tan a)))))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = tan(z) + tan(y);
double tmp;
if (a <= -0.00043) {
tmp = x + (tan((z + y)) - tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 / (1.0 - (tan(z) * tan(y)))) - a);
} else {
tmp = x + (t_0 - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = tan(z) + tan(y)
if (a <= (-0.00043d0)) then
tmp = x + (tan((z + y)) - tan(a))
else if (a <= 0.44d0) then
tmp = x + ((t_0 / (1.0d0 - (tan(z) * tan(y)))) - a)
else
tmp = x + (t_0 - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = Math.tan(z) + Math.tan(y);
double tmp;
if (a <= -0.00043) {
tmp = x + (Math.tan((z + y)) - Math.tan(a));
} else if (a <= 0.44) {
tmp = x + ((t_0 / (1.0 - (Math.tan(z) * Math.tan(y)))) - a);
} else {
tmp = x + (t_0 - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = math.tan(z) + math.tan(y) tmp = 0 if a <= -0.00043: tmp = x + (math.tan((z + y)) - math.tan(a)) elif a <= 0.44: tmp = x + ((t_0 / (1.0 - (math.tan(z) * math.tan(y)))) - a) else: tmp = x + (t_0 - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(tan(z) + tan(y)) tmp = 0.0 if (a <= -0.00043) tmp = Float64(x + Float64(tan(Float64(z + y)) - tan(a))); elseif (a <= 0.44) tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(z) * tan(y)))) - a)); else tmp = Float64(x + Float64(t_0 - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = tan(z) + tan(y);
tmp = 0.0;
if (a <= -0.00043)
tmp = x + (tan((z + y)) - tan(a));
elseif (a <= 0.44)
tmp = x + ((t_0 / (1.0 - (tan(z) * tan(y)))) - a);
else
tmp = x + (t_0 - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00043], N[(x + N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.44], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[z], $MachinePrecision] * N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan z + \tan y\\
\mathbf{if}\;a \leq -0.00043:\\
\;\;\;\;x + \left(\tan \left(z + y\right) - \tan a\right)\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(\frac{t\_0}{1 - \tan z \cdot \tan y} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t\_0 - \tan a\right)\\
\end{array}
\end{array}
if a < -4.29999999999999989e-4Initial program 81.9%
if -4.29999999999999989e-4 < a < 0.440000000000000002Initial program 80.5%
Taylor expanded in a around 0
Simplified80.5%
tan-sumN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.2%
Applied egg-rr99.2%
if 0.440000000000000002 < a Initial program 79.6%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around 0
Simplified80.1%
Final simplification90.9%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (+ (tan z) (tan y)) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + ((tan(z) + tan(y)) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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(z) + tan(y)) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + ((Math.tan(z) + Math.tan(y)) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + ((math.tan(z) + math.tan(y)) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(Float64(tan(z) + tan(y)) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + ((tan(z) + tan(y)) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[z], $MachinePrecision] + N[Tan[y], $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\left(\tan z + \tan y\right) - \tan a\right)
\end{array}
Initial program 80.7%
tan-sumN/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f64N/A
+-lowering-+.f64N/A
tan-lowering-tan.f64N/A
tan-lowering-tan.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around 0
Simplified81.0%
Final simplification81.0%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ x (- (tan y) (tan a)))))
(if (<= a -0.0106)
t_0
(if (<= a 0.44)
(+ x (+ (tan (+ z y)) (* a (- -1.0 (* a (* a 0.3333333333333333))))))
t_0))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x + (tan(y) - tan(a));
double tmp;
if (a <= -0.0106) {
tmp = t_0;
} else if (a <= 0.44) {
tmp = x + (tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = x + (tan(y) - tan(a))
if (a <= (-0.0106d0)) then
tmp = t_0
else if (a <= 0.44d0) then
tmp = x + (tan((z + y)) + (a * ((-1.0d0) - (a * (a * 0.3333333333333333d0)))))
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x + (Math.tan(y) - Math.tan(a));
double tmp;
if (a <= -0.0106) {
tmp = t_0;
} else if (a <= 0.44) {
tmp = x + (Math.tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x + (math.tan(y) - math.tan(a)) tmp = 0 if a <= -0.0106: tmp = t_0 elif a <= 0.44: tmp = x + (math.tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333))))) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x + Float64(tan(y) - tan(a))) tmp = 0.0 if (a <= -0.0106) tmp = t_0; elseif (a <= 0.44) tmp = Float64(x + Float64(tan(Float64(z + y)) + Float64(a * Float64(-1.0 - Float64(a * Float64(a * 0.3333333333333333)))))); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x + (tan(y) - tan(a));
tmp = 0.0;
if (a <= -0.0106)
tmp = t_0;
elseif (a <= 0.44)
tmp = x + (tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0106], t$95$0, If[LessEqual[a, 0.44], N[(x + N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(a * N[(a * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x + \left(\tan y - \tan a\right)\\
\mathbf{if}\;a \leq -0.0106:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(\tan \left(z + y\right) + a \cdot \left(-1 - a \cdot \left(a \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.0106 or 0.440000000000000002 < a Initial program 80.5%
Taylor expanded in y around inf
Simplified67.3%
if -0.0106 < a < 0.440000000000000002Initial program 80.8%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.8%
Simplified80.8%
Final simplification74.8%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (<= (+ z y) -1e-9) (+ x (- (tan y) (tan a))) (+ x (- (tan z) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if ((z + y) <= -1e-9) {
tmp = x + (tan(y) - tan(a));
} else {
tmp = x + (tan(z) - tan(a));
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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 + y) <= (-1d-9)) then
tmp = x + (tan(y) - tan(a))
else
tmp = x + (tan(z) - tan(a))
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if ((z + y) <= -1e-9) {
tmp = x + (Math.tan(y) - Math.tan(a));
} else {
tmp = x + (Math.tan(z) - Math.tan(a));
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if (z + y) <= -1e-9: tmp = x + (math.tan(y) - math.tan(a)) else: tmp = x + (math.tan(z) - math.tan(a)) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if (Float64(z + y) <= -1e-9) tmp = Float64(x + Float64(tan(y) - tan(a))); else tmp = Float64(x + Float64(tan(z) - tan(a))); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if ((z + y) <= -1e-9)
tmp = x + (tan(y) - tan(a));
else
tmp = x + (tan(z) - tan(a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[LessEqual[N[(z + y), $MachinePrecision], -1e-9], 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}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z + y \leq -1 \cdot 10^{-9}:\\
\;\;\;\;x + \left(\tan y - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - \tan a\right)\\
\end{array}
\end{array}
if (+.f64 y z) < -1.00000000000000006e-9Initial program 74.3%
Taylor expanded in y around inf
Simplified49.9%
if -1.00000000000000006e-9 < (+.f64 y z) Initial program 85.9%
Taylor expanded in y around 0
Simplified66.7%
Final simplification59.1%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (- (tan (+ z y)) (tan a))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + (tan((z + y)) - tan(a));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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((z + y)) - tan(a))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + (Math.tan((z + y)) - Math.tan(a));
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + (math.tan((z + y)) - math.tan(a))
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + Float64(tan(Float64(z + y)) - tan(a))) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + (tan((z + y)) - tan(a));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\tan \left(z + y\right) - \tan a\right)
\end{array}
Initial program 80.7%
Final simplification80.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
:precision binary64
(let* ((t_0 (+ x (- z (tan a)))))
(if (<= a -0.17)
t_0
(if (<= a 0.88)
(+ x (+ (tan (+ z y)) (* a (- -1.0 (* a (* a 0.3333333333333333))))))
t_0))))assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x + (z - tan(a));
double tmp;
if (a <= -0.17) {
tmp = t_0;
} else if (a <= 0.88) {
tmp = x + (tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = x + (z - tan(a))
if (a <= (-0.17d0)) then
tmp = t_0
else if (a <= 0.88d0) then
tmp = x + (tan((z + y)) + (a * ((-1.0d0) - (a * (a * 0.3333333333333333d0)))))
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x + (z - Math.tan(a));
double tmp;
if (a <= -0.17) {
tmp = t_0;
} else if (a <= 0.88) {
tmp = x + (Math.tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x + (z - math.tan(a)) tmp = 0 if a <= -0.17: tmp = t_0 elif a <= 0.88: tmp = x + (math.tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333))))) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x + Float64(z - tan(a))) tmp = 0.0 if (a <= -0.17) tmp = t_0; elseif (a <= 0.88) tmp = Float64(x + Float64(tan(Float64(z + y)) + Float64(a * Float64(-1.0 - Float64(a * Float64(a * 0.3333333333333333)))))); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x + (z - tan(a));
tmp = 0.0;
if (a <= -0.17)
tmp = t_0;
elseif (a <= 0.88)
tmp = x + (tan((z + y)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(z - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.17], t$95$0, If[LessEqual[a, 0.88], N[(x + N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(a * N[(a * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x + \left(z - \tan a\right)\\
\mathbf{if}\;a \leq -0.17:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 0.88:\\
\;\;\;\;x + \left(\tan \left(z + y\right) + a \cdot \left(-1 - a \cdot \left(a \cdot 0.3333333333333333\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -0.170000000000000012 or 0.880000000000000004 < a Initial program 80.5%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6459.4%
Simplified59.4%
Taylor expanded in z around 0
Simplified37.8%
if -0.170000000000000012 < a < 0.880000000000000004Initial program 80.8%
Taylor expanded in a around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.8%
Simplified80.8%
Final simplification61.5%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (let* ((t_0 (+ x (- z (tan a))))) (if (<= a -1.08e+18) t_0 (if (<= a 0.48) (+ x (- (tan (+ z y)) a)) t_0))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x + (z - tan(a));
double tmp;
if (a <= -1.08e+18) {
tmp = t_0;
} else if (a <= 0.48) {
tmp = x + (tan((z + y)) - a);
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = x + (z - tan(a))
if (a <= (-1.08d+18)) then
tmp = t_0
else if (a <= 0.48d0) then
tmp = x + (tan((z + y)) - a)
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x + (z - Math.tan(a));
double tmp;
if (a <= -1.08e+18) {
tmp = t_0;
} else if (a <= 0.48) {
tmp = x + (Math.tan((z + y)) - a);
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x + (z - math.tan(a)) tmp = 0 if a <= -1.08e+18: tmp = t_0 elif a <= 0.48: tmp = x + (math.tan((z + y)) - a) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x + Float64(z - tan(a))) tmp = 0.0 if (a <= -1.08e+18) tmp = t_0; elseif (a <= 0.48) tmp = Float64(x + Float64(tan(Float64(z + y)) - a)); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x + (z - tan(a));
tmp = 0.0;
if (a <= -1.08e+18)
tmp = t_0;
elseif (a <= 0.48)
tmp = x + (tan((z + y)) - a);
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(z - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.08e+18], t$95$0, If[LessEqual[a, 0.48], N[(x + N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x + \left(z - \tan a\right)\\
\mathbf{if}\;a \leq -1.08 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 0.48:\\
\;\;\;\;x + \left(\tan \left(z + y\right) - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.08e18 or 0.47999999999999998 < a Initial program 80.2%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6460.8%
Simplified60.8%
Taylor expanded in z around 0
Simplified39.1%
if -1.08e18 < a < 0.47999999999999998Initial program 81.0%
Taylor expanded in a around 0
Simplified77.4%
Final simplification61.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (<= y -4.2e-8) (+ x (- (tan y) a)) (if (<= y 1.34e-253) (+ x (- z (tan a))) (+ x (- (tan z) a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if (y <= -4.2e-8) {
tmp = x + (tan(y) - a);
} else if (y <= 1.34e-253) {
tmp = x + (z - tan(a));
} else {
tmp = x + (tan(z) - a);
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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 (y <= (-4.2d-8)) then
tmp = x + (tan(y) - a)
else if (y <= 1.34d-253) then
tmp = x + (z - tan(a))
else
tmp = x + (tan(z) - a)
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if (y <= -4.2e-8) {
tmp = x + (Math.tan(y) - a);
} else if (y <= 1.34e-253) {
tmp = x + (z - Math.tan(a));
} else {
tmp = x + (Math.tan(z) - a);
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if y <= -4.2e-8: tmp = x + (math.tan(y) - a) elif y <= 1.34e-253: tmp = x + (z - math.tan(a)) else: tmp = x + (math.tan(z) - a) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if (y <= -4.2e-8) tmp = Float64(x + Float64(tan(y) - a)); elseif (y <= 1.34e-253) tmp = Float64(x + Float64(z - tan(a))); else tmp = Float64(x + Float64(tan(z) - a)); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if (y <= -4.2e-8)
tmp = x + (tan(y) - a);
elseif (y <= 1.34e-253)
tmp = x + (z - tan(a));
else
tmp = x + (tan(z) - a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[LessEqual[y, -4.2e-8], N[(x + N[(N[Tan[y], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.34e-253], N[(x + N[(z - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-8}:\\
\;\;\;\;x + \left(\tan y - a\right)\\
\mathbf{elif}\;y \leq 1.34 \cdot 10^{-253}:\\
\;\;\;\;x + \left(z - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\tan z - a\right)\\
\end{array}
\end{array}
if y < -4.19999999999999989e-8Initial program 63.5%
Taylor expanded in a around 0
Simplified37.4%
Taylor expanded in y around inf
Simplified37.5%
if -4.19999999999999989e-8 < y < 1.34000000000000002e-253Initial program 99.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6499.0%
Simplified99.0%
Taylor expanded in z around 0
Simplified56.3%
if 1.34000000000000002e-253 < y Initial program 80.1%
Taylor expanded in a around 0
Simplified51.2%
Taylor expanded in y around 0
Simplified38.8%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (let* ((t_0 (+ x (- z (tan a))))) (if (<= a -1.08e+18) t_0 (if (<= a 0.44) (+ x (- (tan y) a)) t_0))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double t_0 = x + (z - tan(a));
double tmp;
if (a <= -1.08e+18) {
tmp = t_0;
} else if (a <= 0.44) {
tmp = x + (tan(y) - a);
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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) :: t_0
real(8) :: tmp
t_0 = x + (z - tan(a))
if (a <= (-1.08d+18)) then
tmp = t_0
else if (a <= 0.44d0) then
tmp = x + (tan(y) - a)
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double t_0 = x + (z - Math.tan(a));
double tmp;
if (a <= -1.08e+18) {
tmp = t_0;
} else if (a <= 0.44) {
tmp = x + (Math.tan(y) - a);
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): t_0 = x + (z - math.tan(a)) tmp = 0 if a <= -1.08e+18: tmp = t_0 elif a <= 0.44: tmp = x + (math.tan(y) - a) else: tmp = t_0 return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) t_0 = Float64(x + Float64(z - tan(a))) tmp = 0.0 if (a <= -1.08e+18) tmp = t_0; elseif (a <= 0.44) tmp = Float64(x + Float64(tan(y) - a)); else tmp = t_0; end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
t_0 = x + (z - tan(a));
tmp = 0.0;
if (a <= -1.08e+18)
tmp = t_0;
elseif (a <= 0.44)
tmp = x + (tan(y) - a);
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(z - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.08e+18], t$95$0, If[LessEqual[a, 0.44], N[(x + N[(N[Tan[y], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := x + \left(z - \tan a\right)\\
\mathbf{if}\;a \leq -1.08 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 0.44:\\
\;\;\;\;x + \left(\tan y - a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if a < -1.08e18 or 0.440000000000000002 < a Initial program 80.2%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6460.8%
Simplified60.8%
Taylor expanded in z around 0
Simplified39.1%
if -1.08e18 < a < 0.440000000000000002Initial program 81.0%
Taylor expanded in a around 0
Simplified77.4%
Taylor expanded in y around inf
Simplified59.5%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (if (<= z -5.5e-5) x (if (<= z 3.5e-5) (+ x (- z (tan a))) (+ x (sin z)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
double tmp;
if (z <= -5.5e-5) {
tmp = x;
} else if (z <= 3.5e-5) {
tmp = x + (z - tan(a));
} else {
tmp = x + sin(z);
}
return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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 <= (-5.5d-5)) then
tmp = x
else if (z <= 3.5d-5) then
tmp = x + (z - tan(a))
else
tmp = x + sin(z)
end if
code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
double tmp;
if (z <= -5.5e-5) {
tmp = x;
} else if (z <= 3.5e-5) {
tmp = x + (z - Math.tan(a));
} else {
tmp = x + Math.sin(z);
}
return tmp;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): tmp = 0 if z <= -5.5e-5: tmp = x elif z <= 3.5e-5: tmp = x + (z - math.tan(a)) else: tmp = x + math.sin(z) return tmp
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) tmp = 0.0 if (z <= -5.5e-5) tmp = x; elseif (z <= 3.5e-5) tmp = Float64(x + Float64(z - tan(a))); else tmp = Float64(x + sin(z)); end return tmp end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
tmp = 0.0;
if (z <= -5.5e-5)
tmp = x;
elseif (z <= 3.5e-5)
tmp = x + (z - tan(a));
else
tmp = x + sin(z);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := If[LessEqual[z, -5.5e-5], x, If[LessEqual[z, 3.5e-5], N[(x + N[(z - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Sin[z], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-5}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;x + \left(z - \tan a\right)\\
\mathbf{else}:\\
\;\;\;\;x + \sin z\\
\end{array}
\end{array}
if z < -5.5000000000000002e-5Initial program 60.6%
Taylor expanded in x around inf
Simplified22.8%
if -5.5000000000000002e-5 < z < 3.4999999999999997e-5Initial program 99.6%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6460.2%
Simplified60.2%
Taylor expanded in z around 0
Simplified60.2%
if 3.4999999999999997e-5 < z Initial program 53.3%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6452.5%
Simplified52.5%
Taylor expanded in z around 0
Simplified24.0%
Taylor expanded in a around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6422.8%
Simplified22.8%
Final simplification43.3%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 (+ x (sin z)))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x + sin(z);
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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 + sin(z)
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x + Math.sin(z);
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x + math.sin(z)
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return Float64(x + sin(z)) end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x + sin(z);
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := N[(x + N[Sin[z], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \sin z
\end{array}
Initial program 80.7%
Taylor expanded in y around 0
/-lowering-/.f64N/A
sin-lowering-sin.f64N/A
cos-lowering-cos.f6459.0%
Simplified59.0%
Taylor expanded in z around 0
Simplified44.0%
Taylor expanded in a around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6432.7%
Simplified32.7%
Final simplification32.7%
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. (FPCore (x y z a) :precision binary64 x)
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
return x;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
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
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
return x;
}
[x, y, z, a] = sort([x, y, z, a]) def code(x, y, z, a): return x
x, y, z, a = sort([x, y, z, a]) function code(x, y, z, a) return x end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
tmp = x;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, a_] := x
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x
\end{array}
Initial program 80.7%
Taylor expanded in x around inf
Simplified32.0%
herbie shell --seed 2024141
(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))))