
(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 (fma (sin y) (- z) (+ x (cos y))))
double code(double x, double y, double z) {
return fma(sin(y), -z, (x + cos(y)));
}
function code(x, y, z) return fma(sin(y), Float64(-z), Float64(x + cos(y))) end
code[x_, y_, z_] := N[(N[Sin[y], $MachinePrecision] * (-z) + N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\sin y, -z, x + \cos y\right)
\end{array}
Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -410000000.0) (not (<= x 135000.0))) (+ x (cos y)) (- (cos y) (* (sin y) z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -410000000.0) || !(x <= 135000.0)) {
tmp = x + cos(y);
} else {
tmp = cos(y) - (sin(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 <= (-410000000.0d0)) .or. (.not. (x <= 135000.0d0))) then
tmp = x + cos(y)
else
tmp = cos(y) - (sin(y) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -410000000.0) || !(x <= 135000.0)) {
tmp = x + Math.cos(y);
} else {
tmp = Math.cos(y) - (Math.sin(y) * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -410000000.0) or not (x <= 135000.0): tmp = x + math.cos(y) else: tmp = math.cos(y) - (math.sin(y) * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -410000000.0) || !(x <= 135000.0)) tmp = Float64(x + cos(y)); else tmp = Float64(cos(y) - Float64(sin(y) * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -410000000.0) || ~((x <= 135000.0))) tmp = x + cos(y); else tmp = cos(y) - (sin(y) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -410000000.0], N[Not[LessEqual[x, 135000.0]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -410000000 \lor \neg \left(x \leq 135000\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;\cos y - \sin y \cdot z\\
\end{array}
\end{array}
if x < -4.1e8 or 135000 < x Initial program 100.0%
Taylor expanded in z around 0 79.8%
if -4.1e8 < x < 135000Initial program 99.9%
Taylor expanded in x around 0 98.2%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* (sin y) z)))
double code(double x, double y, double z) {
return (x + cos(y)) - (sin(y) * z);
}
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)) - (sin(y) * z)
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (Math.sin(y) * z);
}
def code(x, y, z): return (x + math.cos(y)) - (math.sin(y) * z)
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(sin(y) * z)) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (sin(y) * z); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - \sin y \cdot z
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.4e+138) (not (<= z 9.5e+141))) (* (sin y) (- z)) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.4e+138) || !(z <= 9.5e+141)) {
tmp = sin(y) * -z;
} 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.4d+138)) .or. (.not. (z <= 9.5d+141))) then
tmp = sin(y) * -z
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.4e+138) || !(z <= 9.5e+141)) {
tmp = Math.sin(y) * -z;
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.4e+138) or not (z <= 9.5e+141): tmp = math.sin(y) * -z else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.4e+138) || !(z <= 9.5e+141)) tmp = Float64(sin(y) * Float64(-z)); else tmp = Float64(x + cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.4e+138) || ~((z <= 9.5e+141))) tmp = sin(y) * -z; else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.4e+138], N[Not[LessEqual[z, 9.5e+141]], $MachinePrecision]], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+138} \lor \neg \left(z \leq 9.5 \cdot 10^{+141}\right):\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -2.4000000000000001e138 or 9.49999999999999974e141 < z Initial program 99.8%
Taylor expanded in z around inf 79.6%
associate-*r*79.6%
neg-mul-179.6%
*-commutative79.6%
Simplified79.6%
if -2.4000000000000001e138 < z < 9.49999999999999974e141Initial program 100.0%
Taylor expanded in z around 0 87.9%
Final simplification85.6%
(FPCore (x y z)
:precision binary64
(if (<= x -15200000000.0)
(+ x 1.0)
(if (<= x -2.8e-127)
(+ 1.0 (- x (* y z)))
(if (<= x 0.092) (cos y) (+ x 1.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -15200000000.0) {
tmp = x + 1.0;
} else if (x <= -2.8e-127) {
tmp = 1.0 + (x - (y * z));
} else if (x <= 0.092) {
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 <= (-15200000000.0d0)) then
tmp = x + 1.0d0
else if (x <= (-2.8d-127)) then
tmp = 1.0d0 + (x - (y * z))
else if (x <= 0.092d0) 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 <= -15200000000.0) {
tmp = x + 1.0;
} else if (x <= -2.8e-127) {
tmp = 1.0 + (x - (y * z));
} else if (x <= 0.092) {
tmp = Math.cos(y);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -15200000000.0: tmp = x + 1.0 elif x <= -2.8e-127: tmp = 1.0 + (x - (y * z)) elif x <= 0.092: tmp = math.cos(y) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -15200000000.0) tmp = Float64(x + 1.0); elseif (x <= -2.8e-127) tmp = Float64(1.0 + Float64(x - Float64(y * z))); elseif (x <= 0.092) 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 <= -15200000000.0) tmp = x + 1.0; elseif (x <= -2.8e-127) tmp = 1.0 + (x - (y * z)); elseif (x <= 0.092) tmp = cos(y); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -15200000000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, -2.8e-127], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.092], N[Cos[y], $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -15200000000:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-127}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{elif}\;x \leq 0.092:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -1.52e10 or 0.091999999999999998 < x Initial program 100.0%
Taylor expanded in y around 0 79.5%
+-commutative79.5%
Simplified79.5%
if -1.52e10 < x < -2.8e-127Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 64.5%
+-commutative64.5%
mul-1-neg64.5%
unsub-neg64.5%
Simplified64.5%
if -2.8e-127 < x < 0.091999999999999998Initial program 99.9%
Taylor expanded in x around 0 99.9%
add-cube-cbrt99.2%
pow399.2%
Applied egg-rr99.2%
rem-cube-cbrt99.9%
*-commutative99.9%
add-sqr-sqrt53.3%
associate-*r*53.3%
Applied egg-rr53.3%
Taylor expanded in z around 0 62.4%
Final simplification71.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.55e-8) (not (<= y 0.34))) (+ x (cos y)) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.55e-8) || !(y <= 0.34)) {
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 <= (-2.55d-8)) .or. (.not. (y <= 0.34d0))) 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 <= -2.55e-8) || !(y <= 0.34)) {
tmp = x + Math.cos(y);
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.55e-8) or not (y <= 0.34): tmp = x + math.cos(y) else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.55e-8) || !(y <= 0.34)) 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 <= -2.55e-8) || ~((y <= 0.34))) tmp = x + cos(y); else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.55e-8], N[Not[LessEqual[y, 0.34]], $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 -2.55 \cdot 10^{-8} \lor \neg \left(y \leq 0.34\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -2.55e-8 or 0.340000000000000024 < y Initial program 99.8%
Taylor expanded in z around 0 52.9%
if -2.55e-8 < y < 0.340000000000000024Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 99.5%
+-commutative99.5%
mul-1-neg99.5%
unsub-neg99.5%
Simplified99.5%
Final simplification77.5%
(FPCore (x y z) :precision binary64 (if (<= y -1.55e+94) (+ x 1.0) (if (<= y 5.3e+91) (+ 1.0 (- x (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.55e+94) {
tmp = x + 1.0;
} else if (y <= 5.3e+91) {
tmp = 1.0 + (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 (y <= (-1.55d+94)) then
tmp = x + 1.0d0
else if (y <= 5.3d+91) then
tmp = 1.0d0 + (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 (y <= -1.55e+94) {
tmp = x + 1.0;
} else if (y <= 5.3e+91) {
tmp = 1.0 + (x - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.55e+94: tmp = x + 1.0 elif y <= 5.3e+91: tmp = 1.0 + (x - (y * z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.55e+94) tmp = Float64(x + 1.0); elseif (y <= 5.3e+91) tmp = Float64(1.0 + 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 (y <= -1.55e+94) tmp = x + 1.0; elseif (y <= 5.3e+91) tmp = 1.0 + (x - (y * z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.55e+94], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 5.3e+91], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+94}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{+91}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -1.54999999999999996e94 or 5.29999999999999997e91 < y Initial program 99.8%
Taylor expanded in y around 0 32.9%
+-commutative32.9%
Simplified32.9%
if -1.54999999999999996e94 < y < 5.29999999999999997e91Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 85.3%
+-commutative85.3%
mul-1-neg85.3%
unsub-neg85.3%
Simplified85.3%
Final simplification68.3%
(FPCore (x y z) :precision binary64 (if (<= x -2.2e-12) (+ x 1.0) (if (<= x 1.25e-10) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.2e-12) {
tmp = x + 1.0;
} else if (x <= 1.25e-10) {
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 <= (-2.2d-12)) then
tmp = x + 1.0d0
else if (x <= 1.25d-10) 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 <= -2.2e-12) {
tmp = x + 1.0;
} else if (x <= 1.25e-10) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.2e-12: tmp = x + 1.0 elif x <= 1.25e-10: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.2e-12) tmp = Float64(x + 1.0); elseif (x <= 1.25e-10) 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 <= -2.2e-12) tmp = x + 1.0; elseif (x <= 1.25e-10) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.2e-12], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 1.25e-10], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-12}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-10}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -2.19999999999999992e-12 or 1.25000000000000008e-10 < x Initial program 100.0%
Taylor expanded in y around 0 77.2%
+-commutative77.2%
Simplified77.2%
if -2.19999999999999992e-12 < x < 1.25000000000000008e-10Initial program 99.9%
Taylor expanded in x around 0 99.9%
add-cube-cbrt99.2%
pow399.2%
Applied egg-rr99.2%
rem-cube-cbrt99.9%
*-commutative99.9%
add-sqr-sqrt53.1%
associate-*r*53.1%
Applied egg-rr53.1%
Taylor expanded in y around 0 54.6%
mul-1-neg54.6%
unsub-neg54.6%
Simplified54.6%
Final simplification66.4%
(FPCore (x y z) :precision binary64 (if (<= x -0.28) x (if (<= x 3.9e-35) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.28) {
tmp = x;
} else if (x <= 3.9e-35) {
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.28d0)) then
tmp = x
else if (x <= 3.9d-35) 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.28) {
tmp = x;
} else if (x <= 3.9e-35) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.28: tmp = x elif x <= 3.9e-35: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.28) tmp = x; elseif (x <= 3.9e-35) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.28) tmp = x; elseif (x <= 3.9e-35) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.28], x, If[LessEqual[x, 3.9e-35], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.28:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-35}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -0.28000000000000003 or 3.8999999999999998e-35 < x Initial program 100.0%
Taylor expanded in x around inf 73.2%
if -0.28000000000000003 < x < 3.8999999999999998e-35Initial program 99.9%
Taylor expanded in x around 0 98.9%
add-cube-cbrt98.2%
pow398.2%
Applied egg-rr98.2%
rem-cube-cbrt98.9%
*-commutative98.9%
add-sqr-sqrt53.2%
associate-*r*53.3%
Applied egg-rr53.3%
Taylor expanded in y around 0 43.9%
Final simplification59.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%
Taylor expanded in y around 0 60.3%
+-commutative60.3%
Simplified60.3%
Final simplification60.3%
(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 61.1%
add-cube-cbrt60.6%
pow360.5%
Applied egg-rr60.5%
rem-cube-cbrt61.1%
*-commutative61.1%
add-sqr-sqrt31.2%
associate-*r*31.2%
Applied egg-rr31.2%
Taylor expanded in y around 0 22.2%
Final simplification22.2%
herbie shell --seed 2023200
(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))))