
(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 11 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 (if (<= x -1.6e-16) (+ x (cos y)) (if (<= x 3.5e+22) (- (cos y) (* z (sin y))) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.6e-16) {
tmp = x + cos(y);
} else if (x <= 3.5e+22) {
tmp = cos(y) - (z * sin(y));
} 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.6d-16)) then
tmp = x + cos(y)
else if (x <= 3.5d+22) then
tmp = cos(y) - (z * sin(y))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.6e-16) {
tmp = x + Math.cos(y);
} else if (x <= 3.5e+22) {
tmp = Math.cos(y) - (z * Math.sin(y));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.6e-16: tmp = x + math.cos(y) elif x <= 3.5e+22: tmp = math.cos(y) - (z * math.sin(y)) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.6e-16) tmp = Float64(x + cos(y)); elseif (x <= 3.5e+22) tmp = Float64(cos(y) - Float64(z * sin(y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.6e-16) tmp = x + cos(y); elseif (x <= 3.5e+22) tmp = cos(y) - (z * sin(y)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.6e-16], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+22], N[(N[Cos[y], $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-16}:\\
\;\;\;\;x + \cos y\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+22}:\\
\;\;\;\;\cos y - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.60000000000000011e-16Initial program 99.9%
Taylor expanded in z around 0 79.9%
+-commutative79.9%
Simplified79.9%
if -1.60000000000000011e-16 < x < 3.5e22Initial program 99.9%
Taylor expanded in x around 0 98.3%
if 3.5e22 < x Initial program 99.9%
Taylor expanded in x around inf 90.6%
Final simplification91.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.75e+76) (not (<= z 3.5e+110))) (* z (- (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.75e+76) || !(z <= 3.5e+110)) {
tmp = 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 <= (-2.75d+76)) .or. (.not. (z <= 3.5d+110))) then
tmp = 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 <= -2.75e+76) || !(z <= 3.5e+110)) {
tmp = z * -Math.sin(y);
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.75e+76) or not (z <= 3.5e+110): tmp = z * -math.sin(y) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.75e+76) || !(z <= 3.5e+110)) tmp = Float64(z * Float64(-sin(y))); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.75e+76) || ~((z <= 3.5e+110))) tmp = z * -sin(y); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.75e+76], N[Not[LessEqual[z, 3.5e+110]], $MachinePrecision]], N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+76} \lor \neg \left(z \leq 3.5 \cdot 10^{+110}\right):\\
\;\;\;\;z \cdot \left(-\sin y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -2.75e76 or 3.4999999999999999e110 < z Initial program 99.8%
Taylor expanded in z around inf 71.4%
associate-*r*71.4%
neg-mul-171.4%
*-commutative71.4%
Simplified71.4%
if -2.75e76 < z < 3.4999999999999999e110Initial program 100.0%
Taylor expanded in z around 0 94.0%
+-commutative94.0%
Simplified94.0%
Final simplification86.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.0012) (not (<= y 2.8e-20))) (+ x (cos y)) (+ x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.0012) || !(y <= 2.8e-20)) {
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.0012d0)) .or. (.not. (y <= 2.8d-20))) 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.0012) || !(y <= 2.8e-20)) {
tmp = x + Math.cos(y);
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.0012) or not (y <= 2.8e-20): 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.0012) || !(y <= 2.8e-20)) 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.0012) || ~((y <= 2.8e-20))) 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.0012], N[Not[LessEqual[y, 2.8e-20]], $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.0012 \lor \neg \left(y \leq 2.8 \cdot 10^{-20}\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if y < -0.00119999999999999989 or 2.8000000000000003e-20 < y Initial program 99.8%
Taylor expanded in z around 0 63.7%
+-commutative63.7%
Simplified63.7%
if -0.00119999999999999989 < y < 2.8000000000000003e-20Initial 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 simplification80.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.35e-45) (not (<= x 2.6e-9))) (+ x 1.0) (cos y)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.35e-45) || !(x <= 2.6e-9)) {
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 <= (-1.35d-45)) .or. (.not. (x <= 2.6d-9))) 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 <= -1.35e-45) || !(x <= 2.6e-9)) {
tmp = x + 1.0;
} else {
tmp = Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.35e-45) or not (x <= 2.6e-9): tmp = x + 1.0 else: tmp = math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.35e-45) || !(x <= 2.6e-9)) 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 <= -1.35e-45) || ~((x <= 2.6e-9))) tmp = x + 1.0; else tmp = cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.35e-45], N[Not[LessEqual[x, 2.6e-9]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[Cos[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-45} \lor \neg \left(x \leq 2.6 \cdot 10^{-9}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;\cos y\\
\end{array}
\end{array}
if x < -1.34999999999999992e-45 or 2.6000000000000001e-9 < x Initial program 99.9%
Taylor expanded in y around 0 81.0%
+-commutative81.0%
Simplified81.0%
if -1.34999999999999992e-45 < x < 2.6000000000000001e-9Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in z around 0 64.3%
Final simplification73.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.8) (not (<= y 0.00029))) (+ x 1.0) (+ (+ x 1.0) (* y (- (* y -0.5) z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8) || !(y <= 0.00029)) {
tmp = x + 1.0;
} else {
tmp = (x + 1.0) + (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 <= (-4.8d0)) .or. (.not. (y <= 0.00029d0))) then
tmp = x + 1.0d0
else
tmp = (x + 1.0d0) + (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 <= -4.8) || !(y <= 0.00029)) {
tmp = x + 1.0;
} else {
tmp = (x + 1.0) + (y * ((y * -0.5) - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.8) or not (y <= 0.00029): tmp = x + 1.0 else: tmp = (x + 1.0) + (y * ((y * -0.5) - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.8) || !(y <= 0.00029)) tmp = Float64(x + 1.0); else tmp = Float64(Float64(x + 1.0) + Float64(y * Float64(Float64(y * -0.5) - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.8) || ~((y <= 0.00029))) tmp = x + 1.0; else tmp = (x + 1.0) + (y * ((y * -0.5) - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.8], N[Not[LessEqual[y, 0.00029]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \lor \neg \left(y \leq 0.00029\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;\left(x + 1\right) + y \cdot \left(y \cdot -0.5 - z\right)\\
\end{array}
\end{array}
if y < -4.79999999999999982 or 2.9e-4 < y Initial program 99.8%
Taylor expanded in y around 0 41.5%
+-commutative41.5%
Simplified41.5%
if -4.79999999999999982 < y < 2.9e-4Initial program 100.0%
Taylor expanded in y around 0 99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
*-commutative99.9%
unpow299.9%
associate-*l*99.9%
distribute-lft-out--99.9%
Simplified99.9%
Final simplification68.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -9.2e+19) (not (<= y 6.6e+39))) (+ x 1.0) (+ x (- 1.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9.2e+19) || !(y <= 6.6e+39)) {
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 <= (-9.2d+19)) .or. (.not. (y <= 6.6d+39))) 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 <= -9.2e+19) || !(y <= 6.6e+39)) {
tmp = x + 1.0;
} else {
tmp = x + (1.0 - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9.2e+19) or not (y <= 6.6e+39): tmp = x + 1.0 else: tmp = x + (1.0 - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9.2e+19) || !(y <= 6.6e+39)) 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 <= -9.2e+19) || ~((y <= 6.6e+39))) tmp = x + 1.0; else tmp = x + (1.0 - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.2e+19], N[Not[LessEqual[y, 6.6e+39]], $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 -9.2 \cdot 10^{+19} \lor \neg \left(y \leq 6.6 \cdot 10^{+39}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if y < -9.2e19 or 6.60000000000000042e39 < y Initial program 99.8%
Taylor expanded in y around 0 40.9%
+-commutative40.9%
Simplified40.9%
if -9.2e19 < y < 6.60000000000000042e39Initial program 100.0%
Taylor expanded in y around 0 91.7%
associate-+r+91.7%
+-commutative91.7%
associate-+l+91.7%
mul-1-neg91.7%
unsub-neg91.7%
Simplified91.7%
Final simplification68.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.6e-16) (not (<= x 4.8e-5))) (+ x 1.0) (- 1.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.6e-16) || !(x <= 4.8e-5)) {
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.6d-16)) .or. (.not. (x <= 4.8d-5))) 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.6e-16) || !(x <= 4.8e-5)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.6e-16) or not (x <= 4.8e-5): tmp = x + 1.0 else: tmp = 1.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.6e-16) || !(x <= 4.8e-5)) 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.6e-16) || ~((x <= 4.8e-5))) tmp = x + 1.0; else tmp = 1.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.6e-16], N[Not[LessEqual[x, 4.8e-5]], $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.6 \cdot 10^{-16} \lor \neg \left(x \leq 4.8 \cdot 10^{-5}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\
\end{array}
\end{array}
if x < -1.60000000000000011e-16 or 4.8000000000000001e-5 < x Initial program 99.9%
Taylor expanded in y around 0 82.8%
+-commutative82.8%
Simplified82.8%
if -1.60000000000000011e-16 < x < 4.8000000000000001e-5Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in y around 0 50.3%
mul-1-neg50.3%
unsub-neg50.3%
Simplified50.3%
Final simplification67.4%
(FPCore (x y z) :precision binary64 (if (<= x -0.96) x (if (<= x 0.135) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.96) {
tmp = x;
} else if (x <= 0.135) {
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 <= (-0.96d0)) then
tmp = x
else if (x <= 0.135d0) 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 <= -0.96) {
tmp = x;
} else if (x <= 0.135) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.96: tmp = x elif x <= 0.135: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.96) tmp = x; elseif (x <= 0.135) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.96) tmp = x; elseif (x <= 0.135) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.96], x, If[LessEqual[x, 0.135], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.96:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 0.135:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -0.95999999999999996 or 0.13500000000000001 < x Initial program 99.9%
Taylor expanded in x around inf 82.4%
if -0.95999999999999996 < x < 0.13500000000000001Initial program 99.9%
Taylor expanded in x around 0 98.9%
Taylor expanded in y around 0 40.7%
Final simplification62.2%
(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 62.7%
+-commutative62.7%
Simplified62.7%
Final simplification62.7%
(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.7%
Taylor expanded in y around 0 21.3%
Final simplification21.3%
herbie shell --seed 2024034
(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))))