
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
return (x + sin(y)) + (z * cos(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 + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z): return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z) return Float64(Float64(x + sin(y)) + Float64(z * cos(y))) end
function tmp = code(x, y, z) tmp = (x + sin(y)) + (z * cos(y)); end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}
(FPCore (x y z) :precision binary64 (+ (* z (cos y)) (+ x (sin y))))
double code(double x, double y, double z) {
return (z * cos(y)) + (x + 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 = (z * cos(y)) + (x + sin(y))
end function
public static double code(double x, double y, double z) {
return (z * Math.cos(y)) + (x + Math.sin(y));
}
def code(x, y, z): return (z * math.cos(y)) + (x + math.sin(y))
function code(x, y, z) return Float64(Float64(z * cos(y)) + Float64(x + sin(y))) end
function tmp = code(x, y, z) tmp = (z * cos(y)) + (x + sin(y)); end
code[x_, y_, z_] := N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \cos y + \left(x + \sin y\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -4e+169)
t_0
(if (<= z -1.75e-134)
(+ x z)
(if (<= z -4.2e-257) (sin y) (if (<= z 1.12e+104) (+ x z) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -4e+169) {
tmp = t_0;
} else if (z <= -1.75e-134) {
tmp = x + z;
} else if (z <= -4.2e-257) {
tmp = sin(y);
} else if (z <= 1.12e+104) {
tmp = x + z;
} 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 * cos(y)
if (z <= (-4d+169)) then
tmp = t_0
else if (z <= (-1.75d-134)) then
tmp = x + z
else if (z <= (-4.2d-257)) then
tmp = sin(y)
else if (z <= 1.12d+104) then
tmp = x + z
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.cos(y);
double tmp;
if (z <= -4e+169) {
tmp = t_0;
} else if (z <= -1.75e-134) {
tmp = x + z;
} else if (z <= -4.2e-257) {
tmp = Math.sin(y);
} else if (z <= 1.12e+104) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -4e+169: tmp = t_0 elif z <= -1.75e-134: tmp = x + z elif z <= -4.2e-257: tmp = math.sin(y) elif z <= 1.12e+104: tmp = x + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -4e+169) tmp = t_0; elseif (z <= -1.75e-134) tmp = Float64(x + z); elseif (z <= -4.2e-257) tmp = sin(y); elseif (z <= 1.12e+104) tmp = Float64(x + z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -4e+169) tmp = t_0; elseif (z <= -1.75e-134) tmp = x + z; elseif (z <= -4.2e-257) tmp = sin(y); elseif (z <= 1.12e+104) tmp = x + z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+169], t$95$0, If[LessEqual[z, -1.75e-134], N[(x + z), $MachinePrecision], If[LessEqual[z, -4.2e-257], N[Sin[y], $MachinePrecision], If[LessEqual[z, 1.12e+104], N[(x + z), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -4 \cdot 10^{+169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-134}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-257}:\\
\;\;\;\;\sin y\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+104}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.99999999999999974e169 or 1.12000000000000003e104 < z Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6483.3%
Simplified83.3%
if -3.99999999999999974e169 < z < -1.7499999999999999e-134 or -4.2000000000000002e-257 < z < 1.12000000000000003e104Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6474.8%
Simplified74.8%
if -1.7499999999999999e-134 < z < -4.2000000000000002e-257Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6496.4%
Simplified96.4%
Taylor expanded in x around 0
sin-lowering-sin.f6478.7%
Simplified78.7%
Final simplification77.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (sin y))))
(if (<= y -6.2e+76)
t_0
(if (<= y -165.0)
(* z (cos y))
(if (<= y 1.05)
(+
(+ x (* y (+ 1.0 (* y (* y -0.16666666666666666)))))
(+ z (* (* y (* y z)) (+ -0.5 (* y (* y 0.041666666666666664))))))
t_0)))))
double code(double x, double y, double z) {
double t_0 = x + sin(y);
double tmp;
if (y <= -6.2e+76) {
tmp = t_0;
} else if (y <= -165.0) {
tmp = z * cos(y);
} else if (y <= 1.05) {
tmp = (x + (y * (1.0 + (y * (y * -0.16666666666666666))))) + (z + ((y * (y * z)) * (-0.5 + (y * (y * 0.041666666666666664)))));
} 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 = x + sin(y)
if (y <= (-6.2d+76)) then
tmp = t_0
else if (y <= (-165.0d0)) then
tmp = z * cos(y)
else if (y <= 1.05d0) then
tmp = (x + (y * (1.0d0 + (y * (y * (-0.16666666666666666d0)))))) + (z + ((y * (y * z)) * ((-0.5d0) + (y * (y * 0.041666666666666664d0)))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + Math.sin(y);
double tmp;
if (y <= -6.2e+76) {
tmp = t_0;
} else if (y <= -165.0) {
tmp = z * Math.cos(y);
} else if (y <= 1.05) {
tmp = (x + (y * (1.0 + (y * (y * -0.16666666666666666))))) + (z + ((y * (y * z)) * (-0.5 + (y * (y * 0.041666666666666664)))));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + math.sin(y) tmp = 0 if y <= -6.2e+76: tmp = t_0 elif y <= -165.0: tmp = z * math.cos(y) elif y <= 1.05: tmp = (x + (y * (1.0 + (y * (y * -0.16666666666666666))))) + (z + ((y * (y * z)) * (-0.5 + (y * (y * 0.041666666666666664))))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + sin(y)) tmp = 0.0 if (y <= -6.2e+76) tmp = t_0; elseif (y <= -165.0) tmp = Float64(z * cos(y)); elseif (y <= 1.05) tmp = Float64(Float64(x + Float64(y * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666))))) + Float64(z + Float64(Float64(y * Float64(y * z)) * Float64(-0.5 + Float64(y * Float64(y * 0.041666666666666664)))))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + sin(y); tmp = 0.0; if (y <= -6.2e+76) tmp = t_0; elseif (y <= -165.0) tmp = z * cos(y); elseif (y <= 1.05) tmp = (x + (y * (1.0 + (y * (y * -0.16666666666666666))))) + (z + ((y * (y * z)) * (-0.5 + (y * (y * 0.041666666666666664))))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+76], t$95$0, If[LessEqual[y, -165.0], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05], N[(N[(x + N[(y * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z + N[(N[(y * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(-0.5 + N[(y * N[(y * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \sin y\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -165:\\
\;\;\;\;z \cdot \cos y\\
\mathbf{elif}\;y \leq 1.05:\\
\;\;\;\;\left(x + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\right) + \left(z + \left(y \cdot \left(y \cdot z\right)\right) \cdot \left(-0.5 + y \cdot \left(y \cdot 0.041666666666666664\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -6.20000000000000023e76 or 1.05000000000000004 < y Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6467.7%
Simplified67.7%
if -6.20000000000000023e76 < y < -165Initial program 99.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6473.3%
Simplified73.3%
if -165 < y < 1.05000000000000004Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
distribute-lft-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification84.7%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* z (cos y))))) (if (<= z -1.25) t_0 (if (<= z 1.9) (+ z (+ x (sin y))) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -1.25) {
tmp = t_0;
} else if (z <= 1.9) {
tmp = z + (x + sin(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 = x + (z * cos(y))
if (z <= (-1.25d0)) then
tmp = t_0
else if (z <= 1.9d0) then
tmp = z + (x + sin(y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (z * Math.cos(y));
double tmp;
if (z <= -1.25) {
tmp = t_0;
} else if (z <= 1.9) {
tmp = z + (x + Math.sin(y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * math.cos(y)) tmp = 0 if z <= -1.25: tmp = t_0 elif z <= 1.9: tmp = z + (x + math.sin(y)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * cos(y))) tmp = 0.0 if (z <= -1.25) tmp = t_0; elseif (z <= 1.9) tmp = Float64(z + Float64(x + sin(y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (z * cos(y)); tmp = 0.0; if (z <= -1.25) tmp = t_0; elseif (z <= 1.9) tmp = z + (x + sin(y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25], t$95$0, If[LessEqual[z, 1.9], N[(z + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -1.25:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.9:\\
\;\;\;\;z + \left(x + \sin y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.25 or 1.8999999999999999 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified97.6%
if -1.25 < z < 1.8999999999999999Initial program 100.0%
Taylor expanded in y around 0
Simplified99.6%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* z (cos y))))) (if (<= z -6.8e-37) t_0 (if (<= z 1.9e-81) (+ x (sin y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -6.8e-37) {
tmp = t_0;
} else if (z <= 1.9e-81) {
tmp = x + sin(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 = x + (z * cos(y))
if (z <= (-6.8d-37)) then
tmp = t_0
else if (z <= 1.9d-81) then
tmp = x + sin(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (z * Math.cos(y));
double tmp;
if (z <= -6.8e-37) {
tmp = t_0;
} else if (z <= 1.9e-81) {
tmp = x + Math.sin(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * math.cos(y)) tmp = 0 if z <= -6.8e-37: tmp = t_0 elif z <= 1.9e-81: tmp = x + math.sin(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * cos(y))) tmp = 0.0 if (z <= -6.8e-37) tmp = t_0; elseif (z <= 1.9e-81) tmp = Float64(x + sin(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (z * cos(y)); tmp = 0.0; if (z <= -6.8e-37) tmp = t_0; elseif (z <= 1.9e-81) tmp = x + sin(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-37], t$95$0, If[LessEqual[z, 1.9e-81], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-81}:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -6.80000000000000037e-37 or 1.8999999999999999e-81 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified94.9%
if -6.80000000000000037e-37 < z < 1.8999999999999999e-81Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6492.7%
Simplified92.7%
Final simplification94.0%
(FPCore (x y z)
:precision binary64
(if (<= y -130.0)
(+ x z)
(if (<= y 2.8e+41)
(+ (+ x z) (* y (+ 1.0 (* y (+ (* y -0.16666666666666666) (* z -0.5))))))
(sin y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -130.0) {
tmp = x + z;
} else if (y <= 2.8e+41) {
tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5)))));
} else {
tmp = sin(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 (y <= (-130.0d0)) then
tmp = x + z
else if (y <= 2.8d+41) then
tmp = (x + z) + (y * (1.0d0 + (y * ((y * (-0.16666666666666666d0)) + (z * (-0.5d0))))))
else
tmp = sin(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -130.0) {
tmp = x + z;
} else if (y <= 2.8e+41) {
tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5)))));
} else {
tmp = Math.sin(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -130.0: tmp = x + z elif y <= 2.8e+41: tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5))))) else: tmp = math.sin(y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -130.0) tmp = Float64(x + z); elseif (y <= 2.8e+41) tmp = Float64(Float64(x + z) + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(y * -0.16666666666666666) + Float64(z * -0.5)))))); else tmp = sin(y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -130.0) tmp = x + z; elseif (y <= 2.8e+41) tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5))))); else tmp = sin(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -130.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 2.8e+41], N[(N[(x + z), $MachinePrecision] + N[(y * N[(1.0 + N[(y * N[(N[(y * -0.16666666666666666), $MachinePrecision] + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[y], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -130:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+41}:\\
\;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666 + z \cdot -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin y\\
\end{array}
\end{array}
if y < -130Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6444.4%
Simplified44.4%
if -130 < y < 2.7999999999999999e41Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.0%
Simplified98.0%
if 2.7999999999999999e41 < y Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6462.7%
Simplified62.7%
Taylor expanded in x around 0
sin-lowering-sin.f6441.4%
Simplified41.4%
Final simplification73.1%
(FPCore (x y z)
:precision binary64
(if (<= y -180.0)
(+ x z)
(if (<= y 17000000000000.0)
(+ (+ x z) (* y (+ 1.0 (* y (+ (* y -0.16666666666666666) (* z -0.5))))))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -180.0) {
tmp = x + z;
} else if (y <= 17000000000000.0) {
tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5)))));
} else {
tmp = x + 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 <= (-180.0d0)) then
tmp = x + z
else if (y <= 17000000000000.0d0) then
tmp = (x + z) + (y * (1.0d0 + (y * ((y * (-0.16666666666666666d0)) + (z * (-0.5d0))))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -180.0) {
tmp = x + z;
} else if (y <= 17000000000000.0) {
tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5)))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -180.0: tmp = x + z elif y <= 17000000000000.0: tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5))))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -180.0) tmp = Float64(x + z); elseif (y <= 17000000000000.0) tmp = Float64(Float64(x + z) + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(y * -0.16666666666666666) + Float64(z * -0.5)))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -180.0) tmp = x + z; elseif (y <= 17000000000000.0) tmp = (x + z) + (y * (1.0 + (y * ((y * -0.16666666666666666) + (z * -0.5))))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -180.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 17000000000000.0], N[(N[(x + z), $MachinePrecision] + N[(y * N[(1.0 + N[(y * N[(N[(y * -0.16666666666666666), $MachinePrecision] + N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -180:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 17000000000000:\\
\;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666 + z \cdot -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -180 or 1.7e13 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6437.5%
Simplified37.5%
if -180 < y < 1.7e13Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3%
Simplified99.3%
Final simplification70.4%
(FPCore (x y z)
:precision binary64
(if (<= y -160.0)
(+ x z)
(if (<= y 1200000000000.0)
(+ (+ x y) (* z (+ 1.0 (* y (* y -0.5)))))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -160.0) {
tmp = x + z;
} else if (y <= 1200000000000.0) {
tmp = (x + y) + (z * (1.0 + (y * (y * -0.5))));
} else {
tmp = x + 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 <= (-160.0d0)) then
tmp = x + z
else if (y <= 1200000000000.0d0) then
tmp = (x + y) + (z * (1.0d0 + (y * (y * (-0.5d0)))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -160.0) {
tmp = x + z;
} else if (y <= 1200000000000.0) {
tmp = (x + y) + (z * (1.0 + (y * (y * -0.5))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -160.0: tmp = x + z elif y <= 1200000000000.0: tmp = (x + y) + (z * (1.0 + (y * (y * -0.5)))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -160.0) tmp = Float64(x + z); elseif (y <= 1200000000000.0) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 + Float64(y * Float64(y * -0.5))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -160.0) tmp = x + z; elseif (y <= 1200000000000.0) tmp = (x + y) + (z * (1.0 + (y * (y * -0.5)))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -160.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 1200000000000.0], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 + N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -160:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 1200000000000:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 + y \cdot \left(y \cdot -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -160 or 1.2e12 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6437.5%
Simplified37.5%
if -160 < y < 1.2e12Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
unpow2N/A
associate-+r+N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified99.3%
Final simplification70.3%
(FPCore (x y z)
:precision binary64
(if (<= y -7000.0)
(+ x z)
(if (<= y 1200000000000.0)
(+ z (+ x (* y (+ 1.0 (* y (* y -0.16666666666666666))))))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7000.0) {
tmp = x + z;
} else if (y <= 1200000000000.0) {
tmp = z + (x + (y * (1.0 + (y * (y * -0.16666666666666666)))));
} else {
tmp = x + 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 <= (-7000.0d0)) then
tmp = x + z
else if (y <= 1200000000000.0d0) then
tmp = z + (x + (y * (1.0d0 + (y * (y * (-0.16666666666666666d0))))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7000.0) {
tmp = x + z;
} else if (y <= 1200000000000.0) {
tmp = z + (x + (y * (1.0 + (y * (y * -0.16666666666666666)))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7000.0: tmp = x + z elif y <= 1200000000000.0: tmp = z + (x + (y * (1.0 + (y * (y * -0.16666666666666666))))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7000.0) tmp = Float64(x + z); elseif (y <= 1200000000000.0) tmp = Float64(z + Float64(x + Float64(y * Float64(1.0 + Float64(y * Float64(y * -0.16666666666666666)))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7000.0) tmp = x + z; elseif (y <= 1200000000000.0) tmp = z + (x + (y * (1.0 + (y * (y * -0.16666666666666666))))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7000.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 1200000000000.0], N[(z + N[(x + N[(y * N[(1.0 + N[(y * N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7000:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 1200000000000:\\
\;\;\;\;z + \left(x + y \cdot \left(1 + y \cdot \left(y \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -7e3 or 1.2e12 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6437.7%
Simplified37.7%
if -7e3 < y < 1.2e12Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3%
Simplified99.3%
Taylor expanded in y around 0
Simplified98.4%
Final simplification70.2%
(FPCore (x y z) :precision binary64 (if (<= y -7e+46) (+ x z) (if (<= y 3.2) (+ z (+ x y)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7e+46) {
tmp = x + z;
} else if (y <= 3.2) {
tmp = z + (x + y);
} else {
tmp = x + 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 <= (-7d+46)) then
tmp = x + z
else if (y <= 3.2d0) then
tmp = z + (x + y)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7e+46) {
tmp = x + z;
} else if (y <= 3.2) {
tmp = z + (x + y);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7e+46: tmp = x + z elif y <= 3.2: tmp = z + (x + y) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7e+46) tmp = Float64(x + z); elseif (y <= 3.2) tmp = Float64(z + Float64(x + y)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7e+46) tmp = x + z; elseif (y <= 3.2) tmp = z + (x + y); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7e+46], N[(x + z), $MachinePrecision], If[LessEqual[y, 3.2], N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+46}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 3.2:\\
\;\;\;\;z + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -6.9999999999999997e46 or 3.2000000000000002 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6438.0%
Simplified38.0%
if -6.9999999999999997e46 < y < 3.2000000000000002Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6497.2%
Simplified97.2%
Final simplification70.2%
(FPCore (x y z) :precision binary64 (if (<= x -75.0) x (if (<= x 130000000.0) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -75.0) {
tmp = x;
} else if (x <= 130000000.0) {
tmp = z;
} 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 <= (-75.0d0)) then
tmp = x
else if (x <= 130000000.0d0) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -75.0) {
tmp = x;
} else if (x <= 130000000.0) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -75.0: tmp = x elif x <= 130000000.0: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -75.0) tmp = x; elseif (x <= 130000000.0) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -75.0) tmp = x; elseif (x <= 130000000.0) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -75.0], x, If[LessEqual[x, 130000000.0], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -75:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 130000000:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -75 or 1.3e8 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified80.6%
if -75 < x < 1.3e8Initial program 99.9%
Taylor expanded in y around 0
Simplified79.4%
Taylor expanded in z around inf
Simplified40.4%
(FPCore (x y z) :precision binary64 (if (<= x -2.1e-106) x (if (<= x 6.8e-133) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.1e-106) {
tmp = x;
} else if (x <= 6.8e-133) {
tmp = 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 <= (-2.1d-106)) then
tmp = x
else if (x <= 6.8d-133) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.1e-106) {
tmp = x;
} else if (x <= 6.8e-133) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.1e-106: tmp = x elif x <= 6.8e-133: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.1e-106) tmp = x; elseif (x <= 6.8e-133) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.1e-106) tmp = x; elseif (x <= 6.8e-133) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.1e-106], x, If[LessEqual[x, 6.8e-133], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-106}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-133}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.10000000000000003e-106 or 6.80000000000000012e-133 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified57.9%
if -2.10000000000000003e-106 < x < 6.80000000000000012e-133Initial program 99.9%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
unpow2N/A
associate-+r+N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lft-identityN/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
Simplified56.3%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6418.9%
Simplified18.9%
Taylor expanded in y around inf
Simplified16.8%
(FPCore (x y z) :precision binary64 (+ x z))
double code(double x, double y, double z) {
return x + 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 + z
end function
public static double code(double x, double y, double z) {
return x + z;
}
def code(x, y, z): return x + z
function code(x, y, z) return Float64(x + z) end
function tmp = code(x, y, z) tmp = x + z; end
code[x_, y_, z_] := N[(x + z), $MachinePrecision]
\begin{array}{l}
\\
x + z
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6464.9%
Simplified64.9%
Final simplification64.9%
(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
Simplified40.7%
herbie shell --seed 2024152
(FPCore (x y z)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
:precision binary64
(+ (+ x (sin y)) (* z (cos y))))