
(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 12 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 (+ (+ 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}
Initial program 99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -7.2e+41)
t_0
(if (<= z 1.85e-40) (+ x (sin y)) (if (<= z 3.3e+165) (+ x z) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -7.2e+41) {
tmp = t_0;
} else if (z <= 1.85e-40) {
tmp = x + sin(y);
} else if (z <= 3.3e+165) {
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 <= (-7.2d+41)) then
tmp = t_0
else if (z <= 1.85d-40) then
tmp = x + sin(y)
else if (z <= 3.3d+165) 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 <= -7.2e+41) {
tmp = t_0;
} else if (z <= 1.85e-40) {
tmp = x + Math.sin(y);
} else if (z <= 3.3e+165) {
tmp = x + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -7.2e+41: tmp = t_0 elif z <= 1.85e-40: tmp = x + math.sin(y) elif z <= 3.3e+165: 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 <= -7.2e+41) tmp = t_0; elseif (z <= 1.85e-40) tmp = Float64(x + sin(y)); elseif (z <= 3.3e+165) 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 <= -7.2e+41) tmp = t_0; elseif (z <= 1.85e-40) tmp = x + sin(y); elseif (z <= 3.3e+165) 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, -7.2e+41], t$95$0, If[LessEqual[z, 1.85e-40], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+165], N[(x + z), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-40}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+165}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7.20000000000000051e41 or 3.2999999999999999e165 < z Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6483.9%
Simplified83.9%
if -7.20000000000000051e41 < z < 1.84999999999999999e-40Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6488.6%
Simplified88.6%
if 1.84999999999999999e-40 < z < 3.2999999999999999e165Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6480.9%
Simplified80.9%
Final simplification85.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -4e+43)
t_0
(if (<= z -7.8e-162) (+ x z) (if (<= z 4.5e+164) (+ y (+ x z)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -4e+43) {
tmp = t_0;
} else if (z <= -7.8e-162) {
tmp = x + z;
} else if (z <= 4.5e+164) {
tmp = y + (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+43)) then
tmp = t_0
else if (z <= (-7.8d-162)) then
tmp = x + z
else if (z <= 4.5d+164) then
tmp = y + (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+43) {
tmp = t_0;
} else if (z <= -7.8e-162) {
tmp = x + z;
} else if (z <= 4.5e+164) {
tmp = y + (x + z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -4e+43: tmp = t_0 elif z <= -7.8e-162: tmp = x + z elif z <= 4.5e+164: tmp = y + (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+43) tmp = t_0; elseif (z <= -7.8e-162) tmp = Float64(x + z); elseif (z <= 4.5e+164) tmp = Float64(y + 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+43) tmp = t_0; elseif (z <= -7.8e-162) tmp = x + z; elseif (z <= 4.5e+164) tmp = y + (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+43], t$95$0, If[LessEqual[z, -7.8e-162], N[(x + z), $MachinePrecision], If[LessEqual[z, 4.5e+164], N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -4 \cdot 10^{+43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-162}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+164}:\\
\;\;\;\;y + \left(x + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.00000000000000006e43 or 4.49999999999999975e164 < z Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6483.9%
Simplified83.9%
if -4.00000000000000006e43 < z < -7.7999999999999999e-162Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6476.0%
Simplified76.0%
if -7.7999999999999999e-162 < z < 4.49999999999999975e164Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6475.5%
Simplified75.5%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* z (cos y))))) (if (<= z -0.8) t_0 (if (<= z 0.75) (+ (+ x (sin y)) z) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -0.8) {
tmp = t_0;
} else if (z <= 0.75) {
tmp = (x + sin(y)) + 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 = x + (z * cos(y))
if (z <= (-0.8d0)) then
tmp = t_0
else if (z <= 0.75d0) then
tmp = (x + sin(y)) + z
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 <= -0.8) {
tmp = t_0;
} else if (z <= 0.75) {
tmp = (x + Math.sin(y)) + z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * math.cos(y)) tmp = 0 if z <= -0.8: tmp = t_0 elif z <= 0.75: tmp = (x + math.sin(y)) + z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * cos(y))) tmp = 0.0 if (z <= -0.8) tmp = t_0; elseif (z <= 0.75) tmp = Float64(Float64(x + sin(y)) + z); 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 <= -0.8) tmp = t_0; elseif (z <= 0.75) tmp = (x + sin(y)) + z; 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, -0.8], t$95$0, If[LessEqual[z, 0.75], N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -0.8:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\left(x + \sin y\right) + z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.80000000000000004 or 0.75 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified98.6%
if -0.80000000000000004 < z < 0.75Initial program 100.0%
Taylor expanded in y around 0
Simplified99.2%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* z (cos y))))) (if (<= z -4.6e-97) t_0 (if (<= z 8e-44) (+ x (sin y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -4.6e-97) {
tmp = t_0;
} else if (z <= 8e-44) {
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 <= (-4.6d-97)) then
tmp = t_0
else if (z <= 8d-44) 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 <= -4.6e-97) {
tmp = t_0;
} else if (z <= 8e-44) {
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 <= -4.6e-97: tmp = t_0 elif z <= 8e-44: 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 <= -4.6e-97) tmp = t_0; elseif (z <= 8e-44) 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 <= -4.6e-97) tmp = t_0; elseif (z <= 8e-44) 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, -4.6e-97], t$95$0, If[LessEqual[z, 8e-44], 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 -4.6 \cdot 10^{-97}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-44}:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.59999999999999988e-97 or 7.99999999999999962e-44 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified95.1%
if -4.59999999999999988e-97 < z < 7.99999999999999962e-44Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6493.1%
Simplified93.1%
Final simplification94.3%
(FPCore (x y z)
:precision binary64
(if (<= y -1.3e+26)
(+ x z)
(if (<= y 4.8)
(+ (+ x z) (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666))))))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.3e+26) {
tmp = x + z;
} else if (y <= 4.8) {
tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (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 <= (-1.3d+26)) then
tmp = x + z
else if (y <= 4.8d0) then
tmp = (x + z) + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (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 <= -1.3e+26) {
tmp = x + z;
} else if (y <= 4.8) {
tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.3e+26: tmp = x + z elif y <= 4.8: tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.3e+26) tmp = Float64(x + z); elseif (y <= 4.8) tmp = Float64(Float64(x + z) + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + 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 <= -1.3e+26) tmp = x + z; elseif (y <= 4.8) tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666))))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.3e+26], N[(x + z), $MachinePrecision], If[LessEqual[y, 4.8], N[(N[(x + z), $MachinePrecision] + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+26}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 4.8:\\
\;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -1.30000000000000001e26 or 4.79999999999999982 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6441.8%
Simplified41.8%
if -1.30000000000000001e26 < y < 4.79999999999999982Initial 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.7%
Simplified98.7%
Final simplification73.6%
(FPCore (x y z) :precision binary64 (if (<= y -5.8e+46) (+ x z) (if (<= y 340.0) (+ y (+ x z)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.8e+46) {
tmp = x + z;
} else if (y <= 340.0) {
tmp = y + (x + z);
} 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 <= (-5.8d+46)) then
tmp = x + z
else if (y <= 340.0d0) then
tmp = y + (x + z)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.8e+46) {
tmp = x + z;
} else if (y <= 340.0) {
tmp = y + (x + z);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.8e+46: tmp = x + z elif y <= 340.0: tmp = y + (x + z) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.8e+46) tmp = Float64(x + z); elseif (y <= 340.0) tmp = Float64(y + Float64(x + z)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.8e+46) tmp = x + z; elseif (y <= 340.0) tmp = y + (x + z); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.8e+46], N[(x + z), $MachinePrecision], If[LessEqual[y, 340.0], N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+46}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 340:\\
\;\;\;\;y + \left(x + z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -5.8000000000000004e46 or 340 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6443.1%
Simplified43.1%
if -5.8000000000000004e46 < y < 340Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6495.6%
Simplified95.6%
Final simplification73.4%
(FPCore (x y z) :precision binary64 (if (<= x -3.4e-189) (+ x z) (if (<= x 8.2e-61) (+ y z) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-189) {
tmp = x + z;
} else if (x <= 8.2e-61) {
tmp = y + z;
} 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 (x <= (-3.4d-189)) then
tmp = x + z
else if (x <= 8.2d-61) then
tmp = y + z
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.4e-189) {
tmp = x + z;
} else if (x <= 8.2e-61) {
tmp = y + z;
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.4e-189: tmp = x + z elif x <= 8.2e-61: tmp = y + z else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.4e-189) tmp = Float64(x + z); elseif (x <= 8.2e-61) tmp = Float64(y + z); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.4e-189) tmp = x + z; elseif (x <= 8.2e-61) tmp = y + z; else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.4e-189], N[(x + z), $MachinePrecision], If[LessEqual[x, 8.2e-61], N[(y + z), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-189}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-61}:\\
\;\;\;\;y + z\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if x < -3.4000000000000001e-189 or 8.19999999999999998e-61 < x Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6478.8%
Simplified78.8%
if -3.4000000000000001e-189 < x < 8.19999999999999998e-61Initial program 99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f6498.5%
Simplified98.5%
Taylor expanded in y around 0
+-lowering-+.f6452.9%
Simplified52.9%
Final simplification71.9%
(FPCore (x y z) :precision binary64 (if (<= x -3100000000000.0) x (if (<= x 2.5e-42) (+ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3100000000000.0) {
tmp = x;
} else if (x <= 2.5e-42) {
tmp = y + 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 <= (-3100000000000.0d0)) then
tmp = x
else if (x <= 2.5d-42) then
tmp = y + z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3100000000000.0) {
tmp = x;
} else if (x <= 2.5e-42) {
tmp = y + z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3100000000000.0: tmp = x elif x <= 2.5e-42: tmp = y + z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3100000000000.0) tmp = x; elseif (x <= 2.5e-42) tmp = Float64(y + z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3100000000000.0) tmp = x; elseif (x <= 2.5e-42) tmp = y + z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3100000000000.0], x, If[LessEqual[x, 2.5e-42], N[(y + z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3100000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-42}:\\
\;\;\;\;y + z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.1e12 or 2.50000000000000001e-42 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified80.3%
if -3.1e12 < x < 2.50000000000000001e-42Initial program 99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f6493.9%
Simplified93.9%
Taylor expanded in y around 0
+-lowering-+.f6448.2%
Simplified48.2%
(FPCore (x y z) :precision binary64 (if (<= x -2.55e+14) x (if (<= x 4e-43) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.55e+14) {
tmp = x;
} else if (x <= 4e-43) {
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 <= (-2.55d+14)) then
tmp = x
else if (x <= 4d-43) 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 <= -2.55e+14) {
tmp = x;
} else if (x <= 4e-43) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.55e+14: tmp = x elif x <= 4e-43: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.55e+14) tmp = x; elseif (x <= 4e-43) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.55e+14) tmp = x; elseif (x <= 4e-43) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.55e+14], x, If[LessEqual[x, 4e-43], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.55 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-43}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.55e14 or 4.00000000000000031e-43 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified80.9%
if -2.55e14 < x < 4.00000000000000031e-43Initial program 99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f6494.0%
Simplified94.0%
Taylor expanded in y around 0
Simplified38.7%
(FPCore (x y z) :precision binary64 (if (<= x -7.5e-132) x (if (<= x 2.05e-44) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -7.5e-132) {
tmp = x;
} else if (x <= 2.05e-44) {
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 <= (-7.5d-132)) then
tmp = x
else if (x <= 2.05d-44) 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 <= -7.5e-132) {
tmp = x;
} else if (x <= 2.05e-44) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -7.5e-132: tmp = x elif x <= 2.05e-44: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -7.5e-132) tmp = x; elseif (x <= 2.05e-44) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -7.5e-132) tmp = x; elseif (x <= 2.05e-44) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -7.5e-132], x, If[LessEqual[x, 2.05e-44], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-132}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-44}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.49999999999999989e-132 or 2.04999999999999996e-44 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified67.2%
if -7.49999999999999989e-132 < x < 2.04999999999999996e-44Initial 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
Simplified47.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6417.4%
Simplified17.4%
Taylor expanded in y around inf
Simplified16.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
Simplified46.1%
herbie shell --seed 2024138
(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))))