
(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%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(if (<= x -1.0)
(- x t_0)
(if (<= x 2.5e-12) (- (cos y) t_0) (* x (- 1.0 (* z (/ (sin y) x))))))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double tmp;
if (x <= -1.0) {
tmp = x - t_0;
} else if (x <= 2.5e-12) {
tmp = cos(y) - t_0;
} else {
tmp = x * (1.0 - (z * (sin(y) / 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) :: t_0
real(8) :: tmp
t_0 = z * sin(y)
if (x <= (-1.0d0)) then
tmp = x - t_0
else if (x <= 2.5d-12) then
tmp = cos(y) - t_0
else
tmp = x * (1.0d0 - (z * (sin(y) / x)))
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 (x <= -1.0) {
tmp = x - t_0;
} else if (x <= 2.5e-12) {
tmp = Math.cos(y) - t_0;
} else {
tmp = x * (1.0 - (z * (Math.sin(y) / x)));
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) tmp = 0 if x <= -1.0: tmp = x - t_0 elif x <= 2.5e-12: tmp = math.cos(y) - t_0 else: tmp = x * (1.0 - (z * (math.sin(y) / x))) return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) tmp = 0.0 if (x <= -1.0) tmp = Float64(x - t_0); elseif (x <= 2.5e-12) tmp = Float64(cos(y) - t_0); else tmp = Float64(x * Float64(1.0 - Float64(z * Float64(sin(y) / x)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); tmp = 0.0; if (x <= -1.0) tmp = x - t_0; elseif (x <= 2.5e-12) tmp = cos(y) - t_0; else tmp = x * (1.0 - (z * (sin(y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(x - t$95$0), $MachinePrecision], If[LessEqual[x, 2.5e-12], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], N[(x * N[(1.0 - N[(z * N[(N[Sin[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;x - t\_0\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-12}:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z \cdot \frac{\sin y}{x}\right)\\
\end{array}
\end{array}
if x < -1Initial program 99.9%
Taylor expanded in x around inf 99.8%
associate--l+99.9%
div-sub99.9%
Simplified99.9%
Taylor expanded in z around inf 98.8%
mul-1-neg98.8%
*-commutative98.8%
associate-/l*98.8%
distribute-rgt-neg-in98.8%
distribute-neg-frac298.8%
Simplified98.8%
Taylor expanded in x around 0 98.9%
associate-*r*98.9%
mul-1-neg98.9%
cancel-sign-sub-inv98.9%
Simplified98.9%
if -1 < x < 2.49999999999999985e-12Initial program 99.8%
Taylor expanded in x around 0 99.6%
if 2.49999999999999985e-12 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
associate--l+100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in z around inf 96.7%
mul-1-neg96.7%
*-commutative96.7%
associate-/l*96.7%
distribute-rgt-neg-in96.7%
distribute-neg-frac296.7%
Simplified96.7%
Taylor expanded in x around inf 96.7%
mul-1-neg96.7%
*-commutative96.7%
associate-*r/96.7%
unsub-neg96.7%
associate-*r/96.7%
*-commutative96.7%
associate-/l*96.7%
Simplified96.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -7.5e+59) (not (<= z 7.7e+37))) (- x (* z (sin y))) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.5e+59) || !(z <= 7.7e+37)) {
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 <= (-7.5d+59)) .or. (.not. (z <= 7.7d+37))) 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 <= -7.5e+59) || !(z <= 7.7e+37)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.5e+59) or not (z <= 7.7e+37): tmp = x - (z * math.sin(y)) else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.5e+59) || !(z <= 7.7e+37)) 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 <= -7.5e+59) || ~((z <= 7.7e+37))) tmp = x - (z * sin(y)); else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.5e+59], N[Not[LessEqual[z, 7.7e+37]], $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 -7.5 \cdot 10^{+59} \lor \neg \left(z \leq 7.7 \cdot 10^{+37}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -7.4999999999999996e59 or 7.70000000000000022e37 < z Initial program 99.8%
Taylor expanded in x around inf 83.2%
associate--l+83.2%
div-sub83.2%
Simplified83.2%
Taylor expanded in z around inf 72.8%
mul-1-neg72.8%
*-commutative72.8%
associate-/l*69.3%
distribute-rgt-neg-in69.3%
distribute-neg-frac269.3%
Simplified69.3%
Taylor expanded in x around 0 89.4%
associate-*r*89.4%
mul-1-neg89.4%
cancel-sign-sub-inv89.4%
Simplified89.4%
if -7.4999999999999996e59 < z < 7.70000000000000022e37Initial program 100.0%
Taylor expanded in z around 0 98.3%
+-commutative98.3%
Simplified98.3%
Final simplification93.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -6e+101) (not (<= z 1.5e+161))) (* (sin y) (- z)) (+ x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6e+101) || !(z <= 1.5e+161)) {
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 <= (-6d+101)) .or. (.not. (z <= 1.5d+161))) 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 <= -6e+101) || !(z <= 1.5e+161)) {
tmp = Math.sin(y) * -z;
} else {
tmp = x + Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6e+101) or not (z <= 1.5e+161): tmp = math.sin(y) * -z else: tmp = x + math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6e+101) || !(z <= 1.5e+161)) 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 <= -6e+101) || ~((z <= 1.5e+161))) tmp = sin(y) * -z; else tmp = x + cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6e+101], N[Not[LessEqual[z, 1.5e+161]], $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 -6 \cdot 10^{+101} \lor \neg \left(z \leq 1.5 \cdot 10^{+161}\right):\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \cos y\\
\end{array}
\end{array}
if z < -5.99999999999999986e101 or 1.50000000000000006e161 < z Initial program 99.8%
Taylor expanded in z around inf 69.9%
associate-*r*69.9%
neg-mul-169.9%
*-commutative69.9%
Simplified69.9%
if -5.99999999999999986e101 < z < 1.50000000000000006e161Initial program 99.9%
Taylor expanded in z around 0 89.5%
+-commutative89.5%
Simplified89.5%
Final simplification83.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.34) (not (<= y 5.8e+45))) (+ x (cos y)) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.34) || !(y <= 5.8e+45)) {
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.34d0)) .or. (.not. (y <= 5.8d+45))) 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.34) || !(y <= 5.8e+45)) {
tmp = x + Math.cos(y);
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.34) or not (y <= 5.8e+45): 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.34) || !(y <= 5.8e+45)) 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.34) || ~((y <= 5.8e+45))) 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.34], N[Not[LessEqual[y, 5.8e+45]], $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.34 \lor \neg \left(y \leq 5.8 \cdot 10^{+45}\right):\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -0.340000000000000024 or 5.7999999999999994e45 < y Initial program 99.8%
Taylor expanded in z around 0 61.2%
+-commutative61.2%
Simplified61.2%
if -0.340000000000000024 < y < 5.7999999999999994e45Initial program 100.0%
Taylor expanded in y around 0 95.9%
mul-1-neg95.9%
unsub-neg95.9%
Simplified95.9%
Final simplification79.8%
(FPCore (x y z)
:precision binary64
(if (<= y -90.0)
(+ x 1.0)
(if (<= y 3.1e+51)
(+ 1.0 (+ x (* y (- (* y -0.5) z))))
(* x (+ 1.0 (/ 1.0 x))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -90.0) {
tmp = x + 1.0;
} else if (y <= 3.1e+51) {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
} else {
tmp = x * (1.0 + (1.0 / 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 (y <= (-90.0d0)) then
tmp = x + 1.0d0
else if (y <= 3.1d+51) then
tmp = 1.0d0 + (x + (y * ((y * (-0.5d0)) - z)))
else
tmp = x * (1.0d0 + (1.0d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -90.0) {
tmp = x + 1.0;
} else if (y <= 3.1e+51) {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
} else {
tmp = x * (1.0 + (1.0 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -90.0: tmp = x + 1.0 elif y <= 3.1e+51: tmp = 1.0 + (x + (y * ((y * -0.5) - z))) else: tmp = x * (1.0 + (1.0 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -90.0) tmp = Float64(x + 1.0); elseif (y <= 3.1e+51) tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * -0.5) - z)))); else tmp = Float64(x * Float64(1.0 + Float64(1.0 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -90.0) tmp = x + 1.0; elseif (y <= 3.1e+51) tmp = 1.0 + (x + (y * ((y * -0.5) - z))); else tmp = x * (1.0 + (1.0 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -90.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 3.1e+51], N[(1.0 + N[(x + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -90:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+51}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\
\end{array}
\end{array}
if y < -90Initial program 99.9%
Taylor expanded in y around 0 50.7%
+-commutative50.7%
Simplified50.7%
if -90 < y < 3.10000000000000011e51Initial program 100.0%
Taylor expanded in y around 0 95.3%
if 3.10000000000000011e51 < y Initial program 99.7%
Taylor expanded in x around inf 88.1%
associate--l+88.1%
div-sub88.1%
Simplified88.1%
Taylor expanded in y around 0 33.7%
Final simplification71.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -23000.0) (not (<= y 1.62e+47))) (+ x 1.0) (+ 1.0 (- x (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -23000.0) || !(y <= 1.62e+47)) {
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 <= (-23000.0d0)) .or. (.not. (y <= 1.62d+47))) 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 <= -23000.0) || !(y <= 1.62e+47)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -23000.0) or not (y <= 1.62e+47): tmp = x + 1.0 else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -23000.0) || !(y <= 1.62e+47)) 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 <= -23000.0) || ~((y <= 1.62e+47))) tmp = x + 1.0; else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -23000.0], N[Not[LessEqual[y, 1.62e+47]], $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 -23000 \lor \neg \left(y \leq 1.62 \cdot 10^{+47}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if y < -23000 or 1.6200000000000001e47 < y Initial program 99.8%
Taylor expanded in y around 0 44.0%
+-commutative44.0%
Simplified44.0%
if -23000 < y < 1.6200000000000001e47Initial program 100.0%
Taylor expanded in y around 0 94.8%
mul-1-neg94.8%
unsub-neg94.8%
Simplified94.8%
Final simplification71.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.00031) (not (<= x 1.55))) (+ x 1.0) (- 1.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.00031) || !(x <= 1.55)) {
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 <= (-0.00031d0)) .or. (.not. (x <= 1.55d0))) 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 <= -0.00031) || !(x <= 1.55)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.00031) or not (x <= 1.55): tmp = x + 1.0 else: tmp = 1.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.00031) || !(x <= 1.55)) 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 <= -0.00031) || ~((x <= 1.55))) tmp = x + 1.0; else tmp = 1.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.00031], N[Not[LessEqual[x, 1.55]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00031 \lor \neg \left(x \leq 1.55\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\
\end{array}
\end{array}
if x < -3.1e-4 or 1.55000000000000004 < x Initial program 100.0%
Taylor expanded in y around 0 84.6%
+-commutative84.6%
Simplified84.6%
if -3.1e-4 < x < 1.55000000000000004Initial program 99.9%
Taylor expanded in x around inf 83.3%
associate--l+83.3%
div-sub83.3%
Simplified83.3%
Taylor expanded in y around 0 49.1%
+-commutative49.1%
mul-1-neg49.1%
unsub-neg49.1%
associate-/l*41.4%
Simplified41.4%
Taylor expanded in x around 0 53.0%
Final simplification69.0%
(FPCore (x y z) :precision binary64 (if (<= z -3.7e+235) (* z (- y)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.7e+235) {
tmp = z * -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 (z <= (-3.7d+235)) then
tmp = z * -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 (z <= -3.7e+235) {
tmp = z * -y;
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.7e+235: tmp = z * -y else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.7e+235) tmp = Float64(z * Float64(-y)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.7e+235) tmp = z * -y; else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.7e+235], N[(z * (-y)), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+235}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -3.6999999999999998e235Initial program 99.9%
Taylor expanded in x around inf 68.5%
associate--l+68.5%
div-sub68.5%
Simplified68.5%
Taylor expanded in y around 0 37.1%
+-commutative37.1%
mul-1-neg37.1%
unsub-neg37.1%
associate-/l*29.2%
Simplified29.2%
Taylor expanded in y around inf 45.1%
neg-mul-145.1%
distribute-rgt-neg-in45.1%
Simplified45.1%
if -3.6999999999999998e235 < z Initial program 99.9%
Taylor expanded in y around 0 64.6%
+-commutative64.6%
Simplified64.6%
Final simplification63.7%
(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.1%
+-commutative62.1%
Simplified62.1%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf 44.0%
herbie shell --seed 2024085
(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))))