
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - 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 + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - 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 + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.11)
t_0
(if (<= z -7.5e-132)
(* x -3.0)
(if (<= z -2.1e-198)
(* y 4.0)
(if (<= z 6e-289)
(* x -3.0)
(if (<= z 3.15e-201)
(* y 4.0)
(if (<= z 1.7e-56)
(* x -3.0)
(if (<= z 0.58) (* y 4.0) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.11) {
tmp = t_0;
} else if (z <= -7.5e-132) {
tmp = x * -3.0;
} else if (z <= -2.1e-198) {
tmp = y * 4.0;
} else if (z <= 6e-289) {
tmp = x * -3.0;
} else if (z <= 3.15e-201) {
tmp = y * 4.0;
} else if (z <= 1.7e-56) {
tmp = x * -3.0;
} else if (z <= 0.58) {
tmp = y * 4.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 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.11d0)) then
tmp = t_0
else if (z <= (-7.5d-132)) then
tmp = x * (-3.0d0)
else if (z <= (-2.1d-198)) then
tmp = y * 4.0d0
else if (z <= 6d-289) then
tmp = x * (-3.0d0)
else if (z <= 3.15d-201) then
tmp = y * 4.0d0
else if (z <= 1.7d-56) then
tmp = x * (-3.0d0)
else if (z <= 0.58d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.11) {
tmp = t_0;
} else if (z <= -7.5e-132) {
tmp = x * -3.0;
} else if (z <= -2.1e-198) {
tmp = y * 4.0;
} else if (z <= 6e-289) {
tmp = x * -3.0;
} else if (z <= 3.15e-201) {
tmp = y * 4.0;
} else if (z <= 1.7e-56) {
tmp = x * -3.0;
} else if (z <= 0.58) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.11: tmp = t_0 elif z <= -7.5e-132: tmp = x * -3.0 elif z <= -2.1e-198: tmp = y * 4.0 elif z <= 6e-289: tmp = x * -3.0 elif z <= 3.15e-201: tmp = y * 4.0 elif z <= 1.7e-56: tmp = x * -3.0 elif z <= 0.58: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.11) tmp = t_0; elseif (z <= -7.5e-132) tmp = Float64(x * -3.0); elseif (z <= -2.1e-198) tmp = Float64(y * 4.0); elseif (z <= 6e-289) tmp = Float64(x * -3.0); elseif (z <= 3.15e-201) tmp = Float64(y * 4.0); elseif (z <= 1.7e-56) tmp = Float64(x * -3.0); elseif (z <= 0.58) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.11) tmp = t_0; elseif (z <= -7.5e-132) tmp = x * -3.0; elseif (z <= -2.1e-198) tmp = y * 4.0; elseif (z <= 6e-289) tmp = x * -3.0; elseif (z <= 3.15e-201) tmp = y * 4.0; elseif (z <= 1.7e-56) tmp = x * -3.0; elseif (z <= 0.58) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.11], t$95$0, If[LessEqual[z, -7.5e-132], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.1e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6e-289], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.15e-201], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.7e-56], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.58], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.11:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-132}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-289}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-201}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-56}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.110000000000000001 or 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.8%
if -0.110000000000000001 < z < -7.49999999999999989e-132 or -2.09999999999999993e-198 < z < 5.9999999999999996e-289 or 3.15e-201 < z < 1.69999999999999991e-56Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 68.7%
Taylor expanded in z around 0 66.9%
distribute-lft1-in66.9%
metadata-eval66.9%
*-commutative66.9%
Simplified66.9%
if -7.49999999999999989e-132 < z < -2.09999999999999993e-198 or 5.9999999999999996e-289 < z < 3.15e-201 or 1.69999999999999991e-56 < z < 0.57999999999999996Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification83.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* (- y x) -6.0))))
(if (<= z -0.11)
t_0
(if (<= z -1.42e-129)
(* x -3.0)
(if (<= z -7e-198)
(* y 4.0)
(if (<= z 1.35e-289)
(* x -3.0)
(if (<= z 1.9e-201)
(* y 4.0)
(if (<= z 4.7e-60)
(* x -3.0)
(if (<= z 0.66) (* y 4.0) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.11) {
tmp = t_0;
} else if (z <= -1.42e-129) {
tmp = x * -3.0;
} else if (z <= -7e-198) {
tmp = y * 4.0;
} else if (z <= 1.35e-289) {
tmp = x * -3.0;
} else if (z <= 1.9e-201) {
tmp = y * 4.0;
} else if (z <= 4.7e-60) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.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 = z * ((y - x) * (-6.0d0))
if (z <= (-0.11d0)) then
tmp = t_0
else if (z <= (-1.42d-129)) then
tmp = x * (-3.0d0)
else if (z <= (-7d-198)) then
tmp = y * 4.0d0
else if (z <= 1.35d-289) then
tmp = x * (-3.0d0)
else if (z <= 1.9d-201) then
tmp = y * 4.0d0
else if (z <= 4.7d-60) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.11) {
tmp = t_0;
} else if (z <= -1.42e-129) {
tmp = x * -3.0;
} else if (z <= -7e-198) {
tmp = y * 4.0;
} else if (z <= 1.35e-289) {
tmp = x * -3.0;
} else if (z <= 1.9e-201) {
tmp = y * 4.0;
} else if (z <= 4.7e-60) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -0.11: tmp = t_0 elif z <= -1.42e-129: tmp = x * -3.0 elif z <= -7e-198: tmp = y * 4.0 elif z <= 1.35e-289: tmp = x * -3.0 elif z <= 1.9e-201: tmp = y * 4.0 elif z <= 4.7e-60: tmp = x * -3.0 elif z <= 0.66: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(y - x) * -6.0)) tmp = 0.0 if (z <= -0.11) tmp = t_0; elseif (z <= -1.42e-129) tmp = Float64(x * -3.0); elseif (z <= -7e-198) tmp = Float64(y * 4.0); elseif (z <= 1.35e-289) tmp = Float64(x * -3.0); elseif (z <= 1.9e-201) tmp = Float64(y * 4.0); elseif (z <= 4.7e-60) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -0.11) tmp = t_0; elseif (z <= -1.42e-129) tmp = x * -3.0; elseif (z <= -7e-198) tmp = y * 4.0; elseif (z <= 1.35e-289) tmp = x * -3.0; elseif (z <= 1.9e-201) tmp = y * 4.0; elseif (z <= 4.7e-60) tmp = x * -3.0; elseif (z <= 0.66) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.11], t$95$0, If[LessEqual[z, -1.42e-129], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-289], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.9e-201], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.7e-60], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -0.11:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-129}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-289}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-201}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-60}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.110000000000000001 or 0.660000000000000031 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.8%
associate-*r*98.9%
*-commutative98.9%
associate-*l*98.9%
Simplified98.9%
if -0.110000000000000001 < z < -1.42e-129 or -7.0000000000000005e-198 < z < 1.35e-289 or 1.9e-201 < z < 4.7e-60Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 68.7%
Taylor expanded in z around 0 66.9%
distribute-lft1-in66.9%
metadata-eval66.9%
*-commutative66.9%
Simplified66.9%
if -1.42e-129 < z < -7.0000000000000005e-198 or 1.35e-289 < z < 1.9e-201 or 4.7e-60 < z < 0.660000000000000031Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification83.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* (- y x) -6.0))))
(if (<= z -0.11)
t_0
(if (<= z -6e-130)
(* x -3.0)
(if (<= z -3e-198)
(* y 4.0)
(if (<= z 1.65e-289)
(* x -3.0)
(if (<= z 6.6e-202)
(* y 4.0)
(if (<= z 1.2e-56)
(* x -3.0)
(if (<= z 16000000000.0) (* y (+ 4.0 (* z -6.0))) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.11) {
tmp = t_0;
} else if (z <= -6e-130) {
tmp = x * -3.0;
} else if (z <= -3e-198) {
tmp = y * 4.0;
} else if (z <= 1.65e-289) {
tmp = x * -3.0;
} else if (z <= 6.6e-202) {
tmp = y * 4.0;
} else if (z <= 1.2e-56) {
tmp = x * -3.0;
} else if (z <= 16000000000.0) {
tmp = y * (4.0 + (z * -6.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 = z * ((y - x) * (-6.0d0))
if (z <= (-0.11d0)) then
tmp = t_0
else if (z <= (-6d-130)) then
tmp = x * (-3.0d0)
else if (z <= (-3d-198)) then
tmp = y * 4.0d0
else if (z <= 1.65d-289) then
tmp = x * (-3.0d0)
else if (z <= 6.6d-202) then
tmp = y * 4.0d0
else if (z <= 1.2d-56) then
tmp = x * (-3.0d0)
else if (z <= 16000000000.0d0) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.11) {
tmp = t_0;
} else if (z <= -6e-130) {
tmp = x * -3.0;
} else if (z <= -3e-198) {
tmp = y * 4.0;
} else if (z <= 1.65e-289) {
tmp = x * -3.0;
} else if (z <= 6.6e-202) {
tmp = y * 4.0;
} else if (z <= 1.2e-56) {
tmp = x * -3.0;
} else if (z <= 16000000000.0) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -0.11: tmp = t_0 elif z <= -6e-130: tmp = x * -3.0 elif z <= -3e-198: tmp = y * 4.0 elif z <= 1.65e-289: tmp = x * -3.0 elif z <= 6.6e-202: tmp = y * 4.0 elif z <= 1.2e-56: tmp = x * -3.0 elif z <= 16000000000.0: tmp = y * (4.0 + (z * -6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(Float64(y - x) * -6.0)) tmp = 0.0 if (z <= -0.11) tmp = t_0; elseif (z <= -6e-130) tmp = Float64(x * -3.0); elseif (z <= -3e-198) tmp = Float64(y * 4.0); elseif (z <= 1.65e-289) tmp = Float64(x * -3.0); elseif (z <= 6.6e-202) tmp = Float64(y * 4.0); elseif (z <= 1.2e-56) tmp = Float64(x * -3.0); elseif (z <= 16000000000.0) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -0.11) tmp = t_0; elseif (z <= -6e-130) tmp = x * -3.0; elseif (z <= -3e-198) tmp = y * 4.0; elseif (z <= 1.65e-289) tmp = x * -3.0; elseif (z <= 6.6e-202) tmp = y * 4.0; elseif (z <= 1.2e-56) tmp = x * -3.0; elseif (z <= 16000000000.0) tmp = y * (4.0 + (z * -6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.11], t$95$0, If[LessEqual[z, -6e-130], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.65e-289], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.6e-202], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e-56], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 16000000000.0], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -0.11:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-130}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-289}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-202}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-56}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 16000000000:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.110000000000000001 or 1.6e10 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 99.7%
associate-*r*99.8%
*-commutative99.8%
associate-*l*99.7%
Simplified99.7%
if -0.110000000000000001 < z < -5.99999999999999972e-130 or -3.0000000000000001e-198 < z < 1.64999999999999999e-289 or 6.59999999999999979e-202 < z < 1.2e-56Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 68.7%
Taylor expanded in z around 0 66.9%
distribute-lft1-in66.9%
metadata-eval66.9%
*-commutative66.9%
Simplified66.9%
if -5.99999999999999972e-130 < z < -3.0000000000000001e-198 or 1.64999999999999999e-289 < z < 6.59999999999999979e-202Initial program 99.4%
+-commutative99.4%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 74.1%
Taylor expanded in z around 0 74.1%
*-commutative74.1%
Simplified74.1%
if 1.2e-56 < z < 1.6e10Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 62.8%
Final simplification83.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.35)
t_0
(if (<= z -1.42e-129)
(* x -3.0)
(if (<= z -3.05e-198)
(* y 4.0)
(if (<= z 3.2e-288)
(* x -3.0)
(if (<= z 2.2e-201)
(* y 4.0)
(if (<= z 1.35e-57)
(* x -3.0)
(if (<= z 0.66) (* y 4.0) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.35) {
tmp = t_0;
} else if (z <= -1.42e-129) {
tmp = x * -3.0;
} else if (z <= -3.05e-198) {
tmp = y * 4.0;
} else if (z <= 3.2e-288) {
tmp = x * -3.0;
} else if (z <= 2.2e-201) {
tmp = y * 4.0;
} else if (z <= 1.35e-57) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.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 = (-6.0d0) * (y * z)
if (z <= (-1.35d0)) then
tmp = t_0
else if (z <= (-1.42d-129)) then
tmp = x * (-3.0d0)
else if (z <= (-3.05d-198)) then
tmp = y * 4.0d0
else if (z <= 3.2d-288) then
tmp = x * (-3.0d0)
else if (z <= 2.2d-201) then
tmp = y * 4.0d0
else if (z <= 1.35d-57) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.35) {
tmp = t_0;
} else if (z <= -1.42e-129) {
tmp = x * -3.0;
} else if (z <= -3.05e-198) {
tmp = y * 4.0;
} else if (z <= 3.2e-288) {
tmp = x * -3.0;
} else if (z <= 2.2e-201) {
tmp = y * 4.0;
} else if (z <= 1.35e-57) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.35: tmp = t_0 elif z <= -1.42e-129: tmp = x * -3.0 elif z <= -3.05e-198: tmp = y * 4.0 elif z <= 3.2e-288: tmp = x * -3.0 elif z <= 2.2e-201: tmp = y * 4.0 elif z <= 1.35e-57: tmp = x * -3.0 elif z <= 0.66: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.35) tmp = t_0; elseif (z <= -1.42e-129) tmp = Float64(x * -3.0); elseif (z <= -3.05e-198) tmp = Float64(y * 4.0); elseif (z <= 3.2e-288) tmp = Float64(x * -3.0); elseif (z <= 2.2e-201) tmp = Float64(y * 4.0); elseif (z <= 1.35e-57) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.35) tmp = t_0; elseif (z <= -1.42e-129) tmp = x * -3.0; elseif (z <= -3.05e-198) tmp = y * 4.0; elseif (z <= 3.2e-288) tmp = x * -3.0; elseif (z <= 2.2e-201) tmp = y * 4.0; elseif (z <= 1.35e-57) tmp = x * -3.0; elseif (z <= 0.66) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35], t$95$0, If[LessEqual[z, -1.42e-129], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.05e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.2e-288], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.2e-201], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-57], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.35:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-129}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.05 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-288}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-201}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.3500000000000001 or 0.660000000000000031 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.8%
Taylor expanded in y around inf 45.6%
*-commutative45.6%
Simplified45.6%
if -1.3500000000000001 < z < -1.42e-129 or -3.05e-198 < z < 3.2e-288 or 2.2e-201 < z < 1.3500000000000001e-57Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 68.7%
Taylor expanded in z around 0 66.9%
distribute-lft1-in66.9%
metadata-eval66.9%
*-commutative66.9%
Simplified66.9%
if -1.42e-129 < z < -3.05e-198 or 3.2e-288 < z < 2.2e-201 or 1.3500000000000001e-57 < z < 0.660000000000000031Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification57.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -0.5)
t_0
(if (<= z -4e-130)
(* x -3.0)
(if (<= z -5e-198)
(* y 4.0)
(if (<= z 2.95e-288)
(* x -3.0)
(if (<= z 7.8e-201)
(* y 4.0)
(if (<= z 7e-57) (* x -3.0) (if (<= z 0.66) (* y 4.0) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -4e-130) {
tmp = x * -3.0;
} else if (z <= -5e-198) {
tmp = y * 4.0;
} else if (z <= 2.95e-288) {
tmp = x * -3.0;
} else if (z <= 7.8e-201) {
tmp = y * 4.0;
} else if (z <= 7e-57) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.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 = 6.0d0 * (x * z)
if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= (-4d-130)) then
tmp = x * (-3.0d0)
else if (z <= (-5d-198)) then
tmp = y * 4.0d0
else if (z <= 2.95d-288) then
tmp = x * (-3.0d0)
else if (z <= 7.8d-201) then
tmp = y * 4.0d0
else if (z <= 7d-57) then
tmp = x * (-3.0d0)
else if (z <= 0.66d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -4e-130) {
tmp = x * -3.0;
} else if (z <= -5e-198) {
tmp = y * 4.0;
} else if (z <= 2.95e-288) {
tmp = x * -3.0;
} else if (z <= 7.8e-201) {
tmp = y * 4.0;
} else if (z <= 7e-57) {
tmp = x * -3.0;
} else if (z <= 0.66) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -0.5: tmp = t_0 elif z <= -4e-130: tmp = x * -3.0 elif z <= -5e-198: tmp = y * 4.0 elif z <= 2.95e-288: tmp = x * -3.0 elif z <= 7.8e-201: tmp = y * 4.0 elif z <= 7e-57: tmp = x * -3.0 elif z <= 0.66: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -0.5) tmp = t_0; elseif (z <= -4e-130) tmp = Float64(x * -3.0); elseif (z <= -5e-198) tmp = Float64(y * 4.0); elseif (z <= 2.95e-288) tmp = Float64(x * -3.0); elseif (z <= 7.8e-201) tmp = Float64(y * 4.0); elseif (z <= 7e-57) tmp = Float64(x * -3.0); elseif (z <= 0.66) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -0.5) tmp = t_0; elseif (z <= -4e-130) tmp = x * -3.0; elseif (z <= -5e-198) tmp = y * 4.0; elseif (z <= 2.95e-288) tmp = x * -3.0; elseif (z <= 7.8e-201) tmp = y * 4.0; elseif (z <= 7e-57) tmp = x * -3.0; elseif (z <= 0.66) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, -4e-130], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.95e-288], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7.8e-201], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7e-57], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-130}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{-288}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-201}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-57}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.5 or 0.660000000000000031 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 54.8%
Taylor expanded in z around inf 54.2%
if -0.5 < z < -4.0000000000000003e-130 or -4.9999999999999999e-198 < z < 2.95000000000000007e-288 or 7.8000000000000006e-201 < z < 6.99999999999999983e-57Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 68.7%
Taylor expanded in z around 0 66.9%
distribute-lft1-in66.9%
metadata-eval66.9%
*-commutative66.9%
Simplified66.9%
if -4.0000000000000003e-130 < z < -4.9999999999999999e-198 or 2.95000000000000007e-288 < z < 7.8000000000000006e-201 or 6.99999999999999983e-57 < z < 0.660000000000000031Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification61.3%
(FPCore (x y z)
:precision binary64
(if (<= z -0.5)
(* x (* z 6.0))
(if (<= z -4.2e-132)
(* x -3.0)
(if (<= z -3.6e-198)
(* y 4.0)
(if (<= z 2.2e-287)
(* x -3.0)
(if (<= z 1.12e-201)
(* y 4.0)
(if (<= z 9.5e-63)
(* x -3.0)
(if (<= z 0.5) (* y 4.0) (* 6.0 (* x z))))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.5) {
tmp = x * (z * 6.0);
} else if (z <= -4.2e-132) {
tmp = x * -3.0;
} else if (z <= -3.6e-198) {
tmp = y * 4.0;
} else if (z <= 2.2e-287) {
tmp = x * -3.0;
} else if (z <= 1.12e-201) {
tmp = y * 4.0;
} else if (z <= 9.5e-63) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (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 (z <= (-0.5d0)) then
tmp = x * (z * 6.0d0)
else if (z <= (-4.2d-132)) then
tmp = x * (-3.0d0)
else if (z <= (-3.6d-198)) then
tmp = y * 4.0d0
else if (z <= 2.2d-287) then
tmp = x * (-3.0d0)
else if (z <= 1.12d-201) then
tmp = y * 4.0d0
else if (z <= 9.5d-63) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) then
tmp = y * 4.0d0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.5) {
tmp = x * (z * 6.0);
} else if (z <= -4.2e-132) {
tmp = x * -3.0;
} else if (z <= -3.6e-198) {
tmp = y * 4.0;
} else if (z <= 2.2e-287) {
tmp = x * -3.0;
} else if (z <= 1.12e-201) {
tmp = y * 4.0;
} else if (z <= 9.5e-63) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.5: tmp = x * (z * 6.0) elif z <= -4.2e-132: tmp = x * -3.0 elif z <= -3.6e-198: tmp = y * 4.0 elif z <= 2.2e-287: tmp = x * -3.0 elif z <= 1.12e-201: tmp = y * 4.0 elif z <= 9.5e-63: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.5) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -4.2e-132) tmp = Float64(x * -3.0); elseif (z <= -3.6e-198) tmp = Float64(y * 4.0); elseif (z <= 2.2e-287) tmp = Float64(x * -3.0); elseif (z <= 1.12e-201) tmp = Float64(y * 4.0); elseif (z <= 9.5e-63) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(y * 4.0); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.5) tmp = x * (z * 6.0); elseif (z <= -4.2e-132) tmp = x * -3.0; elseif (z <= -3.6e-198) tmp = y * 4.0; elseif (z <= 2.2e-287) tmp = x * -3.0; elseif (z <= 1.12e-201) tmp = y * 4.0; elseif (z <= 9.5e-63) tmp = x * -3.0; elseif (z <= 0.5) tmp = y * 4.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.5], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-132], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.6e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.2e-287], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.12e-201], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.5e-63], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-132}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-287}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-201}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-63}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -0.5Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 57.1%
Taylor expanded in z around inf 57.1%
if -0.5 < z < -4.2000000000000002e-132 or -3.59999999999999998e-198 < z < 2.2e-287 or 1.12e-201 < z < 9.50000000000000016e-63Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 68.7%
Taylor expanded in z around 0 66.9%
distribute-lft1-in66.9%
metadata-eval66.9%
*-commutative66.9%
Simplified66.9%
if -4.2000000000000002e-132 < z < -3.59999999999999998e-198 or 2.2e-287 < z < 1.12e-201 or 9.50000000000000016e-63 < z < 0.5Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 71.1%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around inf 52.5%
Taylor expanded in z around inf 51.3%
Final simplification61.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ 4.0 (* z -6.0)))) (t_1 (* x (- (* z 6.0) 3.0))))
(if (<= x -7e-13)
t_1
(if (<= x -2.6e-103)
t_0
(if (<= x -1e-142)
(* -6.0 (* (- y x) z))
(if (<= x 1.05e-65)
t_0
(if (<= x 5.2e-8)
(* z (* (- y x) -6.0))
(if (<= x 1.62e+109) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double t_1 = x * ((z * 6.0) - 3.0);
double tmp;
if (x <= -7e-13) {
tmp = t_1;
} else if (x <= -2.6e-103) {
tmp = t_0;
} else if (x <= -1e-142) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 1.05e-65) {
tmp = t_0;
} else if (x <= 5.2e-8) {
tmp = z * ((y - x) * -6.0);
} else if (x <= 1.62e+109) {
tmp = 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 = y * (4.0d0 + (z * (-6.0d0)))
t_1 = x * ((z * 6.0d0) - 3.0d0)
if (x <= (-7d-13)) then
tmp = t_1
else if (x <= (-2.6d-103)) then
tmp = t_0
else if (x <= (-1d-142)) then
tmp = (-6.0d0) * ((y - x) * z)
else if (x <= 1.05d-65) then
tmp = t_0
else if (x <= 5.2d-8) then
tmp = z * ((y - x) * (-6.0d0))
else if (x <= 1.62d+109) then
tmp = 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 = y * (4.0 + (z * -6.0));
double t_1 = x * ((z * 6.0) - 3.0);
double tmp;
if (x <= -7e-13) {
tmp = t_1;
} else if (x <= -2.6e-103) {
tmp = t_0;
} else if (x <= -1e-142) {
tmp = -6.0 * ((y - x) * z);
} else if (x <= 1.05e-65) {
tmp = t_0;
} else if (x <= 5.2e-8) {
tmp = z * ((y - x) * -6.0);
} else if (x <= 1.62e+109) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * (4.0 + (z * -6.0)) t_1 = x * ((z * 6.0) - 3.0) tmp = 0 if x <= -7e-13: tmp = t_1 elif x <= -2.6e-103: tmp = t_0 elif x <= -1e-142: tmp = -6.0 * ((y - x) * z) elif x <= 1.05e-65: tmp = t_0 elif x <= 5.2e-8: tmp = z * ((y - x) * -6.0) elif x <= 1.62e+109: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(4.0 + Float64(z * -6.0))) t_1 = Float64(x * Float64(Float64(z * 6.0) - 3.0)) tmp = 0.0 if (x <= -7e-13) tmp = t_1; elseif (x <= -2.6e-103) tmp = t_0; elseif (x <= -1e-142) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif (x <= 1.05e-65) tmp = t_0; elseif (x <= 5.2e-8) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (x <= 1.62e+109) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (4.0 + (z * -6.0)); t_1 = x * ((z * 6.0) - 3.0); tmp = 0.0; if (x <= -7e-13) tmp = t_1; elseif (x <= -2.6e-103) tmp = t_0; elseif (x <= -1e-142) tmp = -6.0 * ((y - x) * z); elseif (x <= 1.05e-65) tmp = t_0; elseif (x <= 5.2e-8) tmp = z * ((y - x) * -6.0); elseif (x <= 1.62e+109) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e-13], t$95$1, If[LessEqual[x, -2.6e-103], t$95$0, If[LessEqual[x, -1e-142], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-65], t$95$0, If[LessEqual[x, 5.2e-8], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.62e+109], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(4 + z \cdot -6\right)\\
t_1 := x \cdot \left(z \cdot 6 - 3\right)\\
\mathbf{if}\;x \leq -7 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-103}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-142}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-8}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;x \leq 1.62 \cdot 10^{+109}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -7.0000000000000005e-13 or 1.62e109 < x Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 88.1%
if -7.0000000000000005e-13 < x < -2.59999999999999996e-103 or -1e-142 < x < 1.05000000000000001e-65 or 5.2000000000000002e-8 < x < 1.62e109Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.7%
sub-neg99.7%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 76.7%
if -2.59999999999999996e-103 < x < -1e-142Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 99.6%
if 1.05000000000000001e-65 < x < 5.2000000000000002e-8Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 91.4%
associate-*r*91.5%
*-commutative91.5%
associate-*l*91.5%
Simplified91.5%
Final simplification83.1%
(FPCore (x y z) :precision binary64 (+ (* (- y x) 4.0) (+ x (* -6.0 (* (- y x) z)))))
double code(double x, double y, double z) {
return ((y - x) * 4.0) + (x + (-6.0 * ((y - 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 = ((y - x) * 4.0d0) + (x + ((-6.0d0) * ((y - x) * z)))
end function
public static double code(double x, double y, double z) {
return ((y - x) * 4.0) + (x + (-6.0 * ((y - x) * z)));
}
def code(x, y, z): return ((y - x) * 4.0) + (x + (-6.0 * ((y - x) * z)))
function code(x, y, z) return Float64(Float64(Float64(y - x) * 4.0) + Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z)))) end
function tmp = code(x, y, z) tmp = ((y - x) * 4.0) + (x + (-6.0 * ((y - x) * z))); end
code[x_, y_, z_] := N[(N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision] + N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y - x\right) \cdot 4 + \left(x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.55) (not (<= z 0.5))) (* z (* (- y x) -6.0)) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.55) || !(z <= 0.5)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = (x * -3.0) + (y * 4.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 <= (-0.55d0)) .or. (.not. (z <= 0.5d0))) then
tmp = z * ((y - x) * (-6.0d0))
else
tmp = (x * (-3.0d0)) + (y * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.55) || !(z <= 0.5)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.55) or not (z <= 0.5): tmp = z * ((y - x) * -6.0) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.55) || !(z <= 0.5)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); else tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.55) || ~((z <= 0.5))) tmp = z * ((y - x) * -6.0); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.55], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.55 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.55000000000000004 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.8%
associate-*r*98.9%
*-commutative98.9%
associate-*l*98.9%
Simplified98.9%
if -0.55000000000000004 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 97.3%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.68) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.55) (+ (* x -3.0) (* y 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.68) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.55) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y - x) * -6.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 <= (-0.68d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.55d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.68) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.55) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.68: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.55: tmp = (x * -3.0) + (y * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.68) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.55) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.68) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.55) tmp = (x * -3.0) + (y * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.68], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.55], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.68:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.680000000000000049Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 99.6%
associate-*r*99.9%
*-commutative99.9%
*-commutative99.9%
*-commutative99.9%
Simplified99.9%
if -0.680000000000000049 < z < 0.55000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 97.3%
if 0.55000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.0%
associate-*r*98.0%
*-commutative98.0%
associate-*l*98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - 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 + (((y - x) * 6.0d0) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (<= x -340000000000.0) (* x -3.0) (if (<= x 7.6e+107) (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -340000000000.0) {
tmp = x * -3.0;
} else if (x <= 7.6e+107) {
tmp = y * 4.0;
} else {
tmp = x * -3.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 <= (-340000000000.0d0)) then
tmp = x * (-3.0d0)
else if (x <= 7.6d+107) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -340000000000.0) {
tmp = x * -3.0;
} else if (x <= 7.6e+107) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -340000000000.0: tmp = x * -3.0 elif x <= 7.6e+107: tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -340000000000.0) tmp = Float64(x * -3.0); elseif (x <= 7.6e+107) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -340000000000.0) tmp = x * -3.0; elseif (x <= 7.6e+107) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -340000000000.0], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 7.6e+107], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -340000000000:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{+107}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -3.4e11 or 7.5999999999999996e107 < x Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 87.5%
Taylor expanded in z around 0 45.7%
distribute-lft1-in45.7%
metadata-eval45.7%
*-commutative45.7%
Simplified45.7%
if -3.4e11 < x < 7.5999999999999996e107Initial program 99.5%
+-commutative99.5%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 71.0%
Taylor expanded in z around 0 37.9%
*-commutative37.9%
Simplified37.9%
Final simplification41.2%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.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 * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 54.1%
Taylor expanded in z around 0 27.5%
distribute-lft1-in27.5%
metadata-eval27.5%
*-commutative27.5%
Simplified27.5%
Final simplification27.5%
herbie shell --seed 2023268
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))