
(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 16 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))) (t_1 (- (+ x 1.0) t_0))) (if (<= x -1.45e-9) t_1 (if (<= x 1.55e-14) (- (cos y) t_0) t_1))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double t_1 = (x + 1.0) - t_0;
double tmp;
if (x <= -1.45e-9) {
tmp = t_1;
} else if (x <= 1.55e-14) {
tmp = cos(y) - t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = z * sin(y)
t_1 = (x + 1.0d0) - t_0
if (x <= (-1.45d-9)) then
tmp = t_1
else if (x <= 1.55d-14) then
tmp = cos(y) - t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.sin(y);
double t_1 = (x + 1.0) - t_0;
double tmp;
if (x <= -1.45e-9) {
tmp = t_1;
} else if (x <= 1.55e-14) {
tmp = Math.cos(y) - t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) t_1 = (x + 1.0) - t_0 tmp = 0 if x <= -1.45e-9: tmp = t_1 elif x <= 1.55e-14: tmp = math.cos(y) - t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) t_1 = Float64(Float64(x + 1.0) - t_0) tmp = 0.0 if (x <= -1.45e-9) tmp = t_1; elseif (x <= 1.55e-14) tmp = Float64(cos(y) - t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); t_1 = (x + 1.0) - t_0; tmp = 0.0; if (x <= -1.45e-9) tmp = t_1; elseif (x <= 1.55e-14) tmp = cos(y) - t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.45e-9], t$95$1, If[LessEqual[x, 1.55e-14], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
t_1 := \left(x + 1\right) - t\_0\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-14}:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.44999999999999996e-9 or 1.55000000000000002e-14 < x Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6499.3%
Simplified99.3%
if -1.44999999999999996e-9 < x < 1.55000000000000002e-14Initial program 99.8%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (+ x 1.0) (* z (sin y))))) (if (<= z -1850000.0) t_0 (if (<= z 1.25) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = (x + 1.0) - (z * sin(y));
double tmp;
if (z <= -1850000.0) {
tmp = t_0;
} else if (z <= 1.25) {
tmp = x + cos(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 + 1.0d0) - (z * sin(y))
if (z <= (-1850000.0d0)) then
tmp = t_0
else if (z <= 1.25d0) then
tmp = x + cos(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 + 1.0) - (z * Math.sin(y));
double tmp;
if (z <= -1850000.0) {
tmp = t_0;
} else if (z <= 1.25) {
tmp = x + Math.cos(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x + 1.0) - (z * math.sin(y)) tmp = 0 if z <= -1850000.0: tmp = t_0 elif z <= 1.25: tmp = x + math.cos(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x + 1.0) - Float64(z * sin(y))) tmp = 0.0 if (z <= -1850000.0) tmp = t_0; elseif (z <= 1.25) tmp = Float64(x + cos(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + 1.0) - (z * sin(y)); tmp = 0.0; if (z <= -1850000.0) tmp = t_0; elseif (z <= 1.25) tmp = x + cos(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1850000.0], t$95$0, If[LessEqual[z, 1.25], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + 1\right) - z \cdot \sin y\\
\mathbf{if}\;z \leq -1850000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.25:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.85e6 or 1.25 < z Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6499.1%
Simplified99.1%
if -1.85e6 < z < 1.25Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6499.6%
Simplified99.6%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- x (* z (sin y))))) (if (<= z -136000000000.0) t_0 (if (<= z 1.1e+34) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x - (z * sin(y));
double tmp;
if (z <= -136000000000.0) {
tmp = t_0;
} else if (z <= 1.1e+34) {
tmp = x + cos(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 * sin(y))
if (z <= (-136000000000.0d0)) then
tmp = t_0
else if (z <= 1.1d+34) then
tmp = x + cos(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.sin(y));
double tmp;
if (z <= -136000000000.0) {
tmp = t_0;
} else if (z <= 1.1e+34) {
tmp = x + Math.cos(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x - (z * math.sin(y)) tmp = 0 if z <= -136000000000.0: tmp = t_0 elif z <= 1.1e+34: tmp = x + math.cos(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x - Float64(z * sin(y))) tmp = 0.0 if (z <= -136000000000.0) tmp = t_0; elseif (z <= 1.1e+34) tmp = Float64(x + cos(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x - (z * sin(y)); tmp = 0.0; if (z <= -136000000000.0) tmp = t_0; elseif (z <= 1.1e+34) tmp = x + cos(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -136000000000.0], t$95$0, If[LessEqual[z, 1.1e+34], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - z \cdot \sin y\\
\mathbf{if}\;z \leq -136000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+34}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.36e11 or 1.1000000000000001e34 < z Initial program 99.8%
Taylor expanded in x around inf
Simplified89.6%
if -1.36e11 < z < 1.1000000000000001e34Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6498.2%
Simplified98.2%
Final simplification94.1%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (* z (sin y))))) (if (<= z -3.75e+208) t_0 (if (<= z 2.1e+57) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = 1.0 - (z * sin(y));
double tmp;
if (z <= -3.75e+208) {
tmp = t_0;
} else if (z <= 2.1e+57) {
tmp = x + cos(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 = 1.0d0 - (z * sin(y))
if (z <= (-3.75d+208)) then
tmp = t_0
else if (z <= 2.1d+57) then
tmp = x + cos(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 1.0 - (z * Math.sin(y));
double tmp;
if (z <= -3.75e+208) {
tmp = t_0;
} else if (z <= 2.1e+57) {
tmp = x + Math.cos(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 1.0 - (z * math.sin(y)) tmp = 0 if z <= -3.75e+208: tmp = t_0 elif z <= 2.1e+57: tmp = x + math.cos(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(1.0 - Float64(z * sin(y))) tmp = 0.0 if (z <= -3.75e+208) tmp = t_0; elseif (z <= 2.1e+57) tmp = Float64(x + cos(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 1.0 - (z * sin(y)); tmp = 0.0; if (z <= -3.75e+208) tmp = t_0; elseif (z <= 2.1e+57) tmp = x + cos(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.75e+208], t$95$0, If[LessEqual[z, 2.1e+57], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - z \cdot \sin y\\
\mathbf{if}\;z \leq -3.75 \cdot 10^{+208}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+57}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.74999999999999982e208 or 2.09999999999999991e57 < z Initial program 99.8%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6476.7%
Simplified76.7%
Taylor expanded in y around 0
Simplified76.7%
if -3.74999999999999982e208 < z < 2.09999999999999991e57Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6489.5%
Simplified89.5%
Final simplification85.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (cos y))))
(if (<= y -105000000.0)
t_0
(if (<= y 0.0115)
(+ x (+ 1.0 (* y (- (* y (+ -0.5 (* (* y z) 0.16666666666666666))) z))))
t_0))))
double code(double x, double y, double z) {
double t_0 = x + cos(y);
double tmp;
if (y <= -105000000.0) {
tmp = t_0;
} else if (y <= 0.0115) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - 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 + cos(y)
if (y <= (-105000000.0d0)) then
tmp = t_0
else if (y <= 0.0115d0) then
tmp = x + (1.0d0 + (y * ((y * ((-0.5d0) + ((y * z) * 0.16666666666666666d0))) - 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 + Math.cos(y);
double tmp;
if (y <= -105000000.0) {
tmp = t_0;
} else if (y <= 0.0115) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + math.cos(y) tmp = 0 if y <= -105000000.0: tmp = t_0 elif y <= 0.0115: tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + cos(y)) tmp = 0.0 if (y <= -105000000.0) tmp = t_0; elseif (y <= 0.0115) tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * Float64(-0.5 + Float64(Float64(y * z) * 0.16666666666666666))) - z)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + cos(y); tmp = 0.0; if (y <= -105000000.0) tmp = t_0; elseif (y <= 0.0115) tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -105000000.0], t$95$0, If[LessEqual[y, 0.0115], N[(x + N[(1.0 + N[(y * N[(N[(y * N[(-0.5 + N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \cos y\\
\mathbf{if}\;y \leq -105000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.0115:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot \left(-0.5 + \left(y \cdot z\right) \cdot 0.16666666666666666\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.05e8 or 0.0115 < y Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6456.0%
Simplified56.0%
if -1.05e8 < y < 0.0115Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6499.3%
Simplified99.3%
Final simplification78.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.4e-11) (+ x 1.0) (if (<= x 2.1e-10) (cos y) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e-11) {
tmp = x + 1.0;
} else if (x <= 2.1e-10) {
tmp = cos(y);
} else {
tmp = x + 1.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.4d-11)) then
tmp = x + 1.0d0
else if (x <= 2.1d-10) then
tmp = cos(y)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e-11) {
tmp = x + 1.0;
} else if (x <= 2.1e-10) {
tmp = Math.cos(y);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.4e-11: tmp = x + 1.0 elif x <= 2.1e-10: tmp = math.cos(y) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.4e-11) tmp = Float64(x + 1.0); elseif (x <= 2.1e-10) tmp = cos(y); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.4e-11) tmp = x + 1.0; elseif (x <= 2.1e-10) tmp = cos(y); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.4e-11], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 2.1e-10], N[Cos[y], $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-11}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-10}:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -1.4e-11 or 2.1e-10 < x Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6484.0%
Simplified84.0%
if -1.4e-11 < x < 2.1e-10Initial program 99.8%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
Taylor expanded in z around 0
cos-lowering-cos.f6458.4%
Simplified58.4%
(FPCore (x y z)
:precision binary64
(if (<= y -5.3e+17)
(+ x 1.0)
(if (<= y 2.2e+23)
(+ x (+ 1.0 (* y (- (* y (+ -0.5 (* (* y z) 0.16666666666666666))) z))))
(+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.3e+17) {
tmp = x + 1.0;
} else if (y <= 2.2e+23) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z)));
} else {
tmp = x + 1.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-5.3d+17)) then
tmp = x + 1.0d0
else if (y <= 2.2d+23) then
tmp = x + (1.0d0 + (y * ((y * ((-0.5d0) + ((y * z) * 0.16666666666666666d0))) - z)))
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.3e+17) {
tmp = x + 1.0;
} else if (y <= 2.2e+23) {
tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z)));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.3e+17: tmp = x + 1.0 elif y <= 2.2e+23: tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.3e+17) tmp = Float64(x + 1.0); elseif (y <= 2.2e+23) tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * Float64(-0.5 + Float64(Float64(y * z) * 0.16666666666666666))) - z)))); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.3e+17) tmp = x + 1.0; elseif (y <= 2.2e+23) tmp = x + (1.0 + (y * ((y * (-0.5 + ((y * z) * 0.16666666666666666))) - z))); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.3e+17], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 2.2e+23], N[(x + N[(1.0 + N[(y * N[(N[(y * N[(-0.5 + N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+17}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+23}:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot \left(-0.5 + \left(y \cdot z\right) \cdot 0.16666666666666666\right) - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -5.3e17 or 2.20000000000000008e23 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6437.7%
Simplified37.7%
if -5.3e17 < y < 2.20000000000000008e23Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6492.7%
Simplified92.7%
(FPCore (x y z) :precision binary64 (if (<= y -1.1e+18) (+ x 1.0) (if (<= y 3.5e+20) (+ (+ x 1.0) (* y (- (* y -0.5) z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.1e+18) {
tmp = x + 1.0;
} else if (y <= 3.5e+20) {
tmp = (x + 1.0) + (y * ((y * -0.5) - z));
} else {
tmp = x + 1.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.1d+18)) then
tmp = x + 1.0d0
else if (y <= 3.5d+20) then
tmp = (x + 1.0d0) + (y * ((y * (-0.5d0)) - z))
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.1e+18) {
tmp = x + 1.0;
} else if (y <= 3.5e+20) {
tmp = (x + 1.0) + (y * ((y * -0.5) - z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.1e+18: tmp = x + 1.0 elif y <= 3.5e+20: tmp = (x + 1.0) + (y * ((y * -0.5) - z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.1e+18) tmp = Float64(x + 1.0); elseif (y <= 3.5e+20) tmp = Float64(Float64(x + 1.0) + Float64(y * Float64(Float64(y * -0.5) - z))); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.1e+18) tmp = x + 1.0; elseif (y <= 3.5e+20) tmp = (x + 1.0) + (y * ((y * -0.5) - z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.1e+18], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 3.5e+20], N[(N[(x + 1.0), $MachinePrecision] + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+18}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+20}:\\
\;\;\;\;\left(x + 1\right) + y \cdot \left(y \cdot -0.5 - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -1.1e18 or 3.5e20 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6437.4%
Simplified37.4%
if -1.1e18 < y < 3.5e20Initial 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
*-commutativeN/A
*-lowering-*.f6493.2%
Simplified93.2%
(FPCore (x y z) :precision binary64 (if (<= y -4.2e+118) (+ x 1.0) (if (<= y 3e+21) (+ x (- 1.0 (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -4.2e+118) {
tmp = x + 1.0;
} else if (y <= 3e+21) {
tmp = x + (1.0 - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-4.2d+118)) then
tmp = x + 1.0d0
else if (y <= 3d+21) then
tmp = x + (1.0d0 - (y * z))
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -4.2e+118) {
tmp = x + 1.0;
} else if (y <= 3e+21) {
tmp = x + (1.0 - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -4.2e+118: tmp = x + 1.0 elif y <= 3e+21: tmp = x + (1.0 - (y * z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -4.2e+118) tmp = Float64(x + 1.0); elseif (y <= 3e+21) tmp = Float64(x + Float64(1.0 - Float64(y * z))); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -4.2e+118) tmp = x + 1.0; elseif (y <= 3e+21) tmp = x + (1.0 - (y * z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -4.2e+118], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 3e+21], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+118}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+21}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -4.2e118 or 3e21 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6438.8%
Simplified38.8%
if -4.2e118 < y < 3e21Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6486.6%
Simplified86.6%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- x (* y z)))) (if (<= z -3.75e+208) t_0 (if (<= z 2.4e+152) (+ x 1.0) t_0))))
double code(double x, double y, double z) {
double t_0 = x - (y * z);
double tmp;
if (z <= -3.75e+208) {
tmp = t_0;
} else if (z <= 2.4e+152) {
tmp = x + 1.0;
} 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 - (y * z)
if (z <= (-3.75d+208)) then
tmp = t_0
else if (z <= 2.4d+152) then
tmp = x + 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x - (y * z);
double tmp;
if (z <= -3.75e+208) {
tmp = t_0;
} else if (z <= 2.4e+152) {
tmp = x + 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x - (y * z) tmp = 0 if z <= -3.75e+208: tmp = t_0 elif z <= 2.4e+152: tmp = x + 1.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x - Float64(y * z)) tmp = 0.0 if (z <= -3.75e+208) tmp = t_0; elseif (z <= 2.4e+152) tmp = Float64(x + 1.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x - (y * z); tmp = 0.0; if (z <= -3.75e+208) tmp = t_0; elseif (z <= 2.4e+152) tmp = x + 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.75e+208], t$95$0, If[LessEqual[z, 2.4e+152], N[(x + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - y \cdot z\\
\mathbf{if}\;z \leq -3.75 \cdot 10^{+208}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+152}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.74999999999999982e208 or 2.3999999999999999e152 < z Initial program 99.7%
Taylor expanded in x around inf
Simplified96.3%
Taylor expanded in y around 0
Simplified41.0%
if -3.74999999999999982e208 < z < 2.3999999999999999e152Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6472.9%
Simplified72.9%
Final simplification65.9%
(FPCore (x y z) :precision binary64 (if (<= x -1.9e-19) (+ x 1.0) (if (<= x 7.5e-138) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-19) {
tmp = x + 1.0;
} else if (x <= 7.5e-138) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.9d-19)) then
tmp = x + 1.0d0
else if (x <= 7.5d-138) then
tmp = 1.0d0 - (y * z)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.9e-19) {
tmp = x + 1.0;
} else if (x <= 7.5e-138) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.9e-19: tmp = x + 1.0 elif x <= 7.5e-138: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.9e-19) tmp = Float64(x + 1.0); elseif (x <= 7.5e-138) tmp = Float64(1.0 - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.9e-19) tmp = x + 1.0; elseif (x <= 7.5e-138) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.9e-19], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 7.5e-138], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-19}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-138}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -1.9e-19 or 7.4999999999999995e-138 < x Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6476.4%
Simplified76.4%
if -1.9e-19 < x < 7.4999999999999995e-138Initial program 99.8%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.8%
Simplified99.8%
Taylor expanded in y around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6449.7%
Simplified49.7%
(FPCore (x y z) :precision binary64 (if (<= x -3.5e-14) x (if (<= x 1.0) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-14) {
tmp = x;
} else if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.5d-14)) then
tmp = x
else if (x <= 1.0d0) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.5e-14) {
tmp = x;
} else if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.5e-14: tmp = x elif x <= 1.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.5e-14) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.5e-14) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.5e-14], x, If[LessEqual[x, 1.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.5000000000000002e-14 or 1 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified82.1%
if -3.5000000000000002e-14 < x < 1Initial program 99.8%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.4%
Simplified99.4%
Taylor expanded in y around 0
Simplified39.8%
(FPCore (x y z) :precision binary64 (if (<= z -8.5e+209) (- 0.0 (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -8.5e+209) {
tmp = 0.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-8.5d+209)) then
tmp = 0.0d0 - (y * z)
else
tmp = x + 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -8.5e+209) {
tmp = 0.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8.5e+209: tmp = 0.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8.5e+209) tmp = Float64(0.0 - Float64(y * z)); else tmp = Float64(x + 1.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -8.5e+209) tmp = 0.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8.5e+209], N[(0.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+209}:\\
\;\;\;\;0 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if z < -8.50000000000000062e209Initial program 99.7%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6438.1%
Simplified38.1%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6432.2%
Simplified32.2%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6431.5%
Simplified31.5%
if -8.50000000000000062e209 < z Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6466.9%
Simplified66.9%
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
return x + 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + 1.0d0
end function
public static double code(double x, double y, double z) {
return x + 1.0;
}
def code(x, y, z): return x + 1.0
function code(x, y, z) return Float64(x + 1.0) end
function tmp = code(x, y, z) tmp = x + 1.0; end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6461.8%
Simplified61.8%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6458.3%
Simplified58.3%
Taylor expanded in y around 0
Simplified21.6%
herbie shell --seed 2024158
(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))))