
(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 (+ 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}
Initial program 99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -2e+198)
(* y (* z -6.0))
(if (<= z -0.5)
t_0
(if (<= z 2.55e-275)
(* x -3.0)
(if (<= z 0.5)
(* y 4.0)
(if (<= z 4.1e+187) t_0 (* z (* y -6.0)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -2e+198) {
tmp = y * (z * -6.0);
} else if (z <= -0.5) {
tmp = t_0;
} else if (z <= 2.55e-275) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else if (z <= 4.1e+187) {
tmp = t_0;
} else {
tmp = z * (y * -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) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
if (z <= (-2d+198)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= 2.55d-275) then
tmp = x * (-3.0d0)
else if (z <= 0.5d0) then
tmp = y * 4.0d0
else if (z <= 4.1d+187) then
tmp = t_0
else
tmp = z * (y * (-6.0d0))
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 <= -2e+198) {
tmp = y * (z * -6.0);
} else if (z <= -0.5) {
tmp = t_0;
} else if (z <= 2.55e-275) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else if (z <= 4.1e+187) {
tmp = t_0;
} else {
tmp = z * (y * -6.0);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -2e+198: tmp = y * (z * -6.0) elif z <= -0.5: tmp = t_0 elif z <= 2.55e-275: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 elif z <= 4.1e+187: tmp = t_0 else: tmp = z * (y * -6.0) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -2e+198) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -0.5) tmp = t_0; elseif (z <= 2.55e-275) tmp = Float64(x * -3.0); elseif (z <= 0.5) tmp = Float64(y * 4.0); elseif (z <= 4.1e+187) tmp = t_0; else tmp = Float64(z * Float64(y * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -2e+198) tmp = y * (z * -6.0); elseif (z <= -0.5) tmp = t_0; elseif (z <= 2.55e-275) tmp = x * -3.0; elseif (z <= 0.5) tmp = y * 4.0; elseif (z <= 4.1e+187) tmp = t_0; else tmp = z * (y * -6.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, -2e+198], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, 2.55e-275], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.1e+187], t$95$0, N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+198}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-275}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+187}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\end{array}
\end{array}
if z < -2.00000000000000004e198Initial program 99.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6474.7%
Simplified74.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.8%
Simplified74.8%
if -2.00000000000000004e198 < z < -0.5 or 0.5 < z < 4.1e187Initial program 99.7%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6495.0%
Simplified95.0%
Taylor expanded in y around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6458.4%
Simplified58.4%
if -0.5 < z < 2.54999999999999992e-275Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified97.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6458.0%
Simplified58.0%
if 2.54999999999999992e-275 < z < 0.5Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6460.2%
Simplified60.2%
Taylor expanded in z around 0
*-lowering-*.f6459.3%
Simplified59.3%
if 4.1e187 < z Initial program 100.0%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6499.8%
Simplified99.8%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6466.4%
Simplified66.4%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6466.5%
Applied egg-rr66.5%
Final simplification60.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))) (t_1 (* 6.0 (* x z))))
(if (<= z -8e+195)
t_0
(if (<= z -0.5)
t_1
(if (<= z 1.15e-288)
(* x -3.0)
(if (<= z 0.55) (* y 4.0) (if (<= z 1.12e+193) t_1 t_0)))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -8e+195) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = t_1;
} else if (z <= 1.15e-288) {
tmp = x * -3.0;
} else if (z <= 0.55) {
tmp = y * 4.0;
} else if (z <= 1.12e+193) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
t_1 = 6.0d0 * (x * z)
if (z <= (-8d+195)) then
tmp = t_0
else if (z <= (-0.5d0)) then
tmp = t_1
else if (z <= 1.15d-288) then
tmp = x * (-3.0d0)
else if (z <= 0.55d0) then
tmp = y * 4.0d0
else if (z <= 1.12d+193) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -8e+195) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = t_1;
} else if (z <= 1.15e-288) {
tmp = x * -3.0;
} else if (z <= 0.55) {
tmp = y * 4.0;
} else if (z <= 1.12e+193) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) t_1 = 6.0 * (x * z) tmp = 0 if z <= -8e+195: tmp = t_0 elif z <= -0.5: tmp = t_1 elif z <= 1.15e-288: tmp = x * -3.0 elif z <= 0.55: tmp = y * 4.0 elif z <= 1.12e+193: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) t_1 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -8e+195) tmp = t_0; elseif (z <= -0.5) tmp = t_1; elseif (z <= 1.15e-288) tmp = Float64(x * -3.0); elseif (z <= 0.55) tmp = Float64(y * 4.0); elseif (z <= 1.12e+193) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); t_1 = 6.0 * (x * z); tmp = 0.0; if (z <= -8e+195) tmp = t_0; elseif (z <= -0.5) tmp = t_1; elseif (z <= 1.15e-288) tmp = x * -3.0; elseif (z <= 0.55) tmp = y * 4.0; elseif (z <= 1.12e+193) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+195], t$95$0, If[LessEqual[z, -0.5], t$95$1, If[LessEqual[z, 1.15e-288], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.12e+193], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
t_1 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{+195}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-288}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7.99999999999999982e195 or 1.1199999999999999e193 < z Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6470.5%
Simplified70.5%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.6%
Simplified70.6%
if -7.99999999999999982e195 < z < -0.5 or 0.55000000000000004 < z < 1.1199999999999999e193Initial program 99.7%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6495.0%
Simplified95.0%
Taylor expanded in y around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6458.4%
Simplified58.4%
if -0.5 < z < 1.15e-288Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified97.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6458.0%
Simplified58.0%
if 1.15e-288 < z < 0.55000000000000004Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6460.2%
Simplified60.2%
Taylor expanded in z around 0
*-lowering-*.f6459.3%
Simplified59.3%
Final simplification60.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
(if (<= z -6e+195)
t_0
(if (<= z -0.5)
t_1
(if (<= z 1.75e-288)
(* x -3.0)
(if (<= z 0.68) (* y 4.0) (if (<= z 6.4e+193) t_1 t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -6e+195) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = t_1;
} else if (z <= 1.75e-288) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = y * 4.0;
} else if (z <= 6.4e+193) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = 6.0d0 * (x * z)
if (z <= (-6d+195)) then
tmp = t_0
else if (z <= (-0.5d0)) then
tmp = t_1
else if (z <= 1.75d-288) then
tmp = x * (-3.0d0)
else if (z <= 0.68d0) then
tmp = y * 4.0d0
else if (z <= 6.4d+193) then
tmp = t_1
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 t_1 = 6.0 * (x * z);
double tmp;
if (z <= -6e+195) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = t_1;
} else if (z <= 1.75e-288) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = y * 4.0;
} else if (z <= 6.4e+193) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = 6.0 * (x * z) tmp = 0 if z <= -6e+195: tmp = t_0 elif z <= -0.5: tmp = t_1 elif z <= 1.75e-288: tmp = x * -3.0 elif z <= 0.68: tmp = y * 4.0 elif z <= 6.4e+193: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -6e+195) tmp = t_0; elseif (z <= -0.5) tmp = t_1; elseif (z <= 1.75e-288) tmp = Float64(x * -3.0); elseif (z <= 0.68) tmp = Float64(y * 4.0); elseif (z <= 6.4e+193) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = 6.0 * (x * z); tmp = 0.0; if (z <= -6e+195) tmp = t_0; elseif (z <= -0.5) tmp = t_1; elseif (z <= 1.75e-288) tmp = x * -3.0; elseif (z <= 0.68) tmp = y * 4.0; elseif (z <= 6.4e+193) tmp = t_1; 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]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+195], t$95$0, If[LessEqual[z, -0.5], t$95$1, If[LessEqual[z, 1.75e-288], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.4e+193], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+195}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-288}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -6.0000000000000001e195 or 6.40000000000000026e193 < z Initial program 99.9%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6499.7%
Simplified99.7%
Taylor expanded in y around inf
*-lowering-*.f6470.5%
Simplified70.5%
if -6.0000000000000001e195 < z < -0.5 or 0.680000000000000049 < z < 6.40000000000000026e193Initial program 99.7%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.6%
Applied egg-rr99.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6495.0%
Simplified95.0%
Taylor expanded in y around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6458.4%
Simplified58.4%
if -0.5 < z < 1.7500000000000001e-288Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified97.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6458.0%
Simplified58.0%
if 1.7500000000000001e-288 < z < 0.680000000000000049Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6460.2%
Simplified60.2%
Taylor expanded in z around 0
*-lowering-*.f6459.3%
Simplified59.3%
Final simplification60.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.00033)
t_0
(if (<= z 3.9e-283)
(* x -3.0)
(if (<= z 660000.0) (* 6.0 (* y (- 0.6666666666666666 z))) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.00033) {
tmp = t_0;
} else if (z <= 3.9e-283) {
tmp = x * -3.0;
} else if (z <= 660000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - 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 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.00033d0)) then
tmp = t_0
else if (z <= 3.9d-283) then
tmp = x * (-3.0d0)
else if (z <= 660000.0d0) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
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.00033) {
tmp = t_0;
} else if (z <= 3.9e-283) {
tmp = x * -3.0;
} else if (z <= 660000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.00033: tmp = t_0 elif z <= 3.9e-283: tmp = x * -3.0 elif z <= 660000.0: tmp = 6.0 * (y * (0.6666666666666666 - z)) 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.00033) tmp = t_0; elseif (z <= 3.9e-283) tmp = Float64(x * -3.0); elseif (z <= 660000.0) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); 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.00033) tmp = t_0; elseif (z <= 3.9e-283) tmp = x * -3.0; elseif (z <= 660000.0) tmp = 6.0 * (y * (0.6666666666666666 - z)); 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.00033], t$95$0, If[LessEqual[z, 3.9e-283], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 660000.0], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $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.00033:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-283}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 660000:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.3e-4 or 6.6e5 < z Initial program 99.7%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6496.4%
Simplified96.4%
if -3.3e-4 < z < 3.9000000000000002e-283Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified99.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6459.3%
Simplified59.3%
if 3.9000000000000002e-283 < z < 6.6e5Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6460.6%
Simplified60.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.000115)
t_0
(if (<= z 1.42e-288) (* x -3.0) (if (<= z 0.56) (* 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.000115) {
tmp = t_0;
} else if (z <= 1.42e-288) {
tmp = x * -3.0;
} else if (z <= 0.56) {
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.000115d0)) then
tmp = t_0
else if (z <= 1.42d-288) then
tmp = x * (-3.0d0)
else if (z <= 0.56d0) 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.000115) {
tmp = t_0;
} else if (z <= 1.42e-288) {
tmp = x * -3.0;
} else if (z <= 0.56) {
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.000115: tmp = t_0 elif z <= 1.42e-288: tmp = x * -3.0 elif z <= 0.56: 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.000115) tmp = t_0; elseif (z <= 1.42e-288) tmp = Float64(x * -3.0); elseif (z <= 0.56) 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.000115) tmp = t_0; elseif (z <= 1.42e-288) tmp = x * -3.0; elseif (z <= 0.56) 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.000115], t$95$0, If[LessEqual[z, 1.42e-288], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.56], 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.000115:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-288}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.15e-4 or 0.56000000000000005 < z Initial program 99.7%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6495.4%
Simplified95.4%
if -1.15e-4 < z < 1.42e-288Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified99.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6459.3%
Simplified59.3%
if 1.42e-288 < z < 0.56000000000000005Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6460.2%
Simplified60.2%
Taylor expanded in z around 0
*-lowering-*.f6459.3%
Simplified59.3%
Final simplification77.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -2.45)
t_0
(if (<= z 1.7e-271) (* x -3.0) (if (<= z 0.00145) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -2.45) {
tmp = t_0;
} else if (z <= 1.7e-271) {
tmp = x * -3.0;
} else if (z <= 0.00145) {
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 <= (-2.45d0)) then
tmp = t_0
else if (z <= 1.7d-271) then
tmp = x * (-3.0d0)
else if (z <= 0.00145d0) 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 <= -2.45) {
tmp = t_0;
} else if (z <= 1.7e-271) {
tmp = x * -3.0;
} else if (z <= 0.00145) {
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 <= -2.45: tmp = t_0 elif z <= 1.7e-271: tmp = x * -3.0 elif z <= 0.00145: 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 <= -2.45) tmp = t_0; elseif (z <= 1.7e-271) tmp = Float64(x * -3.0); elseif (z <= 0.00145) 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 <= -2.45) tmp = t_0; elseif (z <= 1.7e-271) tmp = x * -3.0; elseif (z <= 0.00145) 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, -2.45], t$95$0, If[LessEqual[z, 1.7e-271], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.00145], 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 -2.45:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-271}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.00145:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.4500000000000002 or 0.00145 < z Initial program 99.7%
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in z around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6496.5%
Simplified96.5%
Taylor expanded in y around inf
*-lowering-*.f6450.7%
Simplified50.7%
if -2.4500000000000002 < z < 1.7e-271Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified96.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6457.5%
Simplified57.5%
if 1.7e-271 < z < 0.00145Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6461.3%
Simplified61.3%
Taylor expanded in z around 0
*-lowering-*.f6460.4%
Simplified60.4%
Final simplification54.6%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (* (- y x) -6.0)))) (if (<= z -0.56) t_0 (if (<= z 0.56) (+ (* y 4.0) (* x -3.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -0.56) {
tmp = t_0;
} else if (z <= 0.56) {
tmp = (y * 4.0) + (x * -3.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.56d0)) then
tmp = t_0
else if (z <= 0.56d0) then
tmp = (y * 4.0d0) + (x * (-3.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.56) {
tmp = t_0;
} else if (z <= 0.56) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -0.56: tmp = t_0 elif z <= 0.56: tmp = (y * 4.0) + (x * -3.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.56) tmp = t_0; elseif (z <= 0.56) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.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.56) tmp = t_0; elseif (z <= 0.56) tmp = (y * 4.0) + (x * -3.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.56], t$95$0, If[LessEqual[z, 0.56], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $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.56:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.56:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.56000000000000005 or 0.56000000000000005 < z Initial program 99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6496.8%
Simplified96.8%
if -0.56000000000000005 < z < 0.56000000000000005Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified97.7%
Taylor expanded in x around 0
metadata-evalN/A
distribute-rgt1-inN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6497.8%
Simplified97.8%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* z (* (- y x) -6.0)))) (if (<= z -0.6) t_0 (if (<= z 0.62) (+ x (* (- y x) 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.6) {
tmp = t_0;
} else if (z <= 0.62) {
tmp = x + ((y - x) * 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.6d0)) then
tmp = t_0
else if (z <= 0.62d0) then
tmp = x + ((y - x) * 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.6) {
tmp = t_0;
} else if (z <= 0.62) {
tmp = x + ((y - x) * 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.6: tmp = t_0 elif z <= 0.62: tmp = x + ((y - x) * 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.6) tmp = t_0; elseif (z <= 0.62) tmp = Float64(x + Float64(Float64(y - x) * 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.6) tmp = t_0; elseif (z <= 0.62) tmp = x + ((y - x) * 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.6], t$95$0, If[LessEqual[z, 0.62], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $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.6:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.619999999999999996 < z Initial program 99.7%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6496.8%
Simplified96.8%
if -0.599999999999999978 < z < 0.619999999999999996Initial program 99.5%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0
Simplified97.7%
Final simplification97.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* 6.0 z)))))
(if (<= x -9.5e-39)
t_0
(if (<= x 1.12e+55) (* (- 0.6666666666666666 z) (* y 6.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (6.0 * z));
double tmp;
if (x <= -9.5e-39) {
tmp = t_0;
} else if (x <= 1.12e+55) {
tmp = (0.6666666666666666 - z) * (y * 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 = x * ((-3.0d0) + (6.0d0 * z))
if (x <= (-9.5d-39)) then
tmp = t_0
else if (x <= 1.12d+55) then
tmp = (0.6666666666666666d0 - z) * (y * 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 = x * (-3.0 + (6.0 * z));
double tmp;
if (x <= -9.5e-39) {
tmp = t_0;
} else if (x <= 1.12e+55) {
tmp = (0.6666666666666666 - z) * (y * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (6.0 * z)) tmp = 0 if x <= -9.5e-39: tmp = t_0 elif x <= 1.12e+55: tmp = (0.6666666666666666 - z) * (y * 6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(6.0 * z))) tmp = 0.0 if (x <= -9.5e-39) tmp = t_0; elseif (x <= 1.12e+55) tmp = Float64(Float64(0.6666666666666666 - z) * Float64(y * 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (6.0 * z)); tmp = 0.0; if (x <= -9.5e-39) tmp = t_0; elseif (x <= 1.12e+55) tmp = (0.6666666666666666 - z) * (y * 6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e-39], t$95$0, If[LessEqual[x, 1.12e+55], N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(y * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{-39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;\left(0.6666666666666666 - z\right) \cdot \left(y \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -9.4999999999999999e-39 or 1.12000000000000006e55 < x Initial program 99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval83.6%
Simplified83.6%
if -9.4999999999999999e-39 < x < 1.12000000000000006e55Initial program 99.6%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6477.9%
Simplified77.9%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6478.0%
Applied egg-rr78.0%
Final simplification80.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* 6.0 z)))))
(if (<= x -2e-38)
t_0
(if (<= x 1.12e+55) (* 6.0 (* y (- 0.6666666666666666 z))) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (6.0 * z));
double tmp;
if (x <= -2e-38) {
tmp = t_0;
} else if (x <= 1.12e+55) {
tmp = 6.0 * (y * (0.6666666666666666 - 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 * ((-3.0d0) + (6.0d0 * z))
if (x <= (-2d-38)) then
tmp = t_0
else if (x <= 1.12d+55) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - 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 * (-3.0 + (6.0 * z));
double tmp;
if (x <= -2e-38) {
tmp = t_0;
} else if (x <= 1.12e+55) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (6.0 * z)) tmp = 0 if x <= -2e-38: tmp = t_0 elif x <= 1.12e+55: tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(6.0 * z))) tmp = 0.0 if (x <= -2e-38) tmp = t_0; elseif (x <= 1.12e+55) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (6.0 * z)); tmp = 0.0; if (x <= -2e-38) tmp = t_0; elseif (x <= 1.12e+55) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e-38], t$95$0, If[LessEqual[x, 1.12e+55], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{if}\;x \leq -2 \cdot 10^{-38}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+55}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.9999999999999999e-38 or 1.12000000000000006e55 < x Initial program 99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
associate-+l+N/A
metadata-evalN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval83.6%
Simplified83.6%
if -1.9999999999999999e-38 < x < 1.12000000000000006e55Initial program 99.6%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6477.9%
Simplified77.9%
Final simplification80.7%
(FPCore (x y z) :precision binary64 (if (<= x -3.7e-17) (* x -3.0) (if (<= x 5.8e-64) (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.7e-17) {
tmp = x * -3.0;
} else if (x <= 5.8e-64) {
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 <= (-3.7d-17)) then
tmp = x * (-3.0d0)
else if (x <= 5.8d-64) 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 <= -3.7e-17) {
tmp = x * -3.0;
} else if (x <= 5.8e-64) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.7e-17: tmp = x * -3.0 elif x <= 5.8e-64: tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.7e-17) tmp = Float64(x * -3.0); elseif (x <= 5.8e-64) 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 <= -3.7e-17) tmp = x * -3.0; elseif (x <= 5.8e-64) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.7e-17], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 5.8e-64], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-17}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-64}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -3.6999999999999997e-17 or 5.7999999999999998e-64 < x Initial program 99.6%
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
distribute-lft-inN/A
*-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0
Simplified50.2%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6440.0%
Simplified40.0%
if -3.6999999999999997e-17 < x < 5.7999999999999998e-64Initial program 99.6%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6479.3%
Simplified79.3%
Taylor expanded in z around 0
*-lowering-*.f6442.6%
Simplified42.6%
Final simplification41.2%
(FPCore (x y z) :precision binary64 (+ x (* 6.0 (* (- y x) (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
return x + (6.0 * ((y - x) * (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 + (6.0d0 * ((y - x) * (0.6666666666666666d0 - z)))
end function
public static double code(double x, double y, double z) {
return x + (6.0 * ((y - x) * (0.6666666666666666 - z)));
}
def code(x, y, z): return x + (6.0 * ((y - x) * (0.6666666666666666 - z)))
function code(x, y, z) return Float64(x + Float64(6.0 * Float64(Float64(y - x) * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + (6.0 * ((y - x) * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(6.0 * N[(N[(y - x), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 6 \cdot \left(\left(y - x\right) \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.6%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
--lowering--.f6499.5%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (* y 4.0))
double code(double x, double y, double z) {
return y * 4.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y * 4.0d0
end function
public static double code(double x, double y, double z) {
return y * 4.0;
}
def code(x, y, z): return y * 4.0
function code(x, y, z) return Float64(y * 4.0) end
function tmp = code(x, y, z) tmp = y * 4.0; end
code[x_, y_, z_] := N[(y * 4.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 4
\end{array}
Initial program 99.6%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6450.9%
Simplified50.9%
Taylor expanded in z around 0
*-lowering-*.f6425.6%
Simplified25.6%
Final simplification25.6%
herbie shell --seed 2024141
(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))))