
(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 (+ (* z (cos y)) (+ x (sin y))))
double code(double x, double y, double z) {
return (z * cos(y)) + (x + 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 = (z * cos(y)) + (x + sin(y))
end function
public static double code(double x, double y, double z) {
return (z * Math.cos(y)) + (x + Math.sin(y));
}
def code(x, y, z): return (z * math.cos(y)) + (x + math.sin(y))
function code(x, y, z) return Float64(Float64(z * cos(y)) + Float64(x + sin(y))) end
function tmp = code(x, y, z) tmp = (z * cos(y)) + (x + sin(y)); end
code[x_, y_, z_] := N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \cos y + \left(x + \sin y\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (cos y))))
(if (<= z -5.6e+20)
t_0
(if (<= z -4.8e-16) (+ x z) (if (<= z 9.8e+37) (+ x (sin y)) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * cos(y);
double tmp;
if (z <= -5.6e+20) {
tmp = t_0;
} else if (z <= -4.8e-16) {
tmp = x + z;
} else if (z <= 9.8e+37) {
tmp = x + sin(y);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * cos(y)
if (z <= (-5.6d+20)) then
tmp = t_0
else if (z <= (-4.8d-16)) then
tmp = x + z
else if (z <= 9.8d+37) then
tmp = x + sin(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.cos(y);
double tmp;
if (z <= -5.6e+20) {
tmp = t_0;
} else if (z <= -4.8e-16) {
tmp = x + z;
} else if (z <= 9.8e+37) {
tmp = x + Math.sin(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.cos(y) tmp = 0 if z <= -5.6e+20: tmp = t_0 elif z <= -4.8e-16: tmp = x + z elif z <= 9.8e+37: tmp = x + math.sin(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * cos(y)) tmp = 0.0 if (z <= -5.6e+20) tmp = t_0; elseif (z <= -4.8e-16) tmp = Float64(x + z); elseif (z <= 9.8e+37) tmp = Float64(x + sin(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * cos(y); tmp = 0.0; if (z <= -5.6e+20) tmp = t_0; elseif (z <= -4.8e-16) tmp = x + z; elseif (z <= 9.8e+37) tmp = x + sin(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.6e+20], t$95$0, If[LessEqual[z, -4.8e-16], N[(x + z), $MachinePrecision], If[LessEqual[z, 9.8e+37], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+20}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-16}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+37}:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.6e20 or 9.8000000000000008e37 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6480.2%
Simplified80.2%
if -5.6e20 < z < -4.8000000000000001e-16Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
if -4.8000000000000001e-16 < z < 9.8000000000000008e37Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6493.5%
Simplified93.5%
Final simplification87.7%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* z (cos y))))) (if (<= z -4.8e-16) t_0 (if (<= z 7.5e-47) (+ x (sin y)) t_0))))
double code(double x, double y, double z) {
double t_0 = x + (z * cos(y));
double tmp;
if (z <= -4.8e-16) {
tmp = t_0;
} else if (z <= 7.5e-47) {
tmp = x + sin(y);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x + (z * cos(y))
if (z <= (-4.8d-16)) then
tmp = t_0
else if (z <= 7.5d-47) then
tmp = x + sin(y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (z * Math.cos(y));
double tmp;
if (z <= -4.8e-16) {
tmp = t_0;
} else if (z <= 7.5e-47) {
tmp = x + Math.sin(y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * math.cos(y)) tmp = 0 if z <= -4.8e-16: tmp = t_0 elif z <= 7.5e-47: tmp = x + math.sin(y) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * cos(y))) tmp = 0.0 if (z <= -4.8e-16) tmp = t_0; elseif (z <= 7.5e-47) tmp = Float64(x + sin(y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (z * cos(y)); tmp = 0.0; if (z <= -4.8e-16) tmp = t_0; elseif (z <= 7.5e-47) tmp = x + sin(y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-16], t$95$0, If[LessEqual[z, 7.5e-47], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-47}:\\
\;\;\;\;x + \sin y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.8000000000000001e-16 or 7.49999999999999969e-47 < z Initial program 99.9%
Taylor expanded in x around inf
Simplified98.1%
if -4.8000000000000001e-16 < z < 7.49999999999999969e-47Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f64N/A
sin-lowering-sin.f6498.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (<= x -8.8e-38) (+ x z) (if (<= x 6.5e-82) (* z (cos y)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (x <= -8.8e-38) {
tmp = x + z;
} else if (x <= 6.5e-82) {
tmp = z * cos(y);
} else {
tmp = x + z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-8.8d-38)) then
tmp = x + z
else if (x <= 6.5d-82) then
tmp = z * cos(y)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -8.8e-38) {
tmp = x + z;
} else if (x <= 6.5e-82) {
tmp = z * Math.cos(y);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8.8e-38: tmp = x + z elif x <= 6.5e-82: tmp = z * math.cos(y) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8.8e-38) tmp = Float64(x + z); elseif (x <= 6.5e-82) tmp = Float64(z * cos(y)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -8.8e-38) tmp = x + z; elseif (x <= 6.5e-82) tmp = z * cos(y); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8.8e-38], N[(x + z), $MachinePrecision], If[LessEqual[x, 6.5e-82], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{-38}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-82}:\\
\;\;\;\;z \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if x < -8.80000000000000029e-38 or 6.4999999999999997e-82 < x Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6483.3%
Simplified83.3%
if -8.80000000000000029e-38 < x < 6.4999999999999997e-82Initial program 99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cos-lowering-cos.f6468.8%
Simplified68.8%
Final simplification77.4%
(FPCore (x y z)
:precision binary64
(if (<= y -780.0)
(+ x z)
(if (<= y 1.4e+32)
(+ (* y (* y (+ (* z -0.5) (* y -0.16666666666666666)))) (+ y (+ x z)))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -780.0) {
tmp = x + z;
} else if (y <= 1.4e+32) {
tmp = (y * (y * ((z * -0.5) + (y * -0.16666666666666666)))) + (y + (x + z));
} else {
tmp = x + z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-780.0d0)) then
tmp = x + z
else if (y <= 1.4d+32) then
tmp = (y * (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0))))) + (y + (x + z))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -780.0) {
tmp = x + z;
} else if (y <= 1.4e+32) {
tmp = (y * (y * ((z * -0.5) + (y * -0.16666666666666666)))) + (y + (x + z));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -780.0: tmp = x + z elif y <= 1.4e+32: tmp = (y * (y * ((z * -0.5) + (y * -0.16666666666666666)))) + (y + (x + z)) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -780.0) tmp = Float64(x + z); elseif (y <= 1.4e+32) tmp = Float64(Float64(y * Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666)))) + Float64(y + Float64(x + z))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -780.0) tmp = x + z; elseif (y <= 1.4e+32) tmp = (y * (y * ((z * -0.5) + (y * -0.16666666666666666)))) + (y + (x + z)); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -780.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 1.4e+32], N[(N[(y * N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -780:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+32}:\\
\;\;\;\;y \cdot \left(y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right) + \left(y + \left(x + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -780 or 1.4e32 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6446.7%
Simplified46.7%
if -780 < y < 1.4e32Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.5%
Simplified98.5%
distribute-lft-inN/A
*-rgt-identityN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6498.5%
Applied egg-rr98.5%
Final simplification72.4%
(FPCore (x y z)
:precision binary64
(if (<= y -780.0)
(+ x z)
(if (<= y 1.4e+32)
(+ (+ x z) (* y (+ (* y (+ (* z -0.5) (* y -0.16666666666666666))) 1.0)))
(+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -780.0) {
tmp = x + z;
} else if (y <= 1.4e+32) {
tmp = (x + z) + (y * ((y * ((z * -0.5) + (y * -0.16666666666666666))) + 1.0));
} else {
tmp = x + z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-780.0d0)) then
tmp = x + z
else if (y <= 1.4d+32) then
tmp = (x + z) + (y * ((y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0)))) + 1.0d0))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -780.0) {
tmp = x + z;
} else if (y <= 1.4e+32) {
tmp = (x + z) + (y * ((y * ((z * -0.5) + (y * -0.16666666666666666))) + 1.0));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -780.0: tmp = x + z elif y <= 1.4e+32: tmp = (x + z) + (y * ((y * ((z * -0.5) + (y * -0.16666666666666666))) + 1.0)) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -780.0) tmp = Float64(x + z); elseif (y <= 1.4e+32) tmp = Float64(Float64(x + z) + Float64(y * Float64(Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))) + 1.0))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -780.0) tmp = x + z; elseif (y <= 1.4e+32) tmp = (x + z) + (y * ((y * ((z * -0.5) + (y * -0.16666666666666666))) + 1.0)); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -780.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 1.4e+32], N[(N[(x + z), $MachinePrecision] + N[(y * N[(N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -780:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+32}:\\
\;\;\;\;\left(x + z\right) + y \cdot \left(y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -780 or 1.4e32 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6446.7%
Simplified46.7%
if -780 < y < 1.4e32Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.5%
Simplified98.5%
Final simplification72.4%
(FPCore (x y z) :precision binary64 (if (<= y -1.35e+39) (+ x z) (if (<= y 1.75e+21) (+ y (+ x (* z (+ 1.0 (* y (* y -0.5)))))) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.35e+39) {
tmp = x + z;
} else if (y <= 1.75e+21) {
tmp = y + (x + (z * (1.0 + (y * (y * -0.5)))));
} else {
tmp = x + z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.35d+39)) then
tmp = x + z
else if (y <= 1.75d+21) then
tmp = y + (x + (z * (1.0d0 + (y * (y * (-0.5d0))))))
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.35e+39) {
tmp = x + z;
} else if (y <= 1.75e+21) {
tmp = y + (x + (z * (1.0 + (y * (y * -0.5)))));
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.35e+39: tmp = x + z elif y <= 1.75e+21: tmp = y + (x + (z * (1.0 + (y * (y * -0.5))))) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.35e+39) tmp = Float64(x + z); elseif (y <= 1.75e+21) tmp = Float64(y + Float64(x + Float64(z * Float64(1.0 + Float64(y * Float64(y * -0.5)))))); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.35e+39) tmp = x + z; elseif (y <= 1.75e+21) tmp = y + (x + (z * (1.0 + (y * (y * -0.5))))); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.35e+39], N[(x + z), $MachinePrecision], If[LessEqual[y, 1.75e+21], N[(y + N[(x + N[(z * N[(1.0 + N[(y * N[(y * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+39}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+21}:\\
\;\;\;\;y + \left(x + z \cdot \left(1 + y \cdot \left(y \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -1.35000000000000002e39 or 1.75e21 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6447.1%
Simplified47.1%
if -1.35000000000000002e39 < y < 1.75e21Initial 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
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Simplified98.4%
Final simplification72.4%
(FPCore (x y z) :precision binary64 (if (<= y -7.6e+53) (+ x z) (if (<= y 4200000.0) (+ y (+ x z)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7.6e+53) {
tmp = x + z;
} else if (y <= 4200000.0) {
tmp = y + (x + z);
} else {
tmp = x + z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-7.6d+53)) then
tmp = x + z
else if (y <= 4200000.0d0) then
tmp = y + (x + z)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7.6e+53) {
tmp = x + z;
} else if (y <= 4200000.0) {
tmp = y + (x + z);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7.6e+53: tmp = x + z elif y <= 4200000.0: tmp = y + (x + z) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7.6e+53) tmp = Float64(x + z); elseif (y <= 4200000.0) tmp = Float64(y + Float64(x + z)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7.6e+53) tmp = x + z; elseif (y <= 4200000.0) tmp = y + (x + z); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7.6e+53], N[(x + z), $MachinePrecision], If[LessEqual[y, 4200000.0], N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+53}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;y \leq 4200000:\\
\;\;\;\;y + \left(x + z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if y < -7.59999999999999995e53 or 4.2e6 < y Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6446.8%
Simplified46.8%
if -7.59999999999999995e53 < y < 4.2e6Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f6497.2%
Simplified97.2%
Final simplification72.4%
(FPCore (x y z) :precision binary64 (if (<= x -8.5e-11) x (if (<= x 2.4e+17) (+ y z) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -8.5e-11) {
tmp = x;
} else if (x <= 2.4e+17) {
tmp = y + z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-8.5d-11)) then
tmp = x
else if (x <= 2.4d+17) then
tmp = y + z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -8.5e-11) {
tmp = x;
} else if (x <= 2.4e+17) {
tmp = y + z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8.5e-11: tmp = x elif x <= 2.4e+17: tmp = y + z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8.5e-11) tmp = x; elseif (x <= 2.4e+17) tmp = Float64(y + z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -8.5e-11) tmp = x; elseif (x <= 2.4e+17) tmp = y + z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8.5e-11], x, If[LessEqual[x, 2.4e+17], N[(y + z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+17}:\\
\;\;\;\;y + z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -8.50000000000000037e-11 or 2.4e17 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified78.0%
if -8.50000000000000037e-11 < x < 2.4e17Initial program 99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f6493.9%
Simplified93.9%
Taylor expanded in y around 0
+-lowering-+.f6448.9%
Simplified48.9%
(FPCore (x y z) :precision binary64 (if (<= x -2.7e-10) x (if (<= x 4.5e+19) z x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.7e-10) {
tmp = x;
} else if (x <= 4.5e+19) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.7d-10)) then
tmp = x
else if (x <= 4.5d+19) then
tmp = z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.7e-10) {
tmp = x;
} else if (x <= 4.5e+19) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.7e-10: tmp = x elif x <= 4.5e+19: tmp = z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.7e-10) tmp = x; elseif (x <= 4.5e+19) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.7e-10) tmp = x; elseif (x <= 4.5e+19) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.7e-10], x, If[LessEqual[x, 4.5e+19], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+19}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.7e-10 or 4.5e19 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified78.0%
if -2.7e-10 < x < 4.5e19Initial program 99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f6493.9%
Simplified93.9%
Taylor expanded in y around 0
Simplified41.5%
(FPCore (x y z) :precision binary64 (if (<= x -8.5e-102) x (if (<= x 2e-85) y x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -8.5e-102) {
tmp = x;
} else if (x <= 2e-85) {
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 <= (-8.5d-102)) then
tmp = x
else if (x <= 2d-85) 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 <= -8.5e-102) {
tmp = x;
} else if (x <= 2e-85) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8.5e-102: tmp = x elif x <= 2e-85: tmp = y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8.5e-102) tmp = x; elseif (x <= 2e-85) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -8.5e-102) tmp = x; elseif (x <= 2e-85) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8.5e-102], x, If[LessEqual[x, 2e-85], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-102}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-85}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -8.49999999999999973e-102 or 2e-85 < x Initial program 99.9%
Taylor expanded in x around inf
Simplified67.6%
if -8.49999999999999973e-102 < x < 2e-85Initial program 99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sin-lowering-sin.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f6498.3%
Simplified98.3%
Taylor expanded in y around 0
+-lowering-+.f6451.1%
Simplified51.1%
Taylor expanded in y around inf
Simplified13.4%
(FPCore (x y z) :precision binary64 (+ x z))
double code(double x, double y, double z) {
return x + z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + z
end function
public static double code(double x, double y, double z) {
return x + z;
}
def code(x, y, z): return x + z
function code(x, y, z) return Float64(x + z) end
function tmp = code(x, y, z) tmp = x + z; end
code[x_, y_, z_] := N[(x + z), $MachinePrecision]
\begin{array}{l}
\\
x + z
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f6467.3%
Simplified67.3%
Final simplification67.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
Simplified43.9%
herbie shell --seed 2024191
(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))))