
(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 12 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 (- (+ x 1.0) (* z (sin y))))) (if (<= z -65000000000000.0) t_0 (if (<= z 0.0001) (+ 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 <= -65000000000000.0) {
tmp = t_0;
} else if (z <= 0.0001) {
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 <= (-65000000000000.0d0)) then
tmp = t_0
else if (z <= 0.0001d0) 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 <= -65000000000000.0) {
tmp = t_0;
} else if (z <= 0.0001) {
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 <= -65000000000000.0: tmp = t_0 elif z <= 0.0001: 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 <= -65000000000000.0) tmp = t_0; elseif (z <= 0.0001) 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 <= -65000000000000.0) tmp = t_0; elseif (z <= 0.0001) 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, -65000000000000.0], t$95$0, If[LessEqual[z, 0.0001], 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 -65000000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.0001:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -6.5e13 or 1.00000000000000005e-4 < z Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6499.8%
Simplified99.8%
if -6.5e13 < z < 1.00000000000000005e-4Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6499.9%
Simplified99.9%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- x (* z (sin y))))) (if (<= z -7.8e+33) t_0 (if (<= z 1.45e+50) (+ x (cos y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x - (z * sin(y));
double tmp;
if (z <= -7.8e+33) {
tmp = t_0;
} else if (z <= 1.45e+50) {
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 <= (-7.8d+33)) then
tmp = t_0
else if (z <= 1.45d+50) 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 <= -7.8e+33) {
tmp = t_0;
} else if (z <= 1.45e+50) {
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 <= -7.8e+33: tmp = t_0 elif z <= 1.45e+50: 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 <= -7.8e+33) tmp = t_0; elseif (z <= 1.45e+50) 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 <= -7.8e+33) tmp = t_0; elseif (z <= 1.45e+50) 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, -7.8e+33], t$95$0, If[LessEqual[z, 1.45e+50], 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 -7.8 \cdot 10^{+33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+50}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7.8000000000000004e33 or 1.45e50 < z Initial program 99.8%
Taylor expanded in x around inf
Simplified94.2%
if -7.8000000000000004e33 < z < 1.45e50Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6498.4%
Simplified98.4%
Final simplification96.2%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- 1.0 (* z (sin y))))) (if (<= z -4.6e+36) t_0 (if (<= z 1.6e+114) (+ 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 <= -4.6e+36) {
tmp = t_0;
} else if (z <= 1.6e+114) {
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 <= (-4.6d+36)) then
tmp = t_0
else if (z <= 1.6d+114) 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 <= -4.6e+36) {
tmp = t_0;
} else if (z <= 1.6e+114) {
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 <= -4.6e+36: tmp = t_0 elif z <= 1.6e+114: 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 <= -4.6e+36) tmp = t_0; elseif (z <= 1.6e+114) 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 <= -4.6e+36) tmp = t_0; elseif (z <= 1.6e+114) 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, -4.6e+36], t$95$0, If[LessEqual[z, 1.6e+114], 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 -4.6 \cdot 10^{+36}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+114}:\\
\;\;\;\;x + \cos y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.59999999999999993e36 or 1.6e114 < 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.f6468.0%
Simplified68.0%
if -4.59999999999999993e36 < z < 1.6e114Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6496.4%
Simplified96.4%
Final simplification83.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (cos y)))) (if (<= y -3.55e+21) t_0 (if (<= y 2.6e+16) (+ x (- 1.0 (* y z))) t_0))))
double code(double x, double y, double z) {
double t_0 = x + cos(y);
double tmp;
if (y <= -3.55e+21) {
tmp = t_0;
} else if (y <= 2.6e+16) {
tmp = x + (1.0 - (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 + cos(y)
if (y <= (-3.55d+21)) then
tmp = t_0
else if (y <= 2.6d+16) then
tmp = x + (1.0d0 - (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 + Math.cos(y);
double tmp;
if (y <= -3.55e+21) {
tmp = t_0;
} else if (y <= 2.6e+16) {
tmp = x + (1.0 - (y * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + math.cos(y) tmp = 0 if y <= -3.55e+21: tmp = t_0 elif y <= 2.6e+16: tmp = x + (1.0 - (y * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + cos(y)) tmp = 0.0 if (y <= -3.55e+21) tmp = t_0; elseif (y <= 2.6e+16) tmp = Float64(x + Float64(1.0 - Float64(y * 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 <= -3.55e+21) tmp = t_0; elseif (y <= 2.6e+16) tmp = x + (1.0 - (y * 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, -3.55e+21], t$95$0, If[LessEqual[y, 2.6e+16], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \cos y\\
\mathbf{if}\;y \leq -3.55 \cdot 10^{+21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+16}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -3.55e21 or 2.6e16 < y Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f6459.6%
Simplified59.6%
if -3.55e21 < y < 2.6e16Initial 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-*.f6494.6%
Simplified94.6%
Final simplification78.3%
(FPCore (x y z)
:precision binary64
(if (<= y -1.72e+22)
(+ x 1.0)
(if (<= y 3.9e+62)
(+ (+ x 1.0) (* y (- (* y -0.5) z)))
(* x (+ 1.0 (* (/ 1.0 z) (/ z x)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.72e+22) {
tmp = x + 1.0;
} else if (y <= 3.9e+62) {
tmp = (x + 1.0) + (y * ((y * -0.5) - z));
} else {
tmp = x * (1.0 + ((1.0 / z) * (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 <= (-1.72d+22)) then
tmp = x + 1.0d0
else if (y <= 3.9d+62) then
tmp = (x + 1.0d0) + (y * ((y * (-0.5d0)) - z))
else
tmp = x * (1.0d0 + ((1.0d0 / z) * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.72e+22) {
tmp = x + 1.0;
} else if (y <= 3.9e+62) {
tmp = (x + 1.0) + (y * ((y * -0.5) - z));
} else {
tmp = x * (1.0 + ((1.0 / z) * (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.72e+22: tmp = x + 1.0 elif y <= 3.9e+62: tmp = (x + 1.0) + (y * ((y * -0.5) - z)) else: tmp = x * (1.0 + ((1.0 / z) * (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.72e+22) tmp = Float64(x + 1.0); elseif (y <= 3.9e+62) tmp = Float64(Float64(x + 1.0) + Float64(y * Float64(Float64(y * -0.5) - z))); else tmp = Float64(x * Float64(1.0 + Float64(Float64(1.0 / z) * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.72e+22) tmp = x + 1.0; elseif (y <= 3.9e+62) tmp = (x + 1.0) + (y * ((y * -0.5) - z)); else tmp = x * (1.0 + ((1.0 / z) * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.72e+22], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 3.9e+62], N[(N[(x + 1.0), $MachinePrecision] + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(N[(1.0 / z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.72 \cdot 10^{+22}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+62}:\\
\;\;\;\;\left(x + 1\right) + y \cdot \left(y \cdot -0.5 - z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{z} \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if y < -1.72e22Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6443.4%
Simplified43.4%
if -1.72e22 < y < 3.9e62Initial program 99.9%
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-*.f6490.5%
Simplified90.5%
if 3.9e62 < y Initial program 99.8%
Taylor expanded in z around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-out--N/A
mul-1-negN/A
remove-double-negN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f6492.2%
Simplified92.2%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f6494.2%
Simplified94.2%
Taylor expanded in y around 0
/-lowering-/.f6440.0%
Simplified40.0%
(FPCore (x y z)
:precision binary64
(if (<= y -1.25e+23)
(+ x 1.0)
(if (<= y 4.5e+56)
(+ x (- 1.0 (* y z)))
(* x (+ 1.0 (* (/ 1.0 z) (/ z x)))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.25e+23) {
tmp = x + 1.0;
} else if (y <= 4.5e+56) {
tmp = x + (1.0 - (y * z));
} else {
tmp = x * (1.0 + ((1.0 / z) * (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 <= (-1.25d+23)) then
tmp = x + 1.0d0
else if (y <= 4.5d+56) then
tmp = x + (1.0d0 - (y * z))
else
tmp = x * (1.0d0 + ((1.0d0 / z) * (z / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.25e+23) {
tmp = x + 1.0;
} else if (y <= 4.5e+56) {
tmp = x + (1.0 - (y * z));
} else {
tmp = x * (1.0 + ((1.0 / z) * (z / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.25e+23: tmp = x + 1.0 elif y <= 4.5e+56: tmp = x + (1.0 - (y * z)) else: tmp = x * (1.0 + ((1.0 / z) * (z / x))) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.25e+23) tmp = Float64(x + 1.0); elseif (y <= 4.5e+56) tmp = Float64(x + Float64(1.0 - Float64(y * z))); else tmp = Float64(x * Float64(1.0 + Float64(Float64(1.0 / z) * Float64(z / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.25e+23) tmp = x + 1.0; elseif (y <= 4.5e+56) tmp = x + (1.0 - (y * z)); else tmp = x * (1.0 + ((1.0 / z) * (z / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.25e+23], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 4.5e+56], N[(x + N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(N[(1.0 / z), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+23}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+56}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{z} \cdot \frac{z}{x}\right)\\
\end{array}
\end{array}
if y < -1.25e23Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6443.4%
Simplified43.4%
if -1.25e23 < y < 4.5000000000000003e56Initial 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-*.f6491.5%
Simplified91.5%
if 4.5000000000000003e56 < y Initial program 99.8%
Taylor expanded in z around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-out--N/A
mul-1-negN/A
remove-double-negN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f6492.6%
Simplified92.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
sin-lowering-sin.f64N/A
/-lowering-/.f6494.5%
Simplified94.5%
Taylor expanded in y around 0
/-lowering-/.f6439.7%
Simplified39.7%
(FPCore (x y z) :precision binary64 (if (<= y -1.02e+23) (+ x 1.0) (if (<= y 5.8e+57) (+ x (- 1.0 (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.02e+23) {
tmp = x + 1.0;
} else if (y <= 5.8e+57) {
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.02d+23)) then
tmp = x + 1.0d0
else if (y <= 5.8d+57) 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.02e+23) {
tmp = x + 1.0;
} else if (y <= 5.8e+57) {
tmp = x + (1.0 - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.02e+23: tmp = x + 1.0 elif y <= 5.8e+57: tmp = x + (1.0 - (y * z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.02e+23) tmp = Float64(x + 1.0); elseif (y <= 5.8e+57) 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.02e+23) tmp = x + 1.0; elseif (y <= 5.8e+57) tmp = x + (1.0 - (y * z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.02e+23], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 5.8e+57], 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.02 \cdot 10^{+23}:\\
\;\;\;\;x + 1\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+57}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -1.02e23 or 5.8000000000000003e57 < y Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6441.6%
Simplified41.6%
if -1.02e23 < y < 5.8000000000000003e57Initial 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-*.f6491.5%
Simplified91.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- x (* y z)))) (if (<= z -3.2e+158) t_0 (if (<= z 6.6e+156) (+ x 1.0) t_0))))
double code(double x, double y, double z) {
double t_0 = x - (y * z);
double tmp;
if (z <= -3.2e+158) {
tmp = t_0;
} else if (z <= 6.6e+156) {
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.2d+158)) then
tmp = t_0
else if (z <= 6.6d+156) 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.2e+158) {
tmp = t_0;
} else if (z <= 6.6e+156) {
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.2e+158: tmp = t_0 elif z <= 6.6e+156: 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.2e+158) tmp = t_0; elseif (z <= 6.6e+156) 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.2e+158) tmp = t_0; elseif (z <= 6.6e+156) 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.2e+158], t$95$0, If[LessEqual[z, 6.6e+156], 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.2 \cdot 10^{+158}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+156}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.19999999999999995e158 or 6.5999999999999997e156 < z Initial program 99.8%
Taylor expanded in x around inf
Simplified96.8%
Taylor expanded in y around 0
Simplified57.4%
if -3.19999999999999995e158 < z < 6.5999999999999997e156Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6469.7%
Simplified69.7%
Final simplification66.6%
(FPCore (x y z) :precision binary64 (if (<= x -0.00055) x (if (<= x 1.0) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.00055) {
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.00055d0)) 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.00055) {
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.00055: 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.00055) 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.00055) 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.00055], x, If[LessEqual[x, 1.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00055:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.50000000000000033e-4 or 1 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified78.1%
if -5.50000000000000033e-4 < x < 1Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6440.6%
Simplified40.6%
Taylor expanded in x around 0
Simplified40.1%
(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-+.f6460.3%
Simplified60.3%
(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-+.f6460.3%
Simplified60.3%
Taylor expanded in x around 0
Simplified20.7%
herbie shell --seed 2024160
(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))))