
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
return (x + cos(y)) - (z * sin(y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z): return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(x + cos(y)) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (x + cos(y)) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
(FPCore (x y z) :precision binary64 (+ (cos y) (- x (* z (sin y)))))
double code(double x, double y, double z) {
return cos(y) + (x - (z * sin(y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = cos(y) + (x - (z * sin(y)))
end function
public static double code(double x, double y, double z) {
return Math.cos(y) + (x - (z * Math.sin(y)));
}
def code(x, y, z): return math.cos(y) + (x - (z * math.sin(y)))
function code(x, y, z) return Float64(cos(y) + Float64(x - Float64(z * sin(y)))) end
function tmp = code(x, y, z) tmp = cos(y) + (x - (z * sin(y))); end
code[x_, y_, z_] := N[(N[Cos[y], $MachinePrecision] + N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos y + \left(x - z \cdot \sin y\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 99.9%
associate-+r-99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= x -1.05e-11) (+ (cos y) x) (if (<= x 130000.0) (- (cos y) (* z (sin y))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e-11) {
tmp = cos(y) + x;
} else if (x <= 130000.0) {
tmp = cos(y) - (z * sin(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 <= (-1.05d-11)) then
tmp = cos(y) + x
else if (x <= 130000.0d0) then
tmp = cos(y) - (z * sin(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 <= -1.05e-11) {
tmp = Math.cos(y) + x;
} else if (x <= 130000.0) {
tmp = Math.cos(y) - (z * Math.sin(y));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.05e-11: tmp = math.cos(y) + x elif x <= 130000.0: tmp = math.cos(y) - (z * math.sin(y)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.05e-11) tmp = Float64(cos(y) + x); elseif (x <= 130000.0) tmp = Float64(cos(y) - Float64(z * sin(y))); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.05e-11) tmp = cos(y) + x; elseif (x <= 130000.0) tmp = cos(y) - (z * sin(y)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.05e-11], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], If[LessEqual[x, 130000.0], N[(N[Cos[y], $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;\cos y + x\\
\mathbf{elif}\;x \leq 130000:\\
\;\;\;\;\cos y - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -1.0499999999999999e-11Initial program 99.9%
Taylor expanded in z around 0 83.9%
if -1.0499999999999999e-11 < x < 1.3e5Initial program 99.9%
Taylor expanded in x around 0 99.3%
if 1.3e5 < x Initial program 100.0%
Taylor expanded in y around 0 86.7%
+-commutative86.7%
Simplified86.7%
Final simplification92.8%
(FPCore (x y z) :precision binary64 (if (<= z -1.46e+106) (+ 1.0 (- x (* y z))) (if (<= z 3.7e+101) (+ (cos y) x) (* (sin y) (- z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.46e+106) {
tmp = 1.0 + (x - (y * z));
} else if (z <= 3.7e+101) {
tmp = cos(y) + x;
} else {
tmp = 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 (z <= (-1.46d+106)) then
tmp = 1.0d0 + (x - (y * z))
else if (z <= 3.7d+101) then
tmp = cos(y) + x
else
tmp = sin(y) * -z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.46e+106) {
tmp = 1.0 + (x - (y * z));
} else if (z <= 3.7e+101) {
tmp = Math.cos(y) + x;
} else {
tmp = Math.sin(y) * -z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.46e+106: tmp = 1.0 + (x - (y * z)) elif z <= 3.7e+101: tmp = math.cos(y) + x else: tmp = math.sin(y) * -z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.46e+106) tmp = Float64(1.0 + Float64(x - Float64(y * z))); elseif (z <= 3.7e+101) tmp = Float64(cos(y) + x); else tmp = Float64(sin(y) * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.46e+106) tmp = 1.0 + (x - (y * z)); elseif (z <= 3.7e+101) tmp = cos(y) + x; else tmp = sin(y) * -z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.46e+106], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+101], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{+106}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+101}:\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\end{array}
\end{array}
if z < -1.46000000000000005e106Initial program 100.0%
Taylor expanded in x around 0 100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in y around 0 67.7%
+-commutative67.7%
mul-1-neg67.7%
unsub-neg67.7%
Simplified67.7%
if -1.46000000000000005e106 < z < 3.6999999999999997e101Initial program 99.9%
Taylor expanded in z around 0 93.4%
if 3.6999999999999997e101 < z Initial program 99.7%
Taylor expanded in z around inf 79.9%
associate-*r*79.9%
neg-mul-179.9%
*-commutative79.9%
Simplified79.9%
Final simplification87.3%
(FPCore (x y z)
:precision binary64
(if (<= y -2.5e+29)
(+ x 1.0)
(if (<= y 4500000000.0)
(+ 1.0 (- x (* y z)))
(if (<= y 9e+69) (cos y) (+ x 1.0)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.5e+29) {
tmp = x + 1.0;
} else if (y <= 4500000000.0) {
tmp = 1.0 + (x - (y * z));
} else if (y <= 9e+69) {
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 (y <= (-2.5d+29)) then
tmp = x + 1.0d0
else if (y <= 4500000000.0d0) then
tmp = 1.0d0 + (x - (y * z))
else if (y <= 9d+69) 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 (y <= -2.5e+29) {
tmp = x + 1.0;
} else if (y <= 4500000000.0) {
tmp = 1.0 + (x - (y * z));
} else if (y <= 9e+69) {
tmp = Math.cos(y);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.5e+29: tmp = x + 1.0 elif y <= 4500000000.0: tmp = 1.0 + (x - (y * z)) elif y <= 9e+69: tmp = math.cos(y) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.5e+29) tmp = Float64(x + 1.0); elseif (y <= 4500000000.0) tmp = Float64(1.0 + Float64(x - Float64(y * z))); elseif (y <= 9e+69) tmp = cos(y); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.5e+29) tmp = x + 1.0; elseif (y <= 4500000000.0) tmp = 1.0 + (x - (y * z)); elseif (y <= 9e+69) tmp = cos(y); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.5e+29], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 4500000000.0], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+69], N[Cos[y], $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+29}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 4500000000:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+69}:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -2.5e29 or 8.9999999999999999e69 < y Initial program 99.8%
Taylor expanded in y around 0 43.8%
+-commutative43.8%
Simplified43.8%
if -2.5e29 < y < 4.5e9Initial program 100.0%
Taylor expanded in x around 0 100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in y around 0 95.1%
+-commutative95.1%
mul-1-neg95.1%
unsub-neg95.1%
Simplified95.1%
if 4.5e9 < y < 8.9999999999999999e69Initial program 99.7%
add-log-exp62.7%
associate--l+62.7%
Applied egg-rr62.7%
Taylor expanded in x around 0 59.5%
Taylor expanded in z around 0 55.3%
Final simplification74.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -7.7e+18) (not (<= y 0.0065))) (+ (cos y) x) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7.7e+18) || !(y <= 0.0065)) {
tmp = cos(y) + x;
} 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 <= (-7.7d+18)) .or. (.not. (y <= 0.0065d0))) then
tmp = cos(y) + x
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 <= -7.7e+18) || !(y <= 0.0065)) {
tmp = Math.cos(y) + x;
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7.7e+18) or not (y <= 0.0065): tmp = math.cos(y) + x else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7.7e+18) || !(y <= 0.0065)) tmp = Float64(cos(y) + x); 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 <= -7.7e+18) || ~((y <= 0.0065))) tmp = cos(y) + x; else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.7e+18], N[Not[LessEqual[y, 0.0065]], $MachinePrecision]], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.7 \cdot 10^{+18} \lor \neg \left(y \leq 0.0065\right):\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -7.7e18 or 0.0064999999999999997 < y Initial program 99.8%
Taylor expanded in z around 0 61.0%
if -7.7e18 < y < 0.0064999999999999997Initial program 100.0%
Taylor expanded in x around 0 100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in y around 0 97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.3%
Final simplification81.8%
(FPCore (x y z) :precision binary64 (if (<= y -1.25e+29) (+ x 1.0) (if (<= y 1.36e+59) (+ 1.0 (- x (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.25e+29) {
tmp = x + 1.0;
} else if (y <= 1.36e+59) {
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.25d+29)) then
tmp = x + 1.0d0
else if (y <= 1.36d+59) 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.25e+29) {
tmp = x + 1.0;
} else if (y <= 1.36e+59) {
tmp = 1.0 + (x - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.25e+29: tmp = x + 1.0 elif y <= 1.36e+59: tmp = 1.0 + (x - (y * z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.25e+29) tmp = Float64(x + 1.0); elseif (y <= 1.36e+59) 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.25e+29) tmp = x + 1.0; elseif (y <= 1.36e+59) tmp = 1.0 + (x - (y * z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.25e+29], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 1.36e+59], 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.25 \cdot 10^{+29}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+59}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -1.25e29 or 1.36e59 < y Initial program 99.8%
Taylor expanded in y around 0 43.3%
+-commutative43.3%
Simplified43.3%
if -1.25e29 < y < 1.36e59Initial program 100.0%
Taylor expanded in x around 0 100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in y around 0 90.7%
+-commutative90.7%
mul-1-neg90.7%
unsub-neg90.7%
Simplified90.7%
Final simplification72.8%
(FPCore (x y z) :precision binary64 (if (<= x -1.95e-29) (+ x 1.0) (if (<= x 2.55e-33) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.95e-29) {
tmp = x + 1.0;
} else if (x <= 2.55e-33) {
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 <= (-1.95d-29)) then
tmp = x + 1.0d0
else if (x <= 2.55d-33) 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 <= -1.95e-29) {
tmp = x + 1.0;
} else if (x <= 2.55e-33) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.95e-29: tmp = x + 1.0 elif x <= 2.55e-33: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.95e-29) tmp = Float64(x + 1.0); elseif (x <= 2.55e-33) 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 <= -1.95e-29) tmp = x + 1.0; elseif (x <= 2.55e-33) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.95e-29], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 2.55e-33], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{-29}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-33}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -1.9499999999999999e-29 or 2.55000000000000004e-33 < x Initial program 99.9%
Taylor expanded in y around 0 80.6%
+-commutative80.6%
Simplified80.6%
if -1.9499999999999999e-29 < x < 2.55000000000000004e-33Initial program 99.9%
add-log-exp64.9%
associate--l+64.9%
Applied egg-rr64.9%
Taylor expanded in x around 0 64.9%
Taylor expanded in y around 0 62.7%
mul-1-neg62.7%
unsub-neg62.7%
Simplified62.7%
Final simplification72.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.7e-10) x (if (<= x 125000.0) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.7e-10) {
tmp = x;
} else if (x <= 125000.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 <= (-1.7d-10)) then
tmp = x
else if (x <= 125000.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 <= -1.7e-10) {
tmp = x;
} else if (x <= 125000.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.7e-10: tmp = x elif x <= 125000.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.7e-10) tmp = x; elseif (x <= 125000.0) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.7e-10) tmp = x; elseif (x <= 125000.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.7e-10], x, If[LessEqual[x, 125000.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 125000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.70000000000000007e-10 or 125000 < x Initial program 99.9%
Taylor expanded in x around inf 84.0%
if -1.70000000000000007e-10 < x < 125000Initial program 99.9%
add-log-exp65.5%
associate--l+65.5%
Applied egg-rr65.5%
Taylor expanded in x around 0 64.7%
Taylor expanded in y around 0 46.9%
Final simplification63.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 64.3%
+-commutative64.3%
Simplified64.3%
Final simplification64.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%
add-log-exp38.7%
associate--l+38.7%
Applied egg-rr38.7%
Taylor expanded in x around 0 36.9%
Taylor expanded in y around 0 26.8%
Final simplification26.8%
herbie shell --seed 2023174
(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))))