
(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 -1.12e+192)
t_0
(if (<= z -3.2e+158)
(+ x 1.0)
(if (<= z -3.7e+130)
t_0
(if (<= z -8e+68)
(+ x (- 1.0 (* y z)))
(if (<= z 5.9e+94) (+ x (cos y)) t_0)))))))
double code(double x, double y, double z) {
double t_0 = z * -sin(y);
double tmp;
if (z <= -1.12e+192) {
tmp = t_0;
} else if (z <= -3.2e+158) {
tmp = x + 1.0;
} else if (z <= -3.7e+130) {
tmp = t_0;
} else if (z <= -8e+68) {
tmp = x + (1.0 - (y * z));
} else if (z <= 5.9e+94) {
tmp = x + cos(y);
} else {
tmp = 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 (z <= (-1.12d+192)) then
tmp = t_0
else if (z <= (-3.2d+158)) then
tmp = x + 1.0d0
else if (z <= (-3.7d+130)) then
tmp = t_0
else if (z <= (-8d+68)) then
tmp = x + (1.0d0 - (y * z))
else if (z <= 5.9d+94) then
tmp = x + cos(y)
else
tmp = 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 (z <= -1.12e+192) {
tmp = t_0;
} else if (z <= -3.2e+158) {
tmp = x + 1.0;
} else if (z <= -3.7e+130) {
tmp = t_0;
} else if (z <= -8e+68) {
tmp = x + (1.0 - (y * z));
} else if (z <= 5.9e+94) {
tmp = x + Math.cos(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * -math.sin(y) tmp = 0 if z <= -1.12e+192: tmp = t_0 elif z <= -3.2e+158: tmp = x + 1.0 elif z <= -3.7e+130: tmp = t_0 elif z <= -8e+68: tmp = x + (1.0 - (y * z)) elif z <= 5.9e+94: tmp = x + math.cos(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (z <= -1.12e+192) tmp = t_0; elseif (z <= -3.2e+158) tmp = Float64(x + 1.0); elseif (z <= -3.7e+130) tmp = t_0; elseif (z <= -8e+68) tmp = Float64(x + Float64(1.0 - Float64(y * z))); elseif (z <= 5.9e+94) tmp = Float64(x + cos(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -sin(y); tmp = 0.0; if (z <= -1.12e+192) tmp = t_0; elseif (z <= -3.2e+158) tmp = x + 1.0; elseif (z <= -3.7e+130) tmp = t_0; elseif (z <= -8e+68) tmp = x + (1.0 - (y * z)); elseif (z <= 5.9e+94) tmp = x + cos(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[z, -1.12e+192], t$95$0, If[LessEqual[z, -3.2e+158], N[(x + 1.0), $MachinePrecision], If[LessEqual[z, -3.7e+130], t$95$0, If[LessEqual[z, -8e+68], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.9e+94], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;z \leq -1.12 \cdot 10^{+192}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+158}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{+130}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+68}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{+94}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.12e192 or -3.19999999999999995e158 < z < -3.7000000000000001e130 or 5.8999999999999999e94 < z Initial program 99.8%
Taylor expanded in z around inf 80.8%
neg-mul-180.8%
distribute-rgt-neg-in80.8%
Simplified80.8%
if -1.12e192 < z < -3.19999999999999995e158Initial program 99.8%
Taylor expanded in y around 0 72.7%
associate-+r+72.7%
+-commutative72.7%
associate-+l+72.7%
mul-1-neg72.7%
unsub-neg72.7%
Simplified72.7%
Taylor expanded in y around 0 88.1%
if -3.7000000000000001e130 < z < -7.99999999999999962e68Initial program 99.8%
Taylor expanded in y around 0 80.7%
associate-+r+80.7%
+-commutative80.7%
associate-+l+80.7%
mul-1-neg80.7%
unsub-neg80.7%
Simplified80.7%
if -7.99999999999999962e68 < z < 5.8999999999999999e94Initial program 100.0%
Taylor expanded in z around 0 94.3%
+-commutative94.3%
Simplified94.3%
Final simplification89.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.5) (not (<= z 0.0245))) (- (+ x 1.0) (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.5) || !(z <= 0.0245)) {
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 <= (-0.5d0)) .or. (.not. (z <= 0.0245d0))) 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 <= -0.5) || !(z <= 0.0245)) {
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 <= -0.5) or not (z <= 0.0245): 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 <= -0.5) || !(z <= 0.0245)) 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 <= -0.5) || ~((z <= 0.0245))) 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, -0.5], N[Not[LessEqual[z, 0.0245]], $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 -0.5 \lor \neg \left(z \leq 0.0245\right):\\
\;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -0.5 or 0.024500000000000001 < z Initial program 99.8%
Taylor expanded in y around 0 98.6%
+-commutative98.6%
Simplified98.6%
if -0.5 < z < 0.024500000000000001Initial program 100.0%
Taylor expanded in z around 0 99.2%
+-commutative99.2%
Simplified99.2%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -4e+97) (not (<= z 0.0245))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4e+97) || !(z <= 0.0245)) {
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 <= (-4d+97)) .or. (.not. (z <= 0.0245d0))) 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 <= -4e+97) || !(z <= 0.0245)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4e+97) or not (z <= 0.0245): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4e+97) || !(z <= 0.0245)) 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 <= -4e+97) || ~((z <= 0.0245))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4e+97], N[Not[LessEqual[z, 0.0245]], $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 \cdot 10^{+97} \lor \neg \left(z \leq 0.0245\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -4.0000000000000003e97 or 0.024500000000000001 < z Initial program 99.8%
Taylor expanded in x around inf 91.6%
if -4.0000000000000003e97 < z < 0.024500000000000001Initial program 100.0%
Taylor expanded in z around 0 96.8%
+-commutative96.8%
Simplified96.8%
Final simplification94.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.027) (not (<= y 2.8e-8))) (+ x (cos y)) (+ x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.027) || !(y <= 2.8e-8)) {
tmp = x + cos(y);
} else {
tmp = x + (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 ((y <= (-0.027d0)) .or. (.not. (y <= 2.8d-8))) then
tmp = x + cos(y)
else
tmp = x + (1.0d0 - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.027) || !(y <= 2.8e-8)) {
tmp = x + Math.cos(y);
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.027) or not (y <= 2.8e-8): tmp = x + math.cos(y) else: tmp = x + (1.0 - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.027) || !(y <= 2.8e-8)) tmp = Float64(x + cos(y)); else tmp = Float64(x + Float64(1.0 - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.027) || ~((y <= 2.8e-8))) tmp = x + cos(y); else tmp = x + (1.0 - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.027], N[Not[LessEqual[y, 2.8e-8]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.027 \lor \neg \left(y \leq 2.8 \cdot 10^{-8}\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if y < -0.0269999999999999997 or 2.7999999999999999e-8 < y Initial program 99.9%
Taylor expanded in z around 0 62.2%
+-commutative62.2%
Simplified62.2%
if -0.0269999999999999997 < y < 2.7999999999999999e-8Initial program 100.0%
Taylor expanded in y around 0 100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification79.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1600.0) (not (<= x 1.5e-22))) (+ x 1.0) (cos y)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1600.0) || !(x <= 1.5e-22)) {
tmp = x + 1.0;
} else {
tmp = 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 ((x <= (-1600.0d0)) .or. (.not. (x <= 1.5d-22))) then
tmp = x + 1.0d0
else
tmp = cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1600.0) || !(x <= 1.5e-22)) {
tmp = x + 1.0;
} else {
tmp = Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1600.0) or not (x <= 1.5e-22): tmp = x + 1.0 else: tmp = math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1600.0) || !(x <= 1.5e-22)) tmp = Float64(x + 1.0); else tmp = cos(y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1600.0) || ~((x <= 1.5e-22))) tmp = x + 1.0; else tmp = cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1600.0], N[Not[LessEqual[x, 1.5e-22]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[Cos[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1600 \lor \neg \left(x \leq 1.5 \cdot 10^{-22}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;\cos y\\
\end{array}
\end{array}
if x < -1600 or 1.5e-22 < x Initial program 99.9%
Taylor expanded in y around 0 72.8%
associate-+r+72.8%
+-commutative72.8%
associate-+l+72.8%
mul-1-neg72.8%
unsub-neg72.8%
Simplified72.8%
Taylor expanded in y around 0 75.9%
if -1600 < x < 1.5e-22Initial program 99.9%
Taylor expanded in x around 0 98.9%
Taylor expanded in z around 0 63.9%
Final simplification69.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -100000.0) (not (<= y 2.8e-8))) (+ x 1.0) (+ x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -100000.0) || !(y <= 2.8e-8)) {
tmp = x + 1.0;
} else {
tmp = x + (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 ((y <= (-100000.0d0)) .or. (.not. (y <= 2.8d-8))) then
tmp = x + 1.0d0
else
tmp = x + (1.0d0 - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -100000.0) || !(y <= 2.8e-8)) {
tmp = x + 1.0;
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -100000.0) or not (y <= 2.8e-8): tmp = x + 1.0 else: tmp = x + (1.0 - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -100000.0) || !(y <= 2.8e-8)) tmp = Float64(x + 1.0); else tmp = Float64(x + Float64(1.0 - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -100000.0) || ~((y <= 2.8e-8))) tmp = x + 1.0; else tmp = x + (1.0 - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -100000.0], N[Not[LessEqual[y, 2.8e-8]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -100000 \lor \neg \left(y \leq 2.8 \cdot 10^{-8}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if y < -1e5 or 2.7999999999999999e-8 < y Initial program 99.9%
Taylor expanded in y around 0 25.7%
associate-+r+25.7%
+-commutative25.7%
associate-+l+25.7%
mul-1-neg25.7%
unsub-neg25.7%
Simplified25.7%
Taylor expanded in y around 0 37.8%
if -1e5 < y < 2.7999999999999999e-8Initial program 100.0%
Taylor expanded in y around 0 100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+l+100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification66.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -8e+193) (not (<= z 4.1e+176))) (- 1.0 (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -8e+193) || !(z <= 4.1e+176)) {
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 ((z <= (-8d+193)) .or. (.not. (z <= 4.1d+176))) 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 ((z <= -8e+193) || !(z <= 4.1e+176)) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -8e+193) or not (z <= 4.1e+176): tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -8e+193) || !(z <= 4.1e+176)) 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 ((z <= -8e+193) || ~((z <= 4.1e+176))) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -8e+193], N[Not[LessEqual[z, 4.1e+176]], $MachinePrecision]], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+193} \lor \neg \left(z \leq 4.1 \cdot 10^{+176}\right):\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -8.00000000000000053e193 or 4.0999999999999999e176 < z Initial program 99.8%
Taylor expanded in y around 0 46.3%
associate-+r+46.3%
+-commutative46.3%
associate-+l+46.3%
mul-1-neg46.3%
unsub-neg46.3%
Simplified46.3%
Taylor expanded in x around 0 41.1%
*-commutative41.1%
Simplified41.1%
if -8.00000000000000053e193 < z < 4.0999999999999999e176Initial program 99.9%
Taylor expanded in y around 0 63.0%
associate-+r+63.0%
+-commutative63.0%
associate-+l+63.0%
mul-1-neg63.0%
unsub-neg63.0%
Simplified63.0%
Taylor expanded in y around 0 69.1%
Final simplification63.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.9e+194) (not (<= z 7.8e+147))) (- x (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.9e+194) || !(z <= 7.8e+147)) {
tmp = x - (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 <= (-1.9d+194)) .or. (.not. (z <= 7.8d+147))) then
tmp = x - (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 <= -1.9e+194) || !(z <= 7.8e+147)) {
tmp = x - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.9e+194) or not (z <= 7.8e+147): tmp = x - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.9e+194) || !(z <= 7.8e+147)) tmp = Float64(x - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.9e+194) || ~((z <= 7.8e+147))) tmp = x - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.9e+194], N[Not[LessEqual[z, 7.8e+147]], $MachinePrecision]], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+194} \lor \neg \left(z \leq 7.8 \cdot 10^{+147}\right):\\
\;\;\;\;x - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -1.8999999999999999e194 or 7.80000000000000033e147 < z Initial program 99.8%
Taylor expanded in x around inf 92.5%
Taylor expanded in y around 0 42.9%
mul-1-neg42.9%
*-commutative42.9%
sub-neg42.9%
Simplified42.9%
if -1.8999999999999999e194 < z < 7.80000000000000033e147Initial program 99.9%
Taylor expanded in y around 0 62.5%
associate-+r+62.5%
+-commutative62.5%
associate-+l+62.5%
mul-1-neg62.5%
unsub-neg62.5%
Simplified62.5%
Taylor expanded in y around 0 70.0%
Final simplification63.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.22e+194) (not (<= z 1.82e+276))) (* y (- z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.22e+194) || !(z <= 1.82e+276)) {
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 <= (-1.22d+194)) .or. (.not. (z <= 1.82d+276))) 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 <= -1.22e+194) || !(z <= 1.82e+276)) {
tmp = y * -z;
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.22e+194) or not (z <= 1.82e+276): tmp = y * -z else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.22e+194) || !(z <= 1.82e+276)) 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 <= -1.22e+194) || ~((z <= 1.82e+276))) tmp = y * -z; else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.22e+194], N[Not[LessEqual[z, 1.82e+276]], $MachinePrecision]], N[(y * (-z)), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+194} \lor \neg \left(z \leq 1.82 \cdot 10^{+276}\right):\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -1.2200000000000001e194 or 1.81999999999999999e276 < z Initial program 99.8%
Taylor expanded in y around 0 51.5%
associate-+r+51.5%
+-commutative51.5%
associate-+l+51.5%
mul-1-neg51.5%
unsub-neg51.5%
Simplified51.5%
Taylor expanded in y around inf 45.4%
mul-1-neg45.4%
*-commutative45.4%
distribute-rgt-neg-in45.4%
Simplified45.4%
if -1.2200000000000001e194 < z < 1.81999999999999999e276Initial program 99.9%
Taylor expanded in y around 0 60.5%
associate-+r+60.5%
+-commutative60.5%
associate-+l+60.5%
mul-1-neg60.5%
unsub-neg60.5%
Simplified60.5%
Taylor expanded in y around 0 64.3%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (if (<= x -1600.0) x (if (<= x 1.0) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1600.0) {
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 <= (-1600.0d0)) 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 <= -1600.0) {
tmp = x;
} else if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1600.0: tmp = x elif x <= 1.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1600.0) 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 <= -1600.0) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1600.0], x, If[LessEqual[x, 1.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1600:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1600 or 1 < x Initial program 99.9%
Taylor expanded in y around 0 72.3%
associate-+r+72.3%
+-commutative72.3%
associate-+l+72.3%
mul-1-neg72.3%
unsub-neg72.3%
Simplified72.3%
Taylor expanded in x around inf 75.5%
if -1600 < x < 1Initial program 99.9%
Taylor expanded in x around 0 96.8%
Taylor expanded in y around 0 39.3%
Final simplification56.3%
(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 59.4%
associate-+r+59.4%
+-commutative59.4%
associate-+l+59.4%
mul-1-neg59.4%
unsub-neg59.4%
Simplified59.4%
Taylor expanded in y around 0 57.4%
Final simplification57.4%
(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 63.4%
Taylor expanded in y around 0 22.3%
Final simplification22.3%
herbie shell --seed 2024010
(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))))