
(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 13 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 (fma (cos y) z (+ x (sin y))))
double code(double x, double y, double z) {
return fma(cos(y), z, (x + sin(y)));
}
function code(x, y, z) return fma(cos(y), z, Float64(x + sin(y))) end
code[x_, y_, z_] := N[(N[Cos[y], $MachinePrecision] * z + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\cos y, z, x + \sin y\right)
\end{array}
Initial program 99.9%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
sin-lowering-sin.f6499.9
Applied egg-rr99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* (cos y) z) (+ x (sin y)))) (t_1 (fma (cos y) z x)))
(if (<= t_0 -5e+33)
t_1
(if (<= t_0 40000.0) (fma 1.0 z (fma x (/ (sin y) x) x)) t_1))))
double code(double x, double y, double z) {
double t_0 = (cos(y) * z) + (x + sin(y));
double t_1 = fma(cos(y), z, x);
double tmp;
if (t_0 <= -5e+33) {
tmp = t_1;
} else if (t_0 <= 40000.0) {
tmp = fma(1.0, z, fma(x, (sin(y) / x), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(cos(y) * z) + Float64(x + sin(y))) t_1 = fma(cos(y), z, x) tmp = 0.0 if (t_0 <= -5e+33) tmp = t_1; elseif (t_0 <= 40000.0) tmp = fma(1.0, z, fma(x, Float64(sin(y) / x), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[y], $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+33], t$95$1, If[LessEqual[t$95$0, 40000.0], N[(1.0 * z + N[(x * N[(N[Sin[y], $MachinePrecision] / x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos y \cdot z + \left(x + \sin y\right)\\
t_1 := \mathsf{fma}\left(\cos y, z, x\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 40000:\\
\;\;\;\;\mathsf{fma}\left(1, z, \mathsf{fma}\left(x, \frac{\sin y}{x}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -4.99999999999999973e33 or 4e4 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) Initial program 99.9%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
sin-lowering-sin.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around inf
Simplified99.8%
if -4.99999999999999973e33 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 4e4Initial program 100.0%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
sin-lowering-sin.f64100.0
Applied egg-rr100.0%
Taylor expanded in x around inf
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
sin-lowering-sin.f6499.8
Simplified99.8%
Taylor expanded in y around 0
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ (* (cos y) z) (+ x (sin y))))) (if (<= t_0 -0.001) (+ z x) (if (<= t_0 4e-6) (+ y x) (+ z x)))))
double code(double x, double y, double z) {
double t_0 = (cos(y) * z) + (x + sin(y));
double tmp;
if (t_0 <= -0.001) {
tmp = z + x;
} else if (t_0 <= 4e-6) {
tmp = y + x;
} else {
tmp = z + 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 = (cos(y) * z) + (x + sin(y))
if (t_0 <= (-0.001d0)) then
tmp = z + x
else if (t_0 <= 4d-6) then
tmp = y + x
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (Math.cos(y) * z) + (x + Math.sin(y));
double tmp;
if (t_0 <= -0.001) {
tmp = z + x;
} else if (t_0 <= 4e-6) {
tmp = y + x;
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): t_0 = (math.cos(y) * z) + (x + math.sin(y)) tmp = 0 if t_0 <= -0.001: tmp = z + x elif t_0 <= 4e-6: tmp = y + x else: tmp = z + x return tmp
function code(x, y, z) t_0 = Float64(Float64(cos(y) * z) + Float64(x + sin(y))) tmp = 0.0 if (t_0 <= -0.001) tmp = Float64(z + x); elseif (t_0 <= 4e-6) tmp = Float64(y + x); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (cos(y) * z) + (x + sin(y)); tmp = 0.0; if (t_0 <= -0.001) tmp = z + x; elseif (t_0 <= 4e-6) tmp = y + x; else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.001], N[(z + x), $MachinePrecision], If[LessEqual[t$95$0, 4e-6], N[(y + x), $MachinePrecision], N[(z + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos y \cdot z + \left(x + \sin y\right)\\
\mathbf{if}\;t\_0 \leq -0.001:\\
\;\;\;\;z + x\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-6}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -1e-3 or 3.99999999999999982e-6 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6469.5
Simplified69.5%
if -1e-3 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 3.99999999999999982e-6Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
unpow2N/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified99.3%
Taylor expanded in z around 0
Simplified84.8%
Final simplification71.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (cos y) z)))
(if (<= z -8e+71)
t_0
(if (<= z 4.9e-29) (+ x (sin y)) (if (<= z 3.4e+134) (+ z x) t_0)))))
double code(double x, double y, double z) {
double t_0 = cos(y) * z;
double tmp;
if (z <= -8e+71) {
tmp = t_0;
} else if (z <= 4.9e-29) {
tmp = x + sin(y);
} else if (z <= 3.4e+134) {
tmp = z + x;
} 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 = cos(y) * z
if (z <= (-8d+71)) then
tmp = t_0
else if (z <= 4.9d-29) then
tmp = x + sin(y)
else if (z <= 3.4d+134) then
tmp = z + x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.cos(y) * z;
double tmp;
if (z <= -8e+71) {
tmp = t_0;
} else if (z <= 4.9e-29) {
tmp = x + Math.sin(y);
} else if (z <= 3.4e+134) {
tmp = z + x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.cos(y) * z tmp = 0 if z <= -8e+71: tmp = t_0 elif z <= 4.9e-29: tmp = x + math.sin(y) elif z <= 3.4e+134: tmp = z + x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(cos(y) * z) tmp = 0.0 if (z <= -8e+71) tmp = t_0; elseif (z <= 4.9e-29) tmp = Float64(x + sin(y)); elseif (z <= 3.4e+134) tmp = Float64(z + x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = cos(y) * z; tmp = 0.0; if (z <= -8e+71) tmp = t_0; elseif (z <= 4.9e-29) tmp = x + sin(y); elseif (z <= 3.4e+134) tmp = z + x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -8e+71], t$95$0, If[LessEqual[z, 4.9e-29], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+134], N[(z + x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos y \cdot z\\
\mathbf{if}\;z \leq -8 \cdot 10^{+71}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-29}:\\
\;\;\;\;x + \sin y\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+134}:\\
\;\;\;\;z + x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.0000000000000003e71 or 3.40000000000000018e134 < z Initial program 99.9%
Taylor expanded in z around inf
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f6480.7
Simplified80.7%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f6480.7
Applied egg-rr80.7%
if -8.0000000000000003e71 < z < 4.8999999999999998e-29Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6492.0
Simplified92.0%
if 4.8999999999999998e-29 < z < 3.40000000000000018e134Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6490.7
Simplified90.7%
Final simplification88.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (fma (cos y) z x))) (if (<= z -8.5e-5) t_0 (if (<= z 6.6e-29) (+ x (sin y)) t_0))))
double code(double x, double y, double z) {
double t_0 = fma(cos(y), z, x);
double tmp;
if (z <= -8.5e-5) {
tmp = t_0;
} else if (z <= 6.6e-29) {
tmp = x + sin(y);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = fma(cos(y), z, x) tmp = 0.0 if (z <= -8.5e-5) tmp = t_0; elseif (z <= 6.6e-29) tmp = Float64(x + sin(y)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cos[y], $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[z, -8.5e-5], t$95$0, If[LessEqual[z, 6.6e-29], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\cos y, z, x\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-29}:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.500000000000001e-5 or 6.60000000000000055e-29 < z Initial program 99.9%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
sin-lowering-sin.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around inf
Simplified99.7%
if -8.500000000000001e-5 < z < 6.60000000000000055e-29Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6497.1
Simplified97.1%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (sin y))))
(if (<= y -650000000000.0)
t_0
(if (<= y 2e-6) (+ y (fma z (fma y (* y -0.5) 1.0) x)) t_0))))
double code(double x, double y, double z) {
double t_0 = x + sin(y);
double tmp;
if (y <= -650000000000.0) {
tmp = t_0;
} else if (y <= 2e-6) {
tmp = y + fma(z, fma(y, (y * -0.5), 1.0), x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(x + sin(y)) tmp = 0.0 if (y <= -650000000000.0) tmp = t_0; elseif (y <= 2e-6) tmp = Float64(y + fma(z, fma(y, Float64(y * -0.5), 1.0), x)); else tmp = t_0; end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -650000000000.0], t$95$0, If[LessEqual[y, 2e-6], N[(y + N[(z * N[(y * N[(y * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \sin y\\
\mathbf{if}\;y \leq -650000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-6}:\\
\;\;\;\;y + \mathsf{fma}\left(z, \mathsf{fma}\left(y, y \cdot -0.5, 1\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -6.5e11 or 1.99999999999999991e-6 < y Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6466.7
Simplified66.7%
if -6.5e11 < y < 1.99999999999999991e-6Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
unpow2N/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified100.0%
Final simplification83.3%
(FPCore (x y z)
:precision binary64
(if (<= y -980000000000.0)
(+ z x)
(if (<= y 132000000.0)
(+ x (fma y (fma y (fma y -0.16666666666666666 (* z -0.5)) 1.0) z))
(+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -980000000000.0) {
tmp = z + x;
} else if (y <= 132000000.0) {
tmp = x + fma(y, fma(y, fma(y, -0.16666666666666666, (z * -0.5)), 1.0), z);
} else {
tmp = z + x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -980000000000.0) tmp = Float64(z + x); elseif (y <= 132000000.0) tmp = Float64(x + fma(y, fma(y, fma(y, -0.16666666666666666, Float64(z * -0.5)), 1.0), z)); else tmp = Float64(z + x); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -980000000000.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 132000000.0], N[(x + N[(y * N[(y * N[(y * -0.16666666666666666 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -980000000000:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 132000000:\\
\;\;\;\;x + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.16666666666666666, z \cdot -0.5\right), 1\right), z\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -9.8e11 or 1.32e8 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6445.1
Simplified45.1%
if -9.8e11 < y < 1.32e8Initial program 100.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3
Simplified99.3%
(FPCore (x y z) :precision binary64 (if (<= y -860000000000.0) (+ z x) (if (<= y 4.6e+33) (+ y (fma z (fma y (* y -0.5) 1.0) x)) (+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -860000000000.0) {
tmp = z + x;
} else if (y <= 4.6e+33) {
tmp = y + fma(z, fma(y, (y * -0.5), 1.0), x);
} else {
tmp = z + x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= -860000000000.0) tmp = Float64(z + x); elseif (y <= 4.6e+33) tmp = Float64(y + fma(z, fma(y, Float64(y * -0.5), 1.0), x)); else tmp = Float64(z + x); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, -860000000000.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 4.6e+33], N[(y + N[(z * N[(y * N[(y * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -860000000000:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+33}:\\
\;\;\;\;y + \mathsf{fma}\left(z, \mathsf{fma}\left(y, y \cdot -0.5, 1\right), x\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -8.6e11 or 4.60000000000000021e33 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6444.5
Simplified44.5%
if -8.6e11 < y < 4.60000000000000021e33Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
unpow2N/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified98.4%
(FPCore (x y z) :precision binary64 (if (<= z -1.18e+132) z (if (<= z 1.2e-274) x (if (<= z 3.4e+138) (+ y x) z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.18e+132) {
tmp = z;
} else if (z <= 1.2e-274) {
tmp = x;
} else if (z <= 3.4e+138) {
tmp = y + x;
} else {
tmp = 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.18d+132)) then
tmp = z
else if (z <= 1.2d-274) then
tmp = x
else if (z <= 3.4d+138) then
tmp = y + x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.18e+132) {
tmp = z;
} else if (z <= 1.2e-274) {
tmp = x;
} else if (z <= 3.4e+138) {
tmp = y + x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.18e+132: tmp = z elif z <= 1.2e-274: tmp = x elif z <= 3.4e+138: tmp = y + x else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.18e+132) tmp = z; elseif (z <= 1.2e-274) tmp = x; elseif (z <= 3.4e+138) tmp = Float64(y + x); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.18e+132) tmp = z; elseif (z <= 1.2e-274) tmp = x; elseif (z <= 3.4e+138) tmp = y + x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.18e+132], z, If[LessEqual[z, 1.2e-274], x, If[LessEqual[z, 3.4e+138], N[(y + x), $MachinePrecision], z]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{+132}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-274}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+138}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.17999999999999997e132 or 3.40000000000000011e138 < z Initial program 99.9%
Taylor expanded in z around inf
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f6486.9
Simplified86.9%
Taylor expanded in y around 0
Simplified50.1%
if -1.17999999999999997e132 < z < 1.2e-274Initial program 99.9%
Taylor expanded in x around inf
Simplified61.5%
if 1.2e-274 < z < 3.40000000000000011e138Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
unpow2N/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified68.6%
Taylor expanded in z around 0
Simplified69.4%
(FPCore (x y z) :precision binary64 (if (<= y -2.7e+14) (+ z x) (if (<= y 1.4e+68) (+ y (+ z x)) (+ z x))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.7e+14) {
tmp = z + x;
} else if (y <= 1.4e+68) {
tmp = y + (z + x);
} else {
tmp = z + 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 <= (-2.7d+14)) then
tmp = z + x
else if (y <= 1.4d+68) then
tmp = y + (z + x)
else
tmp = z + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.7e+14) {
tmp = z + x;
} else if (y <= 1.4e+68) {
tmp = y + (z + x);
} else {
tmp = z + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.7e+14: tmp = z + x elif y <= 1.4e+68: tmp = y + (z + x) else: tmp = z + x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.7e+14) tmp = Float64(z + x); elseif (y <= 1.4e+68) tmp = Float64(y + Float64(z + x)); else tmp = Float64(z + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.7e+14) tmp = z + x; elseif (y <= 1.4e+68) tmp = y + (z + x); else tmp = z + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.7e+14], N[(z + x), $MachinePrecision], If[LessEqual[y, 1.4e+68], N[(y + N[(z + x), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+14}:\\
\;\;\;\;z + x\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+68}:\\
\;\;\;\;y + \left(z + x\right)\\
\mathbf{else}:\\
\;\;\;\;z + x\\
\end{array}
\end{array}
if y < -2.7e14 or 1.4e68 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6445.1
Simplified45.1%
if -2.7e14 < y < 1.4e68Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6495.1
Simplified95.1%
(FPCore (x y z) :precision binary64 (if (<= z -6.1e+131) z (if (<= z 2.4e+132) x z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -6.1e+131) {
tmp = z;
} else if (z <= 2.4e+132) {
tmp = x;
} else {
tmp = 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 <= (-6.1d+131)) then
tmp = z
else if (z <= 2.4d+132) then
tmp = x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6.1e+131) {
tmp = z;
} else if (z <= 2.4e+132) {
tmp = x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6.1e+131: tmp = z elif z <= 2.4e+132: tmp = x else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6.1e+131) tmp = z; elseif (z <= 2.4e+132) tmp = x; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6.1e+131) tmp = z; elseif (z <= 2.4e+132) tmp = x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6.1e+131], z, If[LessEqual[z, 2.4e+132], x, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.1 \cdot 10^{+131}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+132}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -6.0999999999999999e131 or 2.4000000000000001e132 < z Initial program 99.9%
Taylor expanded in z around inf
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f6486.9
Simplified86.9%
Taylor expanded in y around 0
Simplified50.1%
if -6.0999999999999999e131 < z < 2.4000000000000001e132Initial program 99.9%
Taylor expanded in x around inf
Simplified62.7%
(FPCore (x y z) :precision binary64 (if (<= x -6.5e-194) x (if (<= x 6.2e-93) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -6.5e-194) {
tmp = x;
} else if (x <= 6.2e-93) {
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 <= (-6.5d-194)) then
tmp = x
else if (x <= 6.2d-93) 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 <= -6.5e-194) {
tmp = x;
} else if (x <= 6.2e-93) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -6.5e-194: tmp = x elif x <= 6.2e-93: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -6.5e-194) tmp = x; elseif (x <= 6.2e-93) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -6.5e-194) tmp = x; elseif (x <= 6.2e-93) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -6.5e-194], x, If[LessEqual[x, 6.2e-93], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-194}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-93}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.50000000000000019e-194 or 6.19999999999999999e-93 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified62.5%
if -6.50000000000000019e-194 < x < 6.19999999999999999e-93Initial program 99.9%
Taylor expanded in y around 0
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
associate-*r*N/A
unpow2N/A
*-lft-identityN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified55.8%
Taylor expanded in y around inf
distribute-lft-inN/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lft-mult-inverseN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6423.3
Simplified23.3%
Taylor expanded in y around 0
Simplified24.3%
(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
Simplified51.4%
herbie shell --seed 2024195
(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))))