
(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 15 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) (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
return x + ((y - x) * (4.0 + (z * -6.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 + ((y - x) * (4.0d0 + (z * (-6.0d0))))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (4.0 + (z * -6.0)));
}
def code(x, y, z): return x + ((y - x) * (4.0 + (z * -6.0)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(4.0 + Float64(z * -6.0)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (4.0 + (z * -6.0))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(4 + z \cdot -6\right)
\end{array}
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%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))) (t_1 (* y (* z -6.0))))
(if (<= z -3.8e+211)
t_0
(if (<= z -4200000000000.0)
t_1
(if (<= z -4.8e-62)
(* x -3.0)
(if (<= z 0.6) (* y 4.0) (if (<= z 6.2e+170) t_0 t_1)))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double t_1 = y * (z * -6.0);
double tmp;
if (z <= -3.8e+211) {
tmp = t_0;
} else if (z <= -4200000000000.0) {
tmp = t_1;
} else if (z <= -4.8e-62) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 6.2e+170) {
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 = x * (z * 6.0d0)
t_1 = y * (z * (-6.0d0))
if (z <= (-3.8d+211)) then
tmp = t_0
else if (z <= (-4200000000000.0d0)) then
tmp = t_1
else if (z <= (-4.8d-62)) then
tmp = x * (-3.0d0)
else if (z <= 0.6d0) then
tmp = y * 4.0d0
else if (z <= 6.2d+170) 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 = x * (z * 6.0);
double t_1 = y * (z * -6.0);
double tmp;
if (z <= -3.8e+211) {
tmp = t_0;
} else if (z <= -4200000000000.0) {
tmp = t_1;
} else if (z <= -4.8e-62) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 6.2e+170) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) t_1 = y * (z * -6.0) tmp = 0 if z <= -3.8e+211: tmp = t_0 elif z <= -4200000000000.0: tmp = t_1 elif z <= -4.8e-62: tmp = x * -3.0 elif z <= 0.6: tmp = y * 4.0 elif z <= 6.2e+170: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) t_1 = Float64(y * Float64(z * -6.0)) tmp = 0.0 if (z <= -3.8e+211) tmp = t_0; elseif (z <= -4200000000000.0) tmp = t_1; elseif (z <= -4.8e-62) tmp = Float64(x * -3.0); elseif (z <= 0.6) tmp = Float64(y * 4.0); elseif (z <= 6.2e+170) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); t_1 = y * (z * -6.0); tmp = 0.0; if (z <= -3.8e+211) tmp = t_0; elseif (z <= -4200000000000.0) tmp = t_1; elseif (z <= -4.8e-62) tmp = x * -3.0; elseif (z <= 0.6) tmp = y * 4.0; elseif (z <= 6.2e+170) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+211], t$95$0, If[LessEqual[z, -4200000000000.0], t$95$1, If[LessEqual[z, -4.8e-62], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.2e+170], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
t_1 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+211}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4200000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-62}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+170}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.80000000000000016e211 or 0.599999999999999978 < z < 6.2e170Initial program 99.7%
+-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 inf
*-commutativeN/A
*-lowering-*.f6496.6%
Simplified96.6%
Taylor expanded in y around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6460.0%
Simplified60.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6460.1%
Simplified60.1%
if -3.80000000000000016e211 < z < -4.2e12 or 6.2e170 < z Initial program 99.8%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6465.4%
Simplified65.4%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6465.3%
Simplified65.3%
if -4.2e12 < z < -4.79999999999999967e-62Initial program 98.9%
+-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.7%
Simplified99.7%
Taylor expanded in z around 0
Simplified77.8%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6465.8%
Simplified65.8%
if -4.79999999999999967e-62 < z < 0.599999999999999978Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6458.9%
Simplified58.9%
Taylor expanded in z around 0
*-commutativeN/A
*-lowering-*.f6459.2%
Simplified59.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- y x) (* z -6.0))))
(if (<= z -4200000000000.0)
t_0
(if (<= z -4.2e-63)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 28000.0) (* y (* (- 0.6666666666666666 z) 6.0)) t_0)))))
double code(double x, double y, double z) {
double t_0 = (y - x) * (z * -6.0);
double tmp;
if (z <= -4200000000000.0) {
tmp = t_0;
} else if (z <= -4.2e-63) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 28000.0) {
tmp = y * ((0.6666666666666666 - 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 = (y - x) * (z * (-6.0d0))
if (z <= (-4200000000000.0d0)) then
tmp = t_0
else if (z <= (-4.2d-63)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 28000.0d0) then
tmp = y * ((0.6666666666666666d0 - 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 = (y - x) * (z * -6.0);
double tmp;
if (z <= -4200000000000.0) {
tmp = t_0;
} else if (z <= -4.2e-63) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 28000.0) {
tmp = y * ((0.6666666666666666 - z) * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y - x) * (z * -6.0) tmp = 0 if z <= -4200000000000.0: tmp = t_0 elif z <= -4.2e-63: tmp = x * (-3.0 + (z * 6.0)) elif z <= 28000.0: tmp = y * ((0.6666666666666666 - z) * 6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y - x) * Float64(z * -6.0)) tmp = 0.0 if (z <= -4200000000000.0) tmp = t_0; elseif (z <= -4.2e-63) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 28000.0) tmp = Float64(y * Float64(Float64(0.6666666666666666 - z) * 6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - x) * (z * -6.0); tmp = 0.0; if (z <= -4200000000000.0) tmp = t_0; elseif (z <= -4.2e-63) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 28000.0) tmp = y * ((0.6666666666666666 - z) * 6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4200000000000.0], t$95$0, If[LessEqual[z, -4.2e-63], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 28000.0], N[(y * N[(N[(0.6666666666666666 - z), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -4200000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 28000:\\
\;\;\;\;y \cdot \left(\left(0.6666666666666666 - z\right) \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.2e12 or 28000 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
Simplified99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6499.2%
Simplified99.2%
if -4.2e12 < z < -4.2e-63Initial program 98.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
neg-mul-1N/A
distribute-lft-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval82.0%
Simplified82.0%
if -4.2e-63 < z < 28000Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6458.8%
Simplified58.8%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6459.0%
Applied egg-rr59.0%
Final simplification81.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* (- y x) -6.0))))
(if (<= z -4200000000000.0)
t_0
(if (<= z -9e-64)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 6500.0) (* y (* (- 0.6666666666666666 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 <= -4200000000000.0) {
tmp = t_0;
} else if (z <= -9e-64) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 6500.0) {
tmp = y * ((0.6666666666666666 - 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 <= (-4200000000000.0d0)) then
tmp = t_0
else if (z <= (-9d-64)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 6500.0d0) then
tmp = y * ((0.6666666666666666d0 - 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 <= -4200000000000.0) {
tmp = t_0;
} else if (z <= -9e-64) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 6500.0) {
tmp = y * ((0.6666666666666666 - 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 <= -4200000000000.0: tmp = t_0 elif z <= -9e-64: tmp = x * (-3.0 + (z * 6.0)) elif z <= 6500.0: tmp = y * ((0.6666666666666666 - 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 <= -4200000000000.0) tmp = t_0; elseif (z <= -9e-64) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 6500.0) tmp = Float64(y * Float64(Float64(0.6666666666666666 - 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 <= -4200000000000.0) tmp = t_0; elseif (z <= -9e-64) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 6500.0) tmp = y * ((0.6666666666666666 - 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, -4200000000000.0], t$95$0, If[LessEqual[z, -9e-64], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6500.0], N[(y * N[(N[(0.6666666666666666 - z), $MachinePrecision] * 6.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 -4200000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-64}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 6500:\\
\;\;\;\;y \cdot \left(\left(0.6666666666666666 - z\right) \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.2e12 or 6500 < z Initial program 99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.1%
Simplified99.1%
if -4.2e12 < z < -9.00000000000000019e-64Initial program 98.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
neg-mul-1N/A
distribute-lft-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval82.0%
Simplified82.0%
if -9.00000000000000019e-64 < z < 6500Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6458.8%
Simplified58.8%
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f6459.0%
Applied egg-rr59.0%
Final simplification81.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* (- y x) -6.0))))
(if (<= z -4200000000000.0)
t_0
(if (<= z -1.6e-65)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 215000.0) (* 6.0 (* y (- 0.6666666666666666 z))) t_0)))))
double code(double x, double y, double z) {
double t_0 = z * ((y - x) * -6.0);
double tmp;
if (z <= -4200000000000.0) {
tmp = t_0;
} else if (z <= -1.6e-65) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 215000.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 = z * ((y - x) * (-6.0d0))
if (z <= (-4200000000000.0d0)) then
tmp = t_0
else if (z <= (-1.6d-65)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 215000.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 = z * ((y - x) * -6.0);
double tmp;
if (z <= -4200000000000.0) {
tmp = t_0;
} else if (z <= -1.6e-65) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 215000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * ((y - x) * -6.0) tmp = 0 if z <= -4200000000000.0: tmp = t_0 elif z <= -1.6e-65: tmp = x * (-3.0 + (z * 6.0)) elif z <= 215000.0: tmp = 6.0 * (y * (0.6666666666666666 - z)) 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 <= -4200000000000.0) tmp = t_0; elseif (z <= -1.6e-65) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 215000.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 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -4200000000000.0) tmp = t_0; elseif (z <= -1.6e-65) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 215000.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[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4200000000000.0], t$95$0, If[LessEqual[z, -1.6e-65], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 215000.0], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $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 -4200000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-65}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 215000:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.2e12 or 215000 < z Initial program 99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.1%
Simplified99.1%
if -4.2e12 < z < -1.6e-65Initial program 98.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
neg-mul-1N/A
distribute-lft-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval82.0%
Simplified82.0%
if -1.6e-65 < z < 215000Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6458.8%
Simplified58.8%
Final simplification81.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z)))))
(if (<= y -1.7e-99)
t_0
(if (<= y 2.3e-300)
(* x (* z 6.0))
(if (<= y 8.2e-147) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -1.7e-99) {
tmp = t_0;
} else if (y <= 2.3e-300) {
tmp = x * (z * 6.0);
} else if (y <= 8.2e-147) {
tmp = 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 = 6.0d0 * (y * (0.6666666666666666d0 - z))
if (y <= (-1.7d-99)) then
tmp = t_0
else if (y <= 2.3d-300) then
tmp = x * (z * 6.0d0)
else if (y <= 8.2d-147) then
tmp = 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 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (y <= -1.7e-99) {
tmp = t_0;
} else if (y <= 2.3e-300) {
tmp = x * (z * 6.0);
} else if (y <= 8.2e-147) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) tmp = 0 if y <= -1.7e-99: tmp = t_0 elif y <= 2.3e-300: tmp = x * (z * 6.0) elif y <= 8.2e-147: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) tmp = 0.0 if (y <= -1.7e-99) tmp = t_0; elseif (y <= 2.3e-300) tmp = Float64(x * Float64(z * 6.0)); elseif (y <= 8.2e-147) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); tmp = 0.0; if (y <= -1.7e-99) tmp = t_0; elseif (y <= 2.3e-300) tmp = x * (z * 6.0); elseif (y <= 8.2e-147) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e-99], t$95$0, If[LessEqual[y, 2.3e-300], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-147], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{-99}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-300}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-147}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.70000000000000003e-99 or 8.1999999999999999e-147 < y Initial program 99.6%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6467.8%
Simplified67.8%
if -1.70000000000000003e-99 < y < 2.30000000000000001e-300Initial 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 inf
*-commutativeN/A
*-lowering-*.f6471.5%
Simplified71.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6459.3%
Simplified59.3%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6460.0%
Simplified60.0%
if 2.30000000000000001e-300 < y < 8.1999999999999999e-147Initial 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
Simplified66.4%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6457.4%
Simplified57.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -0.5)
t_0
(if (<= z -1.1e-61) (* x -3.0) (if (<= z 0.68) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -1.1e-61) {
tmp = x * -3.0;
} else if (z <= 0.68) {
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 = x * (z * 6.0d0)
if (z <= (-0.5d0)) then
tmp = t_0
else if (z <= (-1.1d-61)) then
tmp = x * (-3.0d0)
else if (z <= 0.68d0) 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 = x * (z * 6.0);
double tmp;
if (z <= -0.5) {
tmp = t_0;
} else if (z <= -1.1e-61) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -0.5: tmp = t_0 elif z <= -1.1e-61: tmp = x * -3.0 elif z <= 0.68: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -0.5) tmp = t_0; elseif (z <= -1.1e-61) tmp = Float64(x * -3.0); elseif (z <= 0.68) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -0.5) tmp = t_0; elseif (z <= -1.1e-61) tmp = x * -3.0; elseif (z <= 0.68) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.5], t$95$0, If[LessEqual[z, -1.1e-61], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-61}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.5 or 0.680000000000000049 < z Initial program 99.8%
+-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 inf
*-commutativeN/A
*-lowering-*.f6497.8%
Simplified97.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6449.8%
Simplified49.8%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6450.6%
Simplified50.6%
if -0.5 < z < -1.10000000000000004e-61Initial program 99.0%
+-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.7%
Simplified99.7%
Taylor expanded in z around 0
Simplified92.6%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6478.0%
Simplified78.0%
if -1.10000000000000004e-61 < z < 0.680000000000000049Initial program 99.5%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6458.9%
Simplified58.9%
Taylor expanded in z around 0
*-commutativeN/A
*-lowering-*.f6459.2%
Simplified59.2%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (- y x) (* z -6.0)))) (if (<= z -0.6) t_0 (if (<= z 0.62) (+ (* y 4.0) (* x -3.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = (y - x) * (z * -6.0);
double tmp;
if (z <= -0.6) {
tmp = t_0;
} else if (z <= 0.62) {
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 = (y - x) * (z * (-6.0d0))
if (z <= (-0.6d0)) then
tmp = t_0
else if (z <= 0.62d0) 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 = (y - x) * (z * -6.0);
double tmp;
if (z <= -0.6) {
tmp = t_0;
} else if (z <= 0.62) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y - x) * (z * -6.0) tmp = 0 if z <= -0.6: tmp = t_0 elif z <= 0.62: tmp = (y * 4.0) + (x * -3.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y - x) * Float64(z * -6.0)) tmp = 0.0 if (z <= -0.6) tmp = t_0; elseif (z <= 0.62) 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 = (y - x) * (z * -6.0); tmp = 0.0; if (z <= -0.6) tmp = t_0; elseif (z <= 0.62) 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[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.6], t$95$0, If[LessEqual[z, 0.62], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.619999999999999996 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
Simplified99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6497.8%
Simplified97.8%
if -0.599999999999999978 < z < 0.619999999999999996Initial program 99.4%
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
--lowering--.f6499.4%
Applied egg-rr99.4%
Taylor expanded in z around 0
+-commutativeN/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6498.9%
Simplified98.9%
Final simplification98.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* (- y x) (* z -6.0)))) (if (<= z -0.6) t_0 (if (<= z 0.6) (+ x (* (- y x) 4.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = (y - x) * (z * -6.0);
double tmp;
if (z <= -0.6) {
tmp = t_0;
} else if (z <= 0.6) {
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 = (y - x) * (z * (-6.0d0))
if (z <= (-0.6d0)) then
tmp = t_0
else if (z <= 0.6d0) 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 = (y - x) * (z * -6.0);
double tmp;
if (z <= -0.6) {
tmp = t_0;
} else if (z <= 0.6) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y - x) * (z * -6.0) tmp = 0 if z <= -0.6: tmp = t_0 elif z <= 0.6: tmp = x + ((y - x) * 4.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y - x) * Float64(z * -6.0)) tmp = 0.0 if (z <= -0.6) tmp = t_0; elseif (z <= 0.6) 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 = (y - x) * (z * -6.0); tmp = 0.0; if (z <= -0.6) tmp = t_0; elseif (z <= 0.6) tmp = x + ((y - x) * 4.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.6], t$95$0, If[LessEqual[z, 0.6], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.599999999999999978 < z Initial program 99.8%
Taylor expanded in z around inf
*-lowering-*.f64N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
distribute-lft-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r/N/A
metadata-evalN/A
Simplified99.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
*-lowering-*.f6497.8%
Simplified97.8%
if -0.599999999999999978 < z < 0.599999999999999978Initial program 99.4%
+-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
Simplified98.8%
Final simplification98.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -2.5e-45)
t_0
(if (<= x 175000.0) (* 6.0 (* y (- 0.6666666666666666 z))) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -2.5e-45) {
tmp = t_0;
} else if (x <= 175000.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 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-2.5d-45)) then
tmp = t_0
else if (x <= 175000.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 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -2.5e-45) {
tmp = t_0;
} else if (x <= 175000.0) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -2.5e-45: tmp = t_0 elif x <= 175000.0: 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(z * 6.0))) tmp = 0.0 if (x <= -2.5e-45) tmp = t_0; elseif (x <= 175000.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 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -2.5e-45) tmp = t_0; elseif (x <= 175000.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[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e-45], t$95$0, If[LessEqual[x, 175000.0], 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 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 175000:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.49999999999999988e-45 or 175000 < x Initial program 99.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
neg-mul-1N/A
distribute-lft-inN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
associate-+r+N/A
*-commutativeN/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-*r*N/A
metadata-evalN/A
*-lowering-*.f64N/A
metadata-eval76.0%
Simplified76.0%
if -2.49999999999999988e-45 < x < 175000Initial program 99.7%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6478.8%
Simplified78.8%
Final simplification77.4%
(FPCore (x y z) :precision binary64 (if (<= y -8.5e-66) (* y 4.0) (if (<= y 1.5e-37) (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -8.5e-66) {
tmp = y * 4.0;
} else if (y <= 1.5e-37) {
tmp = x * -3.0;
} else {
tmp = 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 (y <= (-8.5d-66)) then
tmp = y * 4.0d0
else if (y <= 1.5d-37) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -8.5e-66) {
tmp = y * 4.0;
} else if (y <= 1.5e-37) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -8.5e-66: tmp = y * 4.0 elif y <= 1.5e-37: tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -8.5e-66) tmp = Float64(y * 4.0); elseif (y <= 1.5e-37) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -8.5e-66) tmp = y * 4.0; elseif (y <= 1.5e-37) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -8.5e-66], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 1.5e-37], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-66}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-37}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if y < -8.49999999999999966e-66 or 1.5e-37 < y Initial program 99.6%
Taylor expanded in x around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f6473.2%
Simplified73.2%
Taylor expanded in z around 0
*-commutativeN/A
*-lowering-*.f6436.3%
Simplified36.3%
if -8.49999999999999966e-66 < y < 1.5e-37Initial 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
Simplified44.5%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6435.7%
Simplified35.7%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.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 + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.6%
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
--lowering--.f6499.6%
Applied egg-rr99.6%
(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.6%
Applied egg-rr99.6%
Final simplification99.6%
(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%
+-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
Simplified45.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6421.3%
Simplified21.3%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.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 inf
*-commutativeN/A
*-lowering-*.f6455.8%
Simplified55.8%
Taylor expanded in z around 0
Simplified2.9%
herbie shell --seed 2024161
(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))))