
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
(FPCore (x y z) :precision binary64 (+ (cos y) (fma z (- (sin y)) x)))
double code(double x, double y, double z) {
return cos(y) + fma(z, -sin(y), x);
}
function code(x, y, z) return Float64(cos(y) + fma(z, Float64(-sin(y)), x)) end
code[x_, y_, z_] := N[(N[Cos[y], $MachinePrecision] + N[(z * (-N[Sin[y], $MachinePrecision]) + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos y + \mathsf{fma}\left(z, -\sin y, x\right)
\end{array}
Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(if (or (<= x -9e-7) (not (<= x 3e-11)))
(- (+ x 1.0) t_0)
(- (cos y) t_0))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double tmp;
if ((x <= -9e-7) || !(x <= 3e-11)) {
tmp = (x + 1.0) - t_0;
} else {
tmp = cos(y) - t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * sin(y)
if ((x <= (-9d-7)) .or. (.not. (x <= 3d-11))) then
tmp = (x + 1.0d0) - t_0
else
tmp = cos(y) - t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.sin(y);
double tmp;
if ((x <= -9e-7) || !(x <= 3e-11)) {
tmp = (x + 1.0) - t_0;
} else {
tmp = Math.cos(y) - t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) tmp = 0 if (x <= -9e-7) or not (x <= 3e-11): tmp = (x + 1.0) - t_0 else: tmp = math.cos(y) - t_0 return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) tmp = 0.0 if ((x <= -9e-7) || !(x <= 3e-11)) tmp = Float64(Float64(x + 1.0) - t_0); else tmp = Float64(cos(y) - t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); tmp = 0.0; if ((x <= -9e-7) || ~((x <= 3e-11))) tmp = (x + 1.0) - t_0; else tmp = cos(y) - t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -9e-7], N[Not[LessEqual[x, 3e-11]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\mathbf{if}\;x \leq -9 \cdot 10^{-7} \lor \neg \left(x \leq 3 \cdot 10^{-11}\right):\\
\;\;\;\;\left(x + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos y - t\_0\\
\end{array}
\end{array}
if x < -8.99999999999999959e-7 or 3e-11 < x Initial program 100.0%
Taylor expanded in y around 0 99.5%
if -8.99999999999999959e-7 < x < 3e-11Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.3%
neg-mul-199.3%
sub-neg99.3%
Simplified99.3%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(if (<= x -9e-7)
(+ (fma z (- (sin y)) x) 1.0)
(if (<= x 2.8e-9) (- (cos y) t_0) (- (+ x 1.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double tmp;
if (x <= -9e-7) {
tmp = fma(z, -sin(y), x) + 1.0;
} else if (x <= 2.8e-9) {
tmp = cos(y) - t_0;
} else {
tmp = (x + 1.0) - t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * sin(y)) tmp = 0.0 if (x <= -9e-7) tmp = Float64(fma(z, Float64(-sin(y)), x) + 1.0); elseif (x <= 2.8e-9) tmp = Float64(cos(y) - t_0); else tmp = Float64(Float64(x + 1.0) - t_0); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e-7], N[(N[(z * (-N[Sin[y], $MachinePrecision]) + x), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[x, 2.8e-9], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\mathbf{if}\;x \leq -9 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(z, -\sin y, x\right) + 1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-9}:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(x + 1\right) - t\_0\\
\end{array}
\end{array}
if x < -8.99999999999999959e-7Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 99.1%
if -8.99999999999999959e-7 < x < 2.79999999999999984e-9Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.3%
neg-mul-199.3%
sub-neg99.3%
Simplified99.3%
if 2.79999999999999984e-9 < x Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (- (+ (cos y) x) (* z (sin y))))
double code(double x, double y, double z) {
return (cos(y) + x) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (cos(y) + x) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (Math.cos(y) + x) - (z * Math.sin(y));
}
def code(x, y, z): return (math.cos(y) + x) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(cos(y) + x) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (cos(y) + x) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\cos y + x\right) - z \cdot \sin y
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -2.6e+65)
(- 1.0 (* z (sin y)))
(if (<= z 4.9e+231)
(+ (cos y) x)
(if (<= z 1.5e+258)
(* z (- (sin y)))
(+
1.0
(+ x (* y (- (* y (- (* 0.16666666666666666 (* y z)) 0.5)) z))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e+65) {
tmp = 1.0 - (z * sin(y));
} else if (z <= 4.9e+231) {
tmp = cos(y) + x;
} else if (z <= 1.5e+258) {
tmp = z * -sin(y);
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2.6d+65)) then
tmp = 1.0d0 - (z * sin(y))
else if (z <= 4.9d+231) then
tmp = cos(y) + x
else if (z <= 1.5d+258) then
tmp = z * -sin(y)
else
tmp = 1.0d0 + (x + (y * ((y * ((0.16666666666666666d0 * (y * z)) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e+65) {
tmp = 1.0 - (z * Math.sin(y));
} else if (z <= 4.9e+231) {
tmp = Math.cos(y) + x;
} else if (z <= 1.5e+258) {
tmp = z * -Math.sin(y);
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.6e+65: tmp = 1.0 - (z * math.sin(y)) elif z <= 4.9e+231: tmp = math.cos(y) + x elif z <= 1.5e+258: tmp = z * -math.sin(y) else: tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.6e+65) tmp = Float64(1.0 - Float64(z * sin(y))); elseif (z <= 4.9e+231) tmp = Float64(cos(y) + x); elseif (z <= 1.5e+258) tmp = Float64(z * Float64(-sin(y))); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * z)) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.6e+65) tmp = 1.0 - (z * sin(y)); elseif (z <= 4.9e+231) tmp = cos(y) + x; elseif (z <= 1.5e+258) tmp = z * -sin(y); else tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.6e+65], N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e+231], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.5e+258], N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+65}:\\
\;\;\;\;1 - z \cdot \sin y\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+231}:\\
\;\;\;\;\cos y + x\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+258}:\\
\;\;\;\;z \cdot \left(-\sin y\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if z < -2.60000000000000003e65Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 72.4%
neg-mul-172.4%
sub-neg72.4%
Simplified72.4%
Taylor expanded in y around 0 72.4%
if -2.60000000000000003e65 < z < 4.90000000000000021e231Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 90.9%
if 4.90000000000000021e231 < z < 1.5e258Initial program 99.6%
cancel-sign-sub-inv99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
sin-neg99.6%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 93.8%
neg-mul-193.8%
distribute-rgt-neg-in93.8%
Simplified93.8%
if 1.5e258 < z Initial program 100.0%
Taylor expanded in y around 0 93.4%
Final simplification87.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (sin y)))))
(if (<= z -1.05e+113)
t_0
(if (<= z 4.9e+231)
(+ (cos y) x)
(if (<= z 1.45e+258)
t_0
(+
1.0
(+ x (* y (- (* y (- (* 0.16666666666666666 (* y z)) 0.5)) z)))))))))
double code(double x, double y, double z) {
double t_0 = z * -sin(y);
double tmp;
if (z <= -1.05e+113) {
tmp = t_0;
} else if (z <= 4.9e+231) {
tmp = cos(y) + x;
} else if (z <= 1.45e+258) {
tmp = t_0;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * -sin(y)
if (z <= (-1.05d+113)) then
tmp = t_0
else if (z <= 4.9d+231) then
tmp = cos(y) + x
else if (z <= 1.45d+258) then
tmp = t_0
else
tmp = 1.0d0 + (x + (y * ((y * ((0.16666666666666666d0 * (y * z)) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * -Math.sin(y);
double tmp;
if (z <= -1.05e+113) {
tmp = t_0;
} else if (z <= 4.9e+231) {
tmp = Math.cos(y) + x;
} else if (z <= 1.45e+258) {
tmp = t_0;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): t_0 = z * -math.sin(y) tmp = 0 if z <= -1.05e+113: tmp = t_0 elif z <= 4.9e+231: tmp = math.cos(y) + x elif z <= 1.45e+258: tmp = t_0 else: tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (z <= -1.05e+113) tmp = t_0; elseif (z <= 4.9e+231) tmp = Float64(cos(y) + x); elseif (z <= 1.45e+258) tmp = t_0; else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * z)) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -sin(y); tmp = 0.0; if (z <= -1.05e+113) tmp = t_0; elseif (z <= 4.9e+231) tmp = cos(y) + x; elseif (z <= 1.45e+258) tmp = t_0; else tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -1.05e+113], t$95$0, If[LessEqual[z, 4.9e+231], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1.45e+258], t$95$0, N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+113}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+231}:\\
\;\;\;\;\cos y + x\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+258}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if z < -1.0499999999999999e113 or 4.90000000000000021e231 < z < 1.4500000000000001e258Initial program 99.7%
cancel-sign-sub-inv99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
sin-neg99.7%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 71.8%
neg-mul-171.8%
distribute-rgt-neg-in71.8%
Simplified71.8%
if -1.0499999999999999e113 < z < 4.90000000000000021e231Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 89.0%
if 1.4500000000000001e258 < z Initial program 100.0%
Taylor expanded in y around 0 93.4%
Final simplification85.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.226) (not (<= z 7e-12))) (- (+ x 1.0) (* z (sin y))) (+ (cos y) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.226) || !(z <= 7e-12)) {
tmp = (x + 1.0) - (z * sin(y));
} else {
tmp = cos(y) + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.226d0)) .or. (.not. (z <= 7d-12))) then
tmp = (x + 1.0d0) - (z * sin(y))
else
tmp = cos(y) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.226) || !(z <= 7e-12)) {
tmp = (x + 1.0) - (z * Math.sin(y));
} else {
tmp = Math.cos(y) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.226) or not (z <= 7e-12): tmp = (x + 1.0) - (z * math.sin(y)) else: tmp = math.cos(y) + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.226) || !(z <= 7e-12)) tmp = Float64(Float64(x + 1.0) - Float64(z * sin(y))); else tmp = Float64(cos(y) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.226) || ~((z <= 7e-12))) tmp = (x + 1.0) - (z * sin(y)); else tmp = cos(y) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.226], N[Not[LessEqual[z, 7e-12]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.226 \lor \neg \left(z \leq 7 \cdot 10^{-12}\right):\\
\;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;\cos y + x\\
\end{array}
\end{array}
if z < -0.226000000000000006 or 7.0000000000000001e-12 < z Initial program 99.8%
Taylor expanded in y around 0 99.2%
if -0.226000000000000006 < z < 7.0000000000000001e-12Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 99.2%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.3e+64) (not (<= z 2.6e+29))) (- x (* z (sin y))) (+ (cos y) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.3e+64) || !(z <= 2.6e+29)) {
tmp = x - (z * sin(y));
} else {
tmp = cos(y) + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.3d+64)) .or. (.not. (z <= 2.6d+29))) then
tmp = x - (z * sin(y))
else
tmp = cos(y) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.3e+64) || !(z <= 2.6e+29)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = Math.cos(y) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.3e+64) or not (z <= 2.6e+29): tmp = x - (z * math.sin(y)) else: tmp = math.cos(y) + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.3e+64) || !(z <= 2.6e+29)) tmp = Float64(x - Float64(z * sin(y))); else tmp = Float64(cos(y) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.3e+64) || ~((z <= 2.6e+29))) tmp = x - (z * sin(y)); else tmp = cos(y) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.3e+64], N[Not[LessEqual[z, 2.6e+29]], $MachinePrecision]], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+64} \lor \neg \left(z \leq 2.6 \cdot 10^{+29}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;\cos y + x\\
\end{array}
\end{array}
if z < -1.29999999999999998e64 or 2.6e29 < z Initial program 99.8%
Taylor expanded in y around 0 99.8%
Taylor expanded in x around inf 91.4%
if -1.29999999999999998e64 < z < 2.6e29Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 96.9%
Final simplification94.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -106000.0) (not (<= y 4.4e-8))) (+ (cos y) x) (+ 1.0 (+ x (* y (- (* y (- (* 0.16666666666666666 (* y z)) 0.5)) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -106000.0) || !(y <= 4.4e-8)) {
tmp = cos(y) + x;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-106000.0d0)) .or. (.not. (y <= 4.4d-8))) then
tmp = cos(y) + x
else
tmp = 1.0d0 + (x + (y * ((y * ((0.16666666666666666d0 * (y * z)) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -106000.0) || !(y <= 4.4e-8)) {
tmp = Math.cos(y) + x;
} else {
tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -106000.0) or not (y <= 4.4e-8): tmp = math.cos(y) + x else: tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -106000.0) || !(y <= 4.4e-8)) tmp = Float64(cos(y) + x); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(0.16666666666666666 * Float64(y * z)) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -106000.0) || ~((y <= 4.4e-8))) tmp = cos(y) + x; else tmp = 1.0 + (x + (y * ((y * ((0.16666666666666666 * (y * z)) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -106000.0], N[Not[LessEqual[y, 4.4e-8]], $MachinePrecision]], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -106000 \lor \neg \left(y \leq 4.4 \cdot 10^{-8}\right):\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(0.16666666666666666 \cdot \left(y \cdot z\right) - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if y < -106000 or 4.3999999999999997e-8 < y Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 64.6%
if -106000 < y < 4.3999999999999997e-8Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification84.1%
(FPCore (x y z) :precision binary64 (if (<= x -9e-7) (+ x 1.0) (if (<= x 3e-11) (cos y) (* x (+ 1.0 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9e-7) {
tmp = x + 1.0;
} else if (x <= 3e-11) {
tmp = cos(y);
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9d-7)) then
tmp = x + 1.0d0
else if (x <= 3d-11) then
tmp = cos(y)
else
tmp = x * (1.0d0 + (1.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -9e-7) {
tmp = x + 1.0;
} else if (x <= 3e-11) {
tmp = Math.cos(y);
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9e-7: tmp = x + 1.0 elif x <= 3e-11: tmp = math.cos(y) else: tmp = x * (1.0 + (1.0 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9e-7) tmp = Float64(x + 1.0); elseif (x <= 3e-11) tmp = cos(y); else tmp = Float64(x * Float64(1.0 + Float64(1.0 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -9e-7) tmp = x + 1.0; elseif (x <= 3e-11) tmp = cos(y); else tmp = x * (1.0 + (1.0 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9e-7], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 3e-11], N[Cos[y], $MachinePrecision], N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{-7}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-11}:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < -8.99999999999999959e-7Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 81.5%
if -8.99999999999999959e-7 < x < 3e-11Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.3%
neg-mul-199.3%
sub-neg99.3%
Simplified99.3%
Taylor expanded in z around 0 68.5%
if 3e-11 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
+-commutative100.0%
fma-undefine100.0%
distribute-rgt-neg-in100.0%
associate-+l+100.0%
distribute-lft-neg-in100.0%
add-cube-cbrt99.5%
associate-*r*99.5%
fma-define99.5%
pow299.5%
+-commutative99.5%
Applied egg-rr99.5%
Taylor expanded in y around 0 82.8%
+-commutative82.8%
Simplified82.8%
Taylor expanded in x around inf 82.8%
Final simplification75.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -4200000000.0) (not (<= y 10.8))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4200000000.0) || !(y <= 10.8)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-4200000000.0d0)) .or. (.not. (y <= 10.8d0))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x + (y * ((y * (-0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4200000000.0) || !(y <= 10.8)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4200000000.0) or not (y <= 10.8): tmp = x + 1.0 else: tmp = 1.0 + (x + (y * ((y * -0.5) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4200000000.0) || !(y <= 10.8)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * -0.5) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4200000000.0) || ~((y <= 10.8))) tmp = x + 1.0; else tmp = 1.0 + (x + (y * ((y * -0.5) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4200000000.0], N[Not[LessEqual[y, 10.8]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4200000000 \lor \neg \left(y \leq 10.8\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\end{array}
\end{array}
if y < -4.2e9 or 10.800000000000001 < y Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 36.6%
if -4.2e9 < y < 10.800000000000001Initial program 100.0%
Taylor expanded in y around 0 99.3%
Final simplification71.9%
(FPCore (x y z) :precision binary64 (if (<= y -9.4e+23) (+ x 1.0) (if (<= y 5.2e+81) (+ 1.0 (- x (* y z))) (* x (+ 1.0 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9.4e+23) {
tmp = x + 1.0;
} else if (y <= 5.2e+81) {
tmp = 1.0 + (x - (y * z));
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-9.4d+23)) then
tmp = x + 1.0d0
else if (y <= 5.2d+81) then
tmp = 1.0d0 + (x - (y * z))
else
tmp = x * (1.0d0 + (1.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9.4e+23) {
tmp = x + 1.0;
} else if (y <= 5.2e+81) {
tmp = 1.0 + (x - (y * z));
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9.4e+23: tmp = x + 1.0 elif y <= 5.2e+81: tmp = 1.0 + (x - (y * z)) else: tmp = x * (1.0 + (1.0 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9.4e+23) tmp = Float64(x + 1.0); elseif (y <= 5.2e+81) tmp = Float64(1.0 + Float64(x - Float64(y * z))); else tmp = Float64(x * Float64(1.0 + Float64(1.0 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9.4e+23) tmp = x + 1.0; elseif (y <= 5.2e+81) tmp = 1.0 + (x - (y * z)); else tmp = x * (1.0 + (1.0 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9.4e+23], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 5.2e+81], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.4 \cdot 10^{+23}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+81}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\
\end{array}
\end{array}
if y < -9.3999999999999994e23Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 45.6%
if -9.3999999999999994e23 < y < 5.19999999999999984e81Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 93.2%
mul-1-neg93.2%
unsub-neg93.2%
Simplified93.2%
if 5.19999999999999984e81 < y Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
+-commutative99.8%
fma-undefine99.8%
distribute-rgt-neg-in99.8%
associate-+l+99.8%
distribute-lft-neg-in99.8%
add-cube-cbrt99.2%
associate-*r*99.3%
fma-define99.3%
pow299.3%
+-commutative99.3%
Applied egg-rr99.3%
Taylor expanded in y around 0 28.2%
+-commutative28.2%
Simplified28.2%
Taylor expanded in x around inf 28.2%
Final simplification71.8%
(FPCore (x y z) :precision binary64 (if (<= x -2.1e-10) (+ x 1.0) (if (<= x 1.1e-31) (- 1.0 (* y z)) (* x (+ 1.0 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.1e-10) {
tmp = x + 1.0;
} else if (x <= 1.1e-31) {
tmp = 1.0 - (y * z);
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.1d-10)) then
tmp = x + 1.0d0
else if (x <= 1.1d-31) then
tmp = 1.0d0 - (y * z)
else
tmp = x * (1.0d0 + (1.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.1e-10) {
tmp = x + 1.0;
} else if (x <= 1.1e-31) {
tmp = 1.0 - (y * z);
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.1e-10: tmp = x + 1.0 elif x <= 1.1e-31: tmp = 1.0 - (y * z) else: tmp = x * (1.0 + (1.0 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.1e-10) tmp = Float64(x + 1.0); elseif (x <= 1.1e-31) tmp = Float64(1.0 - Float64(y * z)); else tmp = Float64(x * Float64(1.0 + Float64(1.0 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.1e-10) tmp = x + 1.0; elseif (x <= 1.1e-31) tmp = 1.0 - (y * z); else tmp = x * (1.0 + (1.0 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.1e-10], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 1.1e-31], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-10}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-31}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\
\end{array}
\end{array}
if x < -2.1e-10Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 80.7%
if -2.1e-10 < x < 1.10000000000000005e-31Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.8%
neg-mul-199.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 54.9%
mul-1-neg54.9%
*-commutative54.9%
unsub-neg54.9%
*-commutative54.9%
Simplified54.9%
if 1.10000000000000005e-31 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
+-commutative100.0%
fma-undefine100.0%
distribute-rgt-neg-in100.0%
associate-+l+100.0%
distribute-lft-neg-in100.0%
add-cube-cbrt99.6%
associate-*r*99.6%
fma-define99.6%
pow299.6%
+-commutative99.6%
Applied egg-rr99.6%
Taylor expanded in y around 0 79.0%
+-commutative79.0%
Simplified79.0%
Taylor expanded in x around inf 79.1%
Final simplification67.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.25e-9) (not (<= x 1.2e-20))) (+ x 1.0) (- 1.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e-9) || !(x <= 1.2e-20)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.25d-9)) .or. (.not. (x <= 1.2d-20))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e-9) || !(x <= 1.2e-20)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.25e-9) or not (x <= 1.2e-20): tmp = x + 1.0 else: tmp = 1.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.25e-9) || !(x <= 1.2e-20)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.25e-9) || ~((x <= 1.2e-20))) tmp = x + 1.0; else tmp = 1.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.25e-9], N[Not[LessEqual[x, 1.2e-20]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-9} \lor \neg \left(x \leq 1.2 \cdot 10^{-20}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\
\end{array}
\end{array}
if x < -1.25e-9 or 1.19999999999999996e-20 < x Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 79.5%
if -1.25e-9 < x < 1.19999999999999996e-20Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.8%
neg-mul-199.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 55.9%
mul-1-neg55.9%
*-commutative55.9%
unsub-neg55.9%
*-commutative55.9%
Simplified55.9%
Final simplification67.9%
(FPCore (x y z) :precision binary64 (if (<= x -1.0) x (if (<= x 1.35e-15) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.0) {
tmp = x;
} else if (x <= 1.35e-15) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = x
else if (x <= 1.35d-15) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.0) {
tmp = x;
} else if (x <= 1.35e-15) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.0: tmp = x elif x <= 1.35e-15: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.0) tmp = x; elseif (x <= 1.35e-15) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.0) tmp = x; elseif (x <= 1.35e-15) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.0], x, If[LessEqual[x, 1.35e-15], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-15}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1 or 1.35000000000000005e-15 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in x around inf 80.7%
if -1 < x < 1.35000000000000005e-15Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 98.9%
neg-mul-198.9%
sub-neg98.9%
Simplified98.9%
Taylor expanded in y around 0 45.5%
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
return x + 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + 1.0d0
end function
public static double code(double x, double y, double z) {
return x + 1.0;
}
def code(x, y, z): return x + 1.0
function code(x, y, z) return Float64(x + 1.0) end
function tmp = code(x, y, z) tmp = x + 1.0; end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 63.2%
Final simplification63.2%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 60.6%
neg-mul-160.6%
sub-neg60.6%
Simplified60.6%
Taylor expanded in y around 0 24.7%
herbie shell --seed 2024165
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, B"
:precision binary64
(- (+ x (cos y)) (* z (sin y))))