
(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 13 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 (- (+ 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}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- (sin y)))))
(if (<= z -2.9e+233)
t_0
(if (<= z -4.6e+215)
x
(if (<= z -7.8e+154)
t_0
(if (<= z -4.2e+95)
(+ 1.0 (- x (* y z)))
(if (or (<= z -4.65e+61) (not (<= z 6.5e+178)))
t_0
(+ x (cos y)))))))))
double code(double x, double y, double z) {
double t_0 = z * -sin(y);
double tmp;
if (z <= -2.9e+233) {
tmp = t_0;
} else if (z <= -4.6e+215) {
tmp = x;
} else if (z <= -7.8e+154) {
tmp = t_0;
} else if (z <= -4.2e+95) {
tmp = 1.0 + (x - (y * z));
} else if ((z <= -4.65e+61) || !(z <= 6.5e+178)) {
tmp = t_0;
} else {
tmp = x + cos(y);
}
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 <= (-2.9d+233)) then
tmp = t_0
else if (z <= (-4.6d+215)) then
tmp = x
else if (z <= (-7.8d+154)) then
tmp = t_0
else if (z <= (-4.2d+95)) then
tmp = 1.0d0 + (x - (y * z))
else if ((z <= (-4.65d+61)) .or. (.not. (z <= 6.5d+178))) then
tmp = t_0
else
tmp = x + cos(y)
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 <= -2.9e+233) {
tmp = t_0;
} else if (z <= -4.6e+215) {
tmp = x;
} else if (z <= -7.8e+154) {
tmp = t_0;
} else if (z <= -4.2e+95) {
tmp = 1.0 + (x - (y * z));
} else if ((z <= -4.65e+61) || !(z <= 6.5e+178)) {
tmp = t_0;
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): t_0 = z * -math.sin(y) tmp = 0 if z <= -2.9e+233: tmp = t_0 elif z <= -4.6e+215: tmp = x elif z <= -7.8e+154: tmp = t_0 elif z <= -4.2e+95: tmp = 1.0 + (x - (y * z)) elif (z <= -4.65e+61) or not (z <= 6.5e+178): tmp = t_0 else: tmp = x + math.cos(y) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (z <= -2.9e+233) tmp = t_0; elseif (z <= -4.6e+215) tmp = x; elseif (z <= -7.8e+154) tmp = t_0; elseif (z <= -4.2e+95) tmp = Float64(1.0 + Float64(x - Float64(y * z))); elseif ((z <= -4.65e+61) || !(z <= 6.5e+178)) tmp = t_0; else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -sin(y); tmp = 0.0; if (z <= -2.9e+233) tmp = t_0; elseif (z <= -4.6e+215) tmp = x; elseif (z <= -7.8e+154) tmp = t_0; elseif (z <= -4.2e+95) tmp = 1.0 + (x - (y * z)); elseif ((z <= -4.65e+61) || ~((z <= 6.5e+178))) tmp = t_0; else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -2.9e+233], t$95$0, If[LessEqual[z, -4.6e+215], x, If[LessEqual[z, -7.8e+154], t$95$0, If[LessEqual[z, -4.2e+95], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -4.65e+61], N[Not[LessEqual[z, 6.5e+178]], $MachinePrecision]], t$95$0, N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{+215}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{+95}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{elif}\;z \leq -4.65 \cdot 10^{+61} \lor \neg \left(z \leq 6.5 \cdot 10^{+178}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -2.90000000000000012e233 or -4.6000000000000002e215 < z < -7.8000000000000006e154 or -4.2e95 < z < -4.64999999999999987e61 or 6.5000000000000005e178 < z Initial program 99.9%
Taylor expanded in z around inf 81.1%
associate-*r*81.1%
neg-mul-181.1%
*-commutative81.1%
Simplified81.1%
if -2.90000000000000012e233 < z < -4.6000000000000002e215Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -7.8000000000000006e154 < z < -4.2e95Initial program 100.0%
Taylor expanded in y around 0 89.6%
mul-1-neg89.6%
unsub-neg89.6%
Simplified89.6%
if -4.64999999999999987e61 < z < 6.5000000000000005e178Initial program 99.9%
Taylor expanded in z around 0 90.4%
+-commutative90.4%
Simplified90.4%
Final simplification88.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- 1.0 (* z (sin y)))))
(if (<= z -4.2e+233)
t_0
(if (<= z -4.6e+215)
x
(if (or (<= z -4.65e+61) (not (<= z 4.7e+178))) t_0 (+ x (cos y)))))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (z * sin(y));
double tmp;
if (z <= -4.2e+233) {
tmp = t_0;
} else if (z <= -4.6e+215) {
tmp = x;
} else if ((z <= -4.65e+61) || !(z <= 4.7e+178)) {
tmp = t_0;
} else {
tmp = x + cos(y);
}
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 = 1.0d0 - (z * sin(y))
if (z <= (-4.2d+233)) then
tmp = t_0
else if (z <= (-4.6d+215)) then
tmp = x
else if ((z <= (-4.65d+61)) .or. (.not. (z <= 4.7d+178))) then
tmp = t_0
else
tmp = x + cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (z * Math.sin(y));
double tmp;
if (z <= -4.2e+233) {
tmp = t_0;
} else if (z <= -4.6e+215) {
tmp = x;
} else if ((z <= -4.65e+61) || !(z <= 4.7e+178)) {
tmp = t_0;
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (z * math.sin(y)) tmp = 0 if z <= -4.2e+233: tmp = t_0 elif z <= -4.6e+215: tmp = x elif (z <= -4.65e+61) or not (z <= 4.7e+178): tmp = t_0 else: tmp = x + math.cos(y) return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(z * sin(y))) tmp = 0.0 if (z <= -4.2e+233) tmp = t_0; elseif (z <= -4.6e+215) tmp = x; elseif ((z <= -4.65e+61) || !(z <= 4.7e+178)) tmp = t_0; else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (z * sin(y)); tmp = 0.0; if (z <= -4.2e+233) tmp = t_0; elseif (z <= -4.6e+215) tmp = x; elseif ((z <= -4.65e+61) || ~((z <= 4.7e+178))) tmp = t_0; else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+233], t$95$0, If[LessEqual[z, -4.6e+215], x, If[Or[LessEqual[z, -4.65e+61], N[Not[LessEqual[z, 4.7e+178]], $MachinePrecision]], t$95$0, N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - z \cdot \sin y\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+233}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{+215}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4.65 \cdot 10^{+61} \lor \neg \left(z \leq 4.7 \cdot 10^{+178}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -4.19999999999999993e233 or -4.6000000000000002e215 < z < -4.64999999999999987e61 or 4.69999999999999992e178 < z Initial program 99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 81.4%
*-commutative81.4%
Simplified81.4%
if -4.19999999999999993e233 < z < -4.6000000000000002e215Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -4.64999999999999987e61 < z < 4.69999999999999992e178Initial program 99.9%
Taylor expanded in z around 0 90.4%
+-commutative90.4%
Simplified90.4%
Final simplification88.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.55) (not (<= z 7.2e-47))) (- (+ x 1.0) (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55) || !(z <= 7.2e-47)) {
tmp = (x + 1.0) - (z * sin(y));
} else {
tmp = x + cos(y);
}
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.55d0)) .or. (.not. (z <= 7.2d-47))) then
tmp = (x + 1.0d0) - (z * sin(y))
else
tmp = x + cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55) || !(z <= 7.2e-47)) {
tmp = (x + 1.0) - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.55) or not (z <= 7.2e-47): tmp = (x + 1.0) - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.55) || !(z <= 7.2e-47)) tmp = Float64(Float64(x + 1.0) - Float64(z * sin(y))); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.55) || ~((z <= 7.2e-47))) tmp = (x + 1.0) - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.55], N[Not[LessEqual[z, 7.2e-47]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \lor \neg \left(z \leq 7.2 \cdot 10^{-47}\right):\\
\;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -1.55000000000000004 or 7.19999999999999982e-47 < z Initial program 99.8%
Taylor expanded in y around 0 98.9%
+-commutative98.9%
Simplified98.9%
if -1.55000000000000004 < z < 7.19999999999999982e-47Initial program 100.0%
Taylor expanded in z around 0 99.6%
+-commutative99.6%
Simplified99.6%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.65e+61) (not (<= z 8e-10))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.65e+61) || !(z <= 8e-10)) {
tmp = x - (z * sin(y));
} else {
tmp = x + cos(y);
}
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 <= (-4.65d+61)) .or. (.not. (z <= 8d-10))) then
tmp = x - (z * sin(y))
else
tmp = x + cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -4.65e+61) || !(z <= 8e-10)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.65e+61) or not (z <= 8e-10): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.65e+61) || !(z <= 8e-10)) tmp = Float64(x - Float64(z * sin(y))); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -4.65e+61) || ~((z <= 8e-10))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.65e+61], N[Not[LessEqual[z, 8e-10]], $MachinePrecision]], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.65 \cdot 10^{+61} \lor \neg \left(z \leq 8 \cdot 10^{-10}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -4.64999999999999987e61 or 8.00000000000000029e-10 < z Initial program 99.9%
Taylor expanded in x around inf 91.2%
if -4.64999999999999987e61 < z < 8.00000000000000029e-10Initial program 99.9%
Taylor expanded in z around 0 97.2%
+-commutative97.2%
Simplified97.2%
Final simplification94.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.042) (not (<= y 6e-6))) (+ x (cos y)) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.042) || !(y <= 6e-6)) {
tmp = x + cos(y);
} else {
tmp = 1.0 + (x - (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 ((y <= (-0.042d0)) .or. (.not. (y <= 6d-6))) then
tmp = x + cos(y)
else
tmp = 1.0d0 + (x - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.042) || !(y <= 6e-6)) {
tmp = x + Math.cos(y);
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.042) or not (y <= 6e-6): tmp = x + math.cos(y) else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.042) || !(y <= 6e-6)) tmp = Float64(x + cos(y)); else tmp = Float64(1.0 + Float64(x - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.042) || ~((y <= 6e-6))) tmp = x + cos(y); else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.042], N[Not[LessEqual[y, 6e-6]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.042 \lor \neg \left(y \leq 6 \cdot 10^{-6}\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -0.0420000000000000026 or 6.0000000000000002e-6 < y Initial program 99.8%
Taylor expanded in z around 0 65.0%
+-commutative65.0%
Simplified65.0%
if -0.0420000000000000026 < y < 6.0000000000000002e-6Initial program 100.0%
Taylor expanded in y around 0 99.1%
mul-1-neg99.1%
unsub-neg99.1%
Simplified99.1%
Final simplification79.9%
(FPCore (x y z) :precision binary64 (if (<= x -4.6e+15) x (if (<= x 9.2e-14) (cos y) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e+15) {
tmp = x;
} else if (x <= 9.2e-14) {
tmp = cos(y);
} else {
tmp = x + 1.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) :: tmp
if (x <= (-4.6d+15)) then
tmp = x
else if (x <= 9.2d-14) then
tmp = cos(y)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e+15) {
tmp = x;
} else if (x <= 9.2e-14) {
tmp = Math.cos(y);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.6e+15: tmp = x elif x <= 9.2e-14: tmp = math.cos(y) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.6e+15) tmp = x; elseif (x <= 9.2e-14) tmp = cos(y); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.6e+15) tmp = x; elseif (x <= 9.2e-14) tmp = cos(y); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.6e+15], x, If[LessEqual[x, 9.2e-14], N[Cos[y], $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-14}:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -4.6e15Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 84.3%
if -4.6e15 < x < 9.19999999999999993e-14Initial program 99.8%
Taylor expanded in x around 0 98.3%
cancel-sign-sub-inv98.3%
*-commutative98.3%
+-commutative98.3%
fma-def98.4%
Simplified98.4%
Taylor expanded in z around 0 59.1%
if 9.19999999999999993e-14 < x Initial program 100.0%
Taylor expanded in y around 0 74.7%
mul-1-neg74.7%
unsub-neg74.7%
Simplified74.7%
Taylor expanded in x around inf 83.5%
Final simplification72.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -500000000000.0) (not (<= y 1.5e+31))) (+ x 1.0) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -500000000000.0) || !(y <= 1.5e+31)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (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 ((y <= (-500000000000.0d0)) .or. (.not. (y <= 1.5d+31))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -500000000000.0) || !(y <= 1.5e+31)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -500000000000.0) or not (y <= 1.5e+31): tmp = x + 1.0 else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -500000000000.0) || !(y <= 1.5e+31)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -500000000000.0) || ~((y <= 1.5e+31))) tmp = x + 1.0; else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -500000000000.0], N[Not[LessEqual[y, 1.5e+31]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -500000000000 \lor \neg \left(y \leq 1.5 \cdot 10^{+31}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -5e11 or 1.49999999999999995e31 < y Initial program 99.8%
Taylor expanded in y around 0 31.1%
mul-1-neg31.1%
unsub-neg31.1%
Simplified31.1%
Taylor expanded in x around inf 43.3%
if -5e11 < y < 1.49999999999999995e31Initial program 100.0%
Taylor expanded in y around 0 92.6%
mul-1-neg92.6%
unsub-neg92.6%
Simplified92.6%
Final simplification67.8%
(FPCore (x y z) :precision binary64 (if (<= x -4.6e+15) x (if (<= x 2.4e-128) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e+15) {
tmp = x;
} else if (x <= 2.4e-128) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.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) :: tmp
if (x <= (-4.6d+15)) then
tmp = x
else if (x <= 2.4d-128) then
tmp = 1.0d0 - (y * z)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e+15) {
tmp = x;
} else if (x <= 2.4e-128) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.6e+15: tmp = x elif x <= 2.4e-128: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.6e+15) tmp = x; elseif (x <= 2.4e-128) tmp = Float64(1.0 - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.6e+15) tmp = x; elseif (x <= 2.4e-128) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.6e+15], x, If[LessEqual[x, 2.4e-128], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-128}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -4.6e15Initial program 100.0%
Taylor expanded in y around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 84.3%
if -4.6e15 < x < 2.3999999999999998e-128Initial program 99.8%
Taylor expanded in y around 0 47.2%
mul-1-neg47.2%
unsub-neg47.2%
Simplified47.2%
Taylor expanded in x around 0 47.2%
if 2.3999999999999998e-128 < x Initial program 99.9%
Taylor expanded in y around 0 66.0%
mul-1-neg66.0%
unsub-neg66.0%
Simplified66.0%
Taylor expanded in x around inf 73.5%
Final simplification65.6%
(FPCore (x y z) :precision binary64 (if (<= z -3.35e+233) (* y (- z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.35e+233) {
tmp = y * -z;
} else {
tmp = x + 1.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) :: tmp
if (z <= (-3.35d+233)) then
tmp = y * -z
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.35e+233) {
tmp = y * -z;
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.35e+233: tmp = y * -z else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.35e+233) tmp = Float64(y * Float64(-z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.35e+233) tmp = y * -z; else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.35e+233], N[(y * (-z)), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.35 \cdot 10^{+233}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -3.35000000000000021e233Initial program 99.8%
Taylor expanded in y around 0 48.0%
mul-1-neg48.0%
unsub-neg48.0%
Simplified48.0%
Taylor expanded in x around 0 48.0%
associate--l+48.0%
+-commutative48.0%
associate--r-48.0%
fma-neg48.0%
metadata-eval48.0%
Simplified48.0%
Taylor expanded in y around inf 38.6%
mul-1-neg38.6%
distribute-rgt-neg-in38.6%
Simplified38.6%
if -3.35000000000000021e233 < z Initial program 99.9%
Taylor expanded in y around 0 62.8%
mul-1-neg62.8%
unsub-neg62.8%
Simplified62.8%
Taylor expanded in x around inf 64.8%
Final simplification62.7%
(FPCore (x y z) :precision binary64 (if (<= x -4.6e+15) x (if (<= x 1.0) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.6e+15) {
tmp = x;
} else if (x <= 1.0) {
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 <= (-4.6d+15)) then
tmp = x
else if (x <= 1.0d0) 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 <= -4.6e+15) {
tmp = x;
} else if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.6e+15: tmp = x elif x <= 1.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.6e+15) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.6e+15) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.6e+15], x, If[LessEqual[x, 1.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.6e15 or 1 < x Initial program 100.0%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 82.9%
if -4.6e15 < x < 1Initial program 99.8%
Taylor expanded in x around 0 97.6%
cancel-sign-sub-inv97.6%
*-commutative97.6%
+-commutative97.6%
fma-def97.7%
Simplified97.7%
Taylor expanded in y around 0 36.1%
Final simplification59.9%
(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%
Taylor expanded in y around 0 61.6%
mul-1-neg61.6%
unsub-neg61.6%
Simplified61.6%
Taylor expanded in x around inf 60.5%
Final simplification60.5%
(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%
Taylor expanded in x around 0 57.0%
cancel-sign-sub-inv57.0%
*-commutative57.0%
+-commutative57.0%
fma-def57.0%
Simplified57.0%
Taylor expanded in y around 0 19.3%
Final simplification19.3%
herbie shell --seed 2023310
(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))))