
(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 13 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.9e-10) t_1 (if (<= x 6.6e-28) (- (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.9e-10) {
tmp = t_1;
} else if (x <= 6.6e-28) {
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.9d-10)) then
tmp = t_1
else if (x <= 6.6d-28) 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.9e-10) {
tmp = t_1;
} else if (x <= 6.6e-28) {
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.9e-10: tmp = t_1 elif x <= 6.6e-28: 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.9e-10) tmp = t_1; elseif (x <= 6.6e-28) 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.9e-10) tmp = t_1; elseif (x <= 6.6e-28) 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.9e-10], t$95$1, If[LessEqual[x, 6.6e-28], 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.9 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-28}:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.8999999999999999e-10 or 6.6000000000000003e-28 < x Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6499.1%
Simplified99.1%
if -1.8999999999999999e-10 < x < 6.6000000000000003e-28Initial program 99.9%
Taylor expanded in x around 0
--lowering--.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6499.9%
Simplified99.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (+ x 1.0) (* z (sin y))))) (if (<= z -1.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 <= -1.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 <= (-1.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 <= -1.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 <= -1.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 <= -1.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 <= -1.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, -1.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 -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.25:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1 or 1.25 < z Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6497.8%
Simplified97.8%
if -1 < 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 simplification98.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- x (* z (sin y))))) (if (<= z -2e+34) t_0 (if (<= z 9.5e+89) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x - (z * sin(y));
double tmp;
if (z <= -2e+34) {
tmp = t_0;
} else if (z <= 9.5e+89) {
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 <= (-2d+34)) then
tmp = t_0
else if (z <= 9.5d+89) 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 <= -2e+34) {
tmp = t_0;
} else if (z <= 9.5e+89) {
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 <= -2e+34: tmp = t_0 elif z <= 9.5e+89: 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 <= -2e+34) tmp = t_0; elseif (z <= 9.5e+89) 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 <= -2e+34) tmp = t_0; elseif (z <= 9.5e+89) 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, -2e+34], t$95$0, If[LessEqual[z, 9.5e+89], 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 -2 \cdot 10^{+34}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+89}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.99999999999999989e34 or 9.5000000000000003e89 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified89.8%
if -1.99999999999999989e34 < z < 9.5000000000000003e89Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6494.7%
Simplified94.7%
Final simplification93.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (* z (sin y))))) (if (<= z -3.2e+121) t_0 (if (<= z 9.2e+103) (+ 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.2e+121) {
tmp = t_0;
} else if (z <= 9.2e+103) {
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.2d+121)) then
tmp = t_0
else if (z <= 9.2d+103) 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.2e+121) {
tmp = t_0;
} else if (z <= 9.2e+103) {
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.2e+121: tmp = t_0 elif z <= 9.2e+103: 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.2e+121) tmp = t_0; elseif (z <= 9.2e+103) 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.2e+121) tmp = t_0; elseif (z <= 9.2e+103) 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.2e+121], t$95$0, If[LessEqual[z, 9.2e+103], 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.2 \cdot 10^{+121}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+103}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.1999999999999999e121 or 9.20000000000000034e103 < z Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
--lowering--.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f6476.4%
Simplified76.4%
if -3.1999999999999999e121 < z < 9.20000000000000034e103Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6491.8%
Simplified91.8%
Final simplification87.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (cos y))))
(if (<= y -58000000.0)
t_0
(if (<= y 1200000000000.0)
(+ 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 <= -58000000.0) {
tmp = t_0;
} else if (y <= 1200000000000.0) {
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 <= (-58000000.0d0)) then
tmp = t_0
else if (y <= 1200000000000.0d0) 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 <= -58000000.0) {
tmp = t_0;
} else if (y <= 1200000000000.0) {
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 <= -58000000.0: tmp = t_0 elif y <= 1200000000000.0: 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 <= -58000000.0) tmp = t_0; elseif (y <= 1200000000000.0) 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 <= -58000000.0) tmp = t_0; elseif (y <= 1200000000000.0) 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, -58000000.0], t$95$0, If[LessEqual[y, 1200000000000.0], 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 -58000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1200000000000:\\
\;\;\;\;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 < -5.8e7 or 1.2e12 < y Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6465.3%
Simplified65.3%
if -5.8e7 < y < 1.2e12Initial 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-*.f6497.9%
Simplified97.9%
Final simplification82.9%
(FPCore (x y z) :precision binary64 (if (<= x -9.4e-9) (+ x 1.0) (if (<= x 6.6e-28) (cos y) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -9.4e-9) {
tmp = x + 1.0;
} else if (x <= 6.6e-28) {
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 <= (-9.4d-9)) then
tmp = x + 1.0d0
else if (x <= 6.6d-28) 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 <= -9.4e-9) {
tmp = x + 1.0;
} else if (x <= 6.6e-28) {
tmp = Math.cos(y);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -9.4e-9: tmp = x + 1.0 elif x <= 6.6e-28: tmp = math.cos(y) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -9.4e-9) tmp = Float64(x + 1.0); elseif (x <= 6.6e-28) 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 <= -9.4e-9) tmp = x + 1.0; elseif (x <= 6.6e-28) tmp = cos(y); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -9.4e-9], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 6.6e-28], N[Cos[y], $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{-9}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-28}:\\
\;\;\;\;\cos y\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -9.3999999999999998e-9 or 6.6000000000000003e-28 < x Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6482.6%
Simplified82.6%
if -9.3999999999999998e-9 < x < 6.6000000000000003e-28Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6469.6%
Simplified69.6%
Taylor expanded in x around 0
cos-lowering-cos.f6469.6%
Simplified69.6%
(FPCore (x y z)
:precision binary64
(if (<= y -68000000.0)
(+ x 1.0)
(if (<= y 5.5)
(+ 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 <= -68000000.0) {
tmp = x + 1.0;
} else if (y <= 5.5) {
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 <= (-68000000.0d0)) then
tmp = x + 1.0d0
else if (y <= 5.5d0) 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 <= -68000000.0) {
tmp = x + 1.0;
} else if (y <= 5.5) {
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 <= -68000000.0: tmp = x + 1.0 elif y <= 5.5: 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 <= -68000000.0) tmp = Float64(x + 1.0); elseif (y <= 5.5) 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 <= -68000000.0) tmp = x + 1.0; elseif (y <= 5.5) 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, -68000000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 5.5], 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 -68000000:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 5.5:\\
\;\;\;\;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 < -6.8e7 or 5.5 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6439.2%
Simplified39.2%
if -6.8e7 < y < 5.5Initial 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-*.f6498.6%
Simplified98.6%
(FPCore (x y z) :precision binary64 (if (<= y -1.95e+111) (+ x 1.0) (if (<= y 3.2) (+ x (- 1.0 (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.95e+111) {
tmp = x + 1.0;
} else if (y <= 3.2) {
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 <= (-1.95d+111)) then
tmp = x + 1.0d0
else if (y <= 3.2d0) 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 <= -1.95e+111) {
tmp = x + 1.0;
} else if (y <= 3.2) {
tmp = x + (1.0 - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.95e+111: tmp = x + 1.0 elif y <= 3.2: tmp = x + (1.0 - (y * z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.95e+111) tmp = Float64(x + 1.0); elseif (y <= 3.2) 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 <= -1.95e+111) tmp = x + 1.0; elseif (y <= 3.2) tmp = x + (1.0 - (y * z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.95e+111], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 3.2], 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 -1.95 \cdot 10^{+111}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 3.2:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -1.9499999999999999e111 or 3.2000000000000002 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6437.9%
Simplified37.9%
if -1.9499999999999999e111 < y < 3.2000000000000002Initial program 100.0%
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-*.f6492.7%
Simplified92.7%
(FPCore (x y z) :precision binary64 (if (<= x -5.8e-73) (+ x 1.0) (if (<= x 6e-13) (- 1.0 (* y z)) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.8e-73) {
tmp = x + 1.0;
} else if (x <= 6e-13) {
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 <= (-5.8d-73)) then
tmp = x + 1.0d0
else if (x <= 6d-13) 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 <= -5.8e-73) {
tmp = x + 1.0;
} else if (x <= 6e-13) {
tmp = 1.0 - (y * z);
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.8e-73: tmp = x + 1.0 elif x <= 6e-13: tmp = 1.0 - (y * z) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.8e-73) tmp = Float64(x + 1.0); elseif (x <= 6e-13) 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 <= -5.8e-73) tmp = x + 1.0; elseif (x <= 6e-13) tmp = 1.0 - (y * z); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.8e-73], N[(x + 1.0), $MachinePrecision], If[LessEqual[x, 6e-13], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-73}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-13}:\\
\;\;\;\;1 - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if x < -5.8e-73 or 5.99999999999999968e-13 < x Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6478.7%
Simplified78.7%
if -5.8e-73 < x < 5.99999999999999968e-13Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6478.4%
Simplified78.4%
Taylor expanded in y around 0
*-commutativeN/A
*-lowering-*.f6457.2%
Simplified57.2%
Taylor expanded in x around 0
Simplified57.2%
Final simplification68.3%
(FPCore (x y z) :precision binary64 (if (<= x -0.33) x (if (<= x 1.0) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.33) {
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 <= (-0.33d0)) 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 <= -0.33) {
tmp = x;
} else if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.33: tmp = x elif x <= 1.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.33) 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 <= -0.33) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.33], x, If[LessEqual[x, 1.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.33:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -0.330000000000000016 or 1 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified84.0%
if -0.330000000000000016 < x < 1Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6446.9%
Simplified46.9%
Taylor expanded in x around 0
Simplified46.0%
(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-+.f6463.8%
Simplified63.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 y around 0
+-commutativeN/A
+-lowering-+.f6463.8%
Simplified63.8%
Taylor expanded in x around 0
Simplified26.9%
herbie shell --seed 2024152
(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))))