
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (fma (/ 0.3333333333333333 z) (- (/ t y) y) x))
double code(double x, double y, double z, double t) {
return fma((0.3333333333333333 / z), ((t / y) - y), x);
}
function code(x, y, z, t) return fma(Float64(0.3333333333333333 / z), Float64(Float64(t / y) - y), x) end
code[x_, y_, z_, t_] := N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)
\end{array}
Initial program 95.6%
Simplified97.9%
+-commutative97.9%
fma-def97.9%
Applied egg-rr97.9%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (* z -3.0))))
(if (<= y -5.8e+85)
t_1
(if (<= y -5.6e+32)
x
(if (<= y -16500.0)
(/ -0.3333333333333333 (/ z y))
(if (<= y 3.6e-33) (* 0.3333333333333333 (/ t (* z y))) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (y <= -5.8e+85) {
tmp = t_1;
} else if (y <= -5.6e+32) {
tmp = x;
} else if (y <= -16500.0) {
tmp = -0.3333333333333333 / (z / y);
} else if (y <= 3.6e-33) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = y / (z * (-3.0d0))
if (y <= (-5.8d+85)) then
tmp = t_1
else if (y <= (-5.6d+32)) then
tmp = x
else if (y <= (-16500.0d0)) then
tmp = (-0.3333333333333333d0) / (z / y)
else if (y <= 3.6d-33) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (z * -3.0);
double tmp;
if (y <= -5.8e+85) {
tmp = t_1;
} else if (y <= -5.6e+32) {
tmp = x;
} else if (y <= -16500.0) {
tmp = -0.3333333333333333 / (z / y);
} else if (y <= 3.6e-33) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (z * -3.0) tmp = 0 if y <= -5.8e+85: tmp = t_1 elif y <= -5.6e+32: tmp = x elif y <= -16500.0: tmp = -0.3333333333333333 / (z / y) elif y <= 3.6e-33: tmp = 0.3333333333333333 * (t / (z * y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(z * -3.0)) tmp = 0.0 if (y <= -5.8e+85) tmp = t_1; elseif (y <= -5.6e+32) tmp = x; elseif (y <= -16500.0) tmp = Float64(-0.3333333333333333 / Float64(z / y)); elseif (y <= 3.6e-33) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (z * -3.0); tmp = 0.0; if (y <= -5.8e+85) tmp = t_1; elseif (y <= -5.6e+32) tmp = x; elseif (y <= -16500.0) tmp = -0.3333333333333333 / (z / y); elseif (y <= 3.6e-33) tmp = 0.3333333333333333 * (t / (z * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+85], t$95$1, If[LessEqual[y, -5.6e+32], x, If[LessEqual[y, -16500.0], N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e-33], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z \cdot -3}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -16500:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.79999999999999995e85 or 3.60000000000000034e-33 < y Initial program 99.8%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 71.8%
associate-*r/71.8%
*-commutative71.8%
associate-/l*71.9%
div-inv71.9%
metadata-eval71.9%
Applied egg-rr71.9%
if -5.79999999999999995e85 < y < -5.6e32Initial program 99.9%
Simplified99.6%
Taylor expanded in x around inf 58.4%
if -5.6e32 < y < -16500Initial program 99.6%
Simplified99.6%
+-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 58.3%
clear-num58.3%
div-inv58.7%
Applied egg-rr58.7%
if -16500 < y < 3.60000000000000034e-33Initial program 90.7%
Simplified95.8%
+-commutative95.8%
fma-def95.8%
Applied egg-rr95.8%
Taylor expanded in t around inf 58.2%
Final simplification64.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.5e+83)
(* (* 0.3333333333333333 y) (/ -1.0 z))
(if (<= y -1.75e+34)
x
(if (<= y -170000000.0)
(/ -0.3333333333333333 (/ z y))
(if (<= y 3.6e-33)
(* 0.3333333333333333 (/ t (* z y)))
(/ y (* z -3.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+83) {
tmp = (0.3333333333333333 * y) * (-1.0 / z);
} else if (y <= -1.75e+34) {
tmp = x;
} else if (y <= -170000000.0) {
tmp = -0.3333333333333333 / (z / y);
} else if (y <= 3.6e-33) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-5.5d+83)) then
tmp = (0.3333333333333333d0 * y) * ((-1.0d0) / z)
else if (y <= (-1.75d+34)) then
tmp = x
else if (y <= (-170000000.0d0)) then
tmp = (-0.3333333333333333d0) / (z / y)
else if (y <= 3.6d-33) then
tmp = 0.3333333333333333d0 * (t / (z * y))
else
tmp = y / (z * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e+83) {
tmp = (0.3333333333333333 * y) * (-1.0 / z);
} else if (y <= -1.75e+34) {
tmp = x;
} else if (y <= -170000000.0) {
tmp = -0.3333333333333333 / (z / y);
} else if (y <= 3.6e-33) {
tmp = 0.3333333333333333 * (t / (z * y));
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e+83: tmp = (0.3333333333333333 * y) * (-1.0 / z) elif y <= -1.75e+34: tmp = x elif y <= -170000000.0: tmp = -0.3333333333333333 / (z / y) elif y <= 3.6e-33: tmp = 0.3333333333333333 * (t / (z * y)) else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e+83) tmp = Float64(Float64(0.3333333333333333 * y) * Float64(-1.0 / z)); elseif (y <= -1.75e+34) tmp = x; elseif (y <= -170000000.0) tmp = Float64(-0.3333333333333333 / Float64(z / y)); elseif (y <= 3.6e-33) tmp = Float64(0.3333333333333333 * Float64(t / Float64(z * y))); else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.5e+83) tmp = (0.3333333333333333 * y) * (-1.0 / z); elseif (y <= -1.75e+34) tmp = x; elseif (y <= -170000000.0) tmp = -0.3333333333333333 / (z / y); elseif (y <= 3.6e-33) tmp = 0.3333333333333333 * (t / (z * y)); else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e+83], N[(N[(0.3333333333333333 * y), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.75e+34], x, If[LessEqual[y, -170000000.0], N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e-33], N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+83}:\\
\;\;\;\;\left(0.3333333333333333 \cdot y\right) \cdot \frac{-1}{z}\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -170000000:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -5.4999999999999996e83Initial program 99.8%
Simplified99.8%
+-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 75.5%
associate-*r/75.4%
*-commutative75.4%
Applied egg-rr75.4%
frac-2neg75.4%
div-inv75.6%
distribute-rgt-neg-in75.6%
metadata-eval75.6%
metadata-eval75.6%
distribute-neg-frac75.6%
metadata-eval75.6%
frac-2neg75.6%
distribute-neg-frac75.6%
metadata-eval75.6%
Applied egg-rr75.6%
if -5.4999999999999996e83 < y < -1.74999999999999999e34Initial program 99.9%
Simplified99.6%
Taylor expanded in x around inf 58.4%
if -1.74999999999999999e34 < y < -1.7e8Initial program 99.6%
Simplified99.6%
+-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 58.3%
clear-num58.3%
div-inv58.7%
Applied egg-rr58.7%
if -1.7e8 < y < 3.60000000000000034e-33Initial program 90.7%
Simplified95.8%
+-commutative95.8%
fma-def95.8%
Applied egg-rr95.8%
Taylor expanded in t around inf 58.2%
if 3.60000000000000034e-33 < y Initial program 99.8%
Simplified99.6%
+-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 69.6%
associate-*r/69.6%
*-commutative69.6%
associate-/l*69.7%
div-inv69.7%
metadata-eval69.7%
Applied egg-rr69.7%
Final simplification64.5%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -4e+38)
(- x (/ y (* z 3.0)))
(if (<= (* z 3.0) 2e+22)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(+ x (/ (* y -0.3333333333333333) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -4e+38) {
tmp = x - (y / (z * 3.0));
} else if ((z * 3.0) <= 2e+22) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z * 3.0d0) <= (-4d+38)) then
tmp = x - (y / (z * 3.0d0))
else if ((z * 3.0d0) <= 2d+22) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else
tmp = x + ((y * (-0.3333333333333333d0)) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -4e+38) {
tmp = x - (y / (z * 3.0));
} else if ((z * 3.0) <= 2e+22) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x + ((y * -0.3333333333333333) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -4e+38: tmp = x - (y / (z * 3.0)) elif (z * 3.0) <= 2e+22: tmp = 0.3333333333333333 * (((t / y) - y) / z) else: tmp = x + ((y * -0.3333333333333333) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -4e+38) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (Float64(z * 3.0) <= 2e+22) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); else tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -4e+38) tmp = x - (y / (z * 3.0)); elseif ((z * 3.0) <= 2e+22) tmp = 0.3333333333333333 * (((t / y) - y) / z); else tmp = x + ((y * -0.3333333333333333) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -4e+38], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e+22], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -4 \cdot 10^{+38}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{+22}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\end{array}
\end{array}
if (*.f64 z 3) < -3.99999999999999991e38Initial program 97.9%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
*-commutative99.8%
associate-*l*97.9%
associate-+l-97.9%
*-commutative97.9%
associate-/r*93.9%
sub-div93.9%
Applied egg-rr93.9%
*-un-lft-identity93.9%
times-frac95.7%
Applied egg-rr95.7%
Taylor expanded in y around inf 85.9%
*-commutative85.9%
associate-/r/85.9%
metadata-eval85.9%
associate-/l*86.0%
/-rgt-identity86.0%
Simplified86.0%
if -3.99999999999999991e38 < (*.f64 z 3) < 2e22Initial program 93.5%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 86.2%
if 2e22 < (*.f64 z 3) Initial program 99.7%
Simplified94.7%
Taylor expanded in t around 0 77.1%
*-commutative77.1%
associate-*l/77.2%
associate-*r/77.1%
Simplified77.1%
associate-*r/77.2%
Applied egg-rr77.2%
Final simplification84.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.15e+83)
(* (* 0.3333333333333333 y) (/ -1.0 z))
(if (<= y -8e+14)
x
(if (<= y 3.6e-33)
(* (/ t z) (/ 0.3333333333333333 y))
(/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+83) {
tmp = (0.3333333333333333 * y) * (-1.0 / z);
} else if (y <= -8e+14) {
tmp = x;
} else if (y <= 3.6e-33) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.15d+83)) then
tmp = (0.3333333333333333d0 * y) * ((-1.0d0) / z)
else if (y <= (-8d+14)) then
tmp = x
else if (y <= 3.6d-33) then
tmp = (t / z) * (0.3333333333333333d0 / y)
else
tmp = y / (z * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.15e+83) {
tmp = (0.3333333333333333 * y) * (-1.0 / z);
} else if (y <= -8e+14) {
tmp = x;
} else if (y <= 3.6e-33) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.15e+83: tmp = (0.3333333333333333 * y) * (-1.0 / z) elif y <= -8e+14: tmp = x elif y <= 3.6e-33: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.15e+83) tmp = Float64(Float64(0.3333333333333333 * y) * Float64(-1.0 / z)); elseif (y <= -8e+14) tmp = x; elseif (y <= 3.6e-33) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.15e+83) tmp = (0.3333333333333333 * y) * (-1.0 / z); elseif (y <= -8e+14) tmp = x; elseif (y <= 3.6e-33) tmp = (t / z) * (0.3333333333333333 / y); else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.15e+83], N[(N[(0.3333333333333333 * y), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8e+14], x, If[LessEqual[y, 3.6e-33], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+83}:\\
\;\;\;\;\left(0.3333333333333333 \cdot y\right) \cdot \frac{-1}{z}\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -1.14999999999999997e83Initial program 99.8%
Simplified99.8%
+-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 75.5%
associate-*r/75.4%
*-commutative75.4%
Applied egg-rr75.4%
frac-2neg75.4%
div-inv75.6%
distribute-rgt-neg-in75.6%
metadata-eval75.6%
metadata-eval75.6%
distribute-neg-frac75.6%
metadata-eval75.6%
frac-2neg75.6%
distribute-neg-frac75.6%
metadata-eval75.6%
Applied egg-rr75.6%
if -1.14999999999999997e83 < y < -8e14Initial program 99.8%
Simplified99.6%
Taylor expanded in x around inf 54.1%
if -8e14 < y < 3.60000000000000034e-33Initial program 90.9%
Simplified95.9%
+-commutative95.9%
fma-def95.9%
Applied egg-rr95.9%
Taylor expanded in t around inf 58.0%
associate-*r/58.1%
*-commutative58.1%
*-commutative58.1%
times-frac62.3%
Simplified62.3%
if 3.60000000000000034e-33 < y Initial program 99.8%
Simplified99.6%
+-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 69.6%
associate-*r/69.6%
*-commutative69.6%
associate-/l*69.7%
div-inv69.7%
metadata-eval69.7%
Applied egg-rr69.7%
Final simplification66.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.6e+63) (not (<= y 2.8e-33))) (- x (/ y (* z 3.0))) (+ x (* (/ 0.3333333333333333 z) (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.6e+63) || !(y <= 2.8e-33)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((0.3333333333333333 / z) * (t / y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.6d+63)) .or. (.not. (y <= 2.8d-33))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = x + ((0.3333333333333333d0 / z) * (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.6e+63) || !(y <= 2.8e-33)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + ((0.3333333333333333 / z) * (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.6e+63) or not (y <= 2.8e-33): tmp = x - (y / (z * 3.0)) else: tmp = x + ((0.3333333333333333 / z) * (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.6e+63) || !(y <= 2.8e-33)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.6e+63) || ~((y <= 2.8e-33))) tmp = x - (y / (z * 3.0)); else tmp = x + ((0.3333333333333333 / z) * (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.6e+63], N[Not[LessEqual[y, 2.8e-33]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+63} \lor \neg \left(y \leq 2.8 \cdot 10^{-33}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \frac{t}{y}\\
\end{array}
\end{array}
if y < -1.60000000000000006e63 or 2.8e-33 < y Initial program 99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
*-commutative99.8%
associate-/r*99.8%
sub-div99.8%
Applied egg-rr99.8%
*-un-lft-identity99.8%
times-frac99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 96.1%
*-commutative96.1%
associate-/r/96.2%
metadata-eval96.2%
associate-/l*96.2%
/-rgt-identity96.2%
Simplified96.2%
if -1.60000000000000006e63 < y < 2.8e-33Initial program 91.8%
Simplified96.2%
Taylor expanded in t around inf 85.6%
associate-/r*89.6%
associate-*r/89.6%
associate-*l/89.5%
*-commutative89.5%
Simplified89.5%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -106.0) (not (<= y 3.6e-33))) (- x (/ y (* z 3.0))) (+ x (/ (* (/ 0.3333333333333333 z) t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -106.0) || !(y <= 3.6e-33)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + (((0.3333333333333333 / z) * t) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-106.0d0)) .or. (.not. (y <= 3.6d-33))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = x + (((0.3333333333333333d0 / z) * t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -106.0) || !(y <= 3.6e-33)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = x + (((0.3333333333333333 / z) * t) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -106.0) or not (y <= 3.6e-33): tmp = x - (y / (z * 3.0)) else: tmp = x + (((0.3333333333333333 / z) * t) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -106.0) || !(y <= 3.6e-33)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(x + Float64(Float64(Float64(0.3333333333333333 / z) * t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -106.0) || ~((y <= 3.6e-33))) tmp = x - (y / (z * 3.0)); else tmp = x + (((0.3333333333333333 / z) * t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -106.0], N[Not[LessEqual[y, 3.6e-33]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(0.3333333333333333 / z), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -106 \lor \neg \left(y \leq 3.6 \cdot 10^{-33}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{0.3333333333333333}{z} \cdot t}{y}\\
\end{array}
\end{array}
if y < -106 or 3.60000000000000034e-33 < y Initial program 99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
*-commutative99.8%
associate-/r*99.8%
sub-div99.8%
Applied egg-rr99.8%
*-un-lft-identity99.8%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 93.1%
*-commutative93.1%
associate-/r/93.1%
metadata-eval93.1%
associate-/l*93.1%
/-rgt-identity93.1%
Simplified93.1%
if -106 < y < 3.60000000000000034e-33Initial program 90.7%
Simplified95.8%
Taylor expanded in t around inf 87.3%
associate-/r*91.8%
associate-*r/91.8%
associate-*l/91.8%
*-commutative91.8%
Simplified91.8%
associate-*l/93.8%
Applied egg-rr93.8%
Final simplification93.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -28.0) (not (<= y 1.4e-33))) (+ x (* y (/ -0.3333333333333333 z))) (* (/ t z) (/ 0.3333333333333333 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -28.0) || !(y <= 1.4e-33)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-28.0d0)) .or. (.not. (y <= 1.4d-33))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = (t / z) * (0.3333333333333333d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -28.0) || !(y <= 1.4e-33)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -28.0) or not (y <= 1.4e-33): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = (t / z) * (0.3333333333333333 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -28.0) || !(y <= 1.4e-33)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -28.0) || ~((y <= 1.4e-33))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = (t / z) * (0.3333333333333333 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -28.0], N[Not[LessEqual[y, 1.4e-33]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -28 \lor \neg \left(y \leq 1.4 \cdot 10^{-33}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -28 or 1.4e-33 < y Initial program 99.8%
Simplified99.7%
Taylor expanded in t around 0 93.1%
*-commutative93.1%
associate-*l/93.0%
associate-*r/93.0%
Simplified93.0%
if -28 < y < 1.4e-33Initial program 90.7%
Simplified95.8%
+-commutative95.8%
fma-def95.8%
Applied egg-rr95.8%
Taylor expanded in t around inf 58.6%
associate-*r/58.7%
*-commutative58.7%
*-commutative58.7%
times-frac63.0%
Simplified63.0%
Final simplification79.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.25) (not (<= y 6.2e-34))) (- x (* 0.3333333333333333 (/ y z))) (* (/ t z) (/ 0.3333333333333333 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25) || !(y <= 6.2e-34)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.25d0)) .or. (.not. (y <= 6.2d-34))) then
tmp = x - (0.3333333333333333d0 * (y / z))
else
tmp = (t / z) * (0.3333333333333333d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.25) || !(y <= 6.2e-34)) {
tmp = x - (0.3333333333333333 * (y / z));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.25) or not (y <= 6.2e-34): tmp = x - (0.3333333333333333 * (y / z)) else: tmp = (t / z) * (0.3333333333333333 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.25) || !(y <= 6.2e-34)) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); else tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.25) || ~((y <= 6.2e-34))) tmp = x - (0.3333333333333333 * (y / z)); else tmp = (t / z) * (0.3333333333333333 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.25], N[Not[LessEqual[y, 6.2e-34]], $MachinePrecision]], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \lor \neg \left(y \leq 6.2 \cdot 10^{-34}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -1.25 or 6.1999999999999996e-34 < y Initial program 99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 93.1%
if -1.25 < y < 6.1999999999999996e-34Initial program 90.7%
Simplified95.8%
+-commutative95.8%
fma-def95.8%
Applied egg-rr95.8%
Taylor expanded in t around inf 58.6%
associate-*r/58.7%
*-commutative58.7%
*-commutative58.7%
times-frac63.0%
Simplified63.0%
Final simplification79.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.2) (not (<= y 1.05e-33))) (- x (/ y (* z 3.0))) (* (/ t z) (/ 0.3333333333333333 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2) || !(y <= 1.05e-33)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-4.2d0)) .or. (.not. (y <= 1.05d-33))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = (t / z) * (0.3333333333333333d0 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.2) || !(y <= 1.05e-33)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (t / z) * (0.3333333333333333 / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.2) or not (y <= 1.05e-33): tmp = x - (y / (z * 3.0)) else: tmp = (t / z) * (0.3333333333333333 / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.2) || !(y <= 1.05e-33)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -4.2) || ~((y <= 1.05e-33))) tmp = x - (y / (z * 3.0)); else tmp = (t / z) * (0.3333333333333333 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.2], N[Not[LessEqual[y, 1.05e-33]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \lor \neg \left(y \leq 1.05 \cdot 10^{-33}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\end{array}
\end{array}
if y < -4.20000000000000018 or 1.05e-33 < y Initial program 99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
*-commutative99.8%
associate-/r*99.8%
sub-div99.8%
Applied egg-rr99.8%
*-un-lft-identity99.8%
times-frac99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 93.1%
*-commutative93.1%
associate-/r/93.1%
metadata-eval93.1%
associate-/l*93.1%
/-rgt-identity93.1%
Simplified93.1%
if -4.20000000000000018 < y < 1.05e-33Initial program 90.7%
Simplified95.8%
+-commutative95.8%
fma-def95.8%
Applied egg-rr95.8%
Taylor expanded in t around inf 58.6%
associate-*r/58.7%
*-commutative58.7%
*-commutative58.7%
times-frac63.0%
Simplified63.0%
Final simplification79.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.3)
(+ x (/ (* y -0.3333333333333333) z))
(if (<= y 5.8e-34)
(* (/ t z) (/ 0.3333333333333333 y))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 5.8e-34) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.3d0)) then
tmp = x + ((y * (-0.3333333333333333d0)) / z)
else if (y <= 5.8d-34) then
tmp = (t / z) * (0.3333333333333333d0 / y)
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.3) {
tmp = x + ((y * -0.3333333333333333) / z);
} else if (y <= 5.8e-34) {
tmp = (t / z) * (0.3333333333333333 / y);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.3: tmp = x + ((y * -0.3333333333333333) / z) elif y <= 5.8e-34: tmp = (t / z) * (0.3333333333333333 / y) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.3) tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z)); elseif (y <= 5.8e-34) tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y)); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.3) tmp = x + ((y * -0.3333333333333333) / z); elseif (y <= 5.8e-34) tmp = (t / z) * (0.3333333333333333 / y); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.3], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-34], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-34}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.2999999999999998Initial program 99.8%
Simplified99.7%
Taylor expanded in t around 0 91.0%
*-commutative91.0%
associate-*l/91.0%
associate-*r/91.0%
Simplified91.0%
associate-*r/91.0%
Applied egg-rr91.0%
if -2.2999999999999998 < y < 5.8000000000000004e-34Initial program 90.7%
Simplified95.8%
+-commutative95.8%
fma-def95.8%
Applied egg-rr95.8%
Taylor expanded in t around inf 58.6%
associate-*r/58.7%
*-commutative58.7%
*-commutative58.7%
times-frac63.0%
Simplified63.0%
if 5.8000000000000004e-34 < y Initial program 99.8%
Simplified99.6%
Taylor expanded in t around 0 94.9%
*-commutative94.9%
associate-*l/94.9%
associate-*r/94.9%
Simplified94.9%
Final simplification79.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.4e+83) (not (<= y 2.25e-20))) (* -0.3333333333333333 (/ y z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+83) || !(y <= 2.25e-20)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.4d+83)) .or. (.not. (y <= 2.25d-20))) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+83) || !(y <= 2.25e-20)) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.4e+83) or not (y <= 2.25e-20): tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.4e+83) || !(y <= 2.25e-20)) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.4e+83) || ~((y <= 2.25e-20))) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.4e+83], N[Not[LessEqual[y, 2.25e-20]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+83} \lor \neg \left(y \leq 2.25 \cdot 10^{-20}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.4e83 or 2.2500000000000001e-20 < y Initial program 99.8%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 72.8%
if -1.4e83 < y < 2.2500000000000001e-20Initial program 92.3%
Simplified96.5%
Taylor expanded in x around inf 36.5%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.85e+84) (not (<= y 2.7e-20))) (/ y (* z -3.0)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.85e+84) || !(y <= 2.7e-20)) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.85d+84)) .or. (.not. (y <= 2.7d-20))) then
tmp = y / (z * (-3.0d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.85e+84) || !(y <= 2.7e-20)) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.85e+84) or not (y <= 2.7e-20): tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.85e+84) || !(y <= 2.7e-20)) tmp = Float64(y / Float64(z * -3.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.85e+84) || ~((y <= 2.7e-20))) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.85e+84], N[Not[LessEqual[y, 2.7e-20]], $MachinePrecision]], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+84} \lor \neg \left(y \leq 2.7 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.85e84 or 2.7e-20 < y Initial program 99.8%
Simplified99.7%
+-commutative99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 72.8%
associate-*r/72.7%
*-commutative72.7%
associate-/l*72.8%
div-inv72.8%
metadata-eval72.8%
Applied egg-rr72.8%
if -1.85e84 < y < 2.7e-20Initial program 92.3%
Simplified96.5%
Taylor expanded in x around inf 36.5%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (if (<= y -2.1e+86) (* -0.3333333333333333 (/ y z)) (if (<= y 1.75e-20) x (/ -0.3333333333333333 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+86) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 1.75e-20) {
tmp = x;
} else {
tmp = -0.3333333333333333 / (z / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-2.1d+86)) then
tmp = (-0.3333333333333333d0) * (y / z)
else if (y <= 1.75d-20) then
tmp = x
else
tmp = (-0.3333333333333333d0) / (z / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e+86) {
tmp = -0.3333333333333333 * (y / z);
} else if (y <= 1.75e-20) {
tmp = x;
} else {
tmp = -0.3333333333333333 / (z / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e+86: tmp = -0.3333333333333333 * (y / z) elif y <= 1.75e-20: tmp = x else: tmp = -0.3333333333333333 / (z / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e+86) tmp = Float64(-0.3333333333333333 * Float64(y / z)); elseif (y <= 1.75e-20) tmp = x; else tmp = Float64(-0.3333333333333333 / Float64(z / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e+86) tmp = -0.3333333333333333 * (y / z); elseif (y <= 1.75e-20) tmp = x; else tmp = -0.3333333333333333 / (z / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e+86], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e-20], x, N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+86}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-20}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\
\end{array}
\end{array}
if y < -2.0999999999999999e86Initial program 99.8%
Simplified99.8%
+-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 75.5%
if -2.0999999999999999e86 < y < 1.75000000000000002e-20Initial program 92.3%
Simplified96.5%
Taylor expanded in x around inf 36.5%
if 1.75000000000000002e-20 < y Initial program 99.8%
Simplified99.6%
+-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 71.1%
clear-num71.0%
div-inv71.2%
Applied egg-rr71.2%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (+ x (* (/ (- y (/ t y)) 3.0) (/ -1.0 z))))
double code(double x, double y, double z, double t) {
return x + (((y - (t / y)) / 3.0) * (-1.0 / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((y - (t / y)) / 3.0d0) * ((-1.0d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - (t / y)) / 3.0) * (-1.0 / z));
}
def code(x, y, z, t): return x + (((y - (t / y)) / 3.0) * (-1.0 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - Float64(t / y)) / 3.0) * Float64(-1.0 / z))) end
function tmp = code(x, y, z, t) tmp = x + (((y - (t / y)) / 3.0) * (-1.0 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - \frac{t}{y}}{3} \cdot \frac{-1}{z}
\end{array}
Initial program 95.6%
associate-*l*96.0%
*-commutative96.0%
Simplified96.0%
*-commutative96.0%
associate-*l*95.6%
associate-+l-95.6%
*-commutative95.6%
associate-/r*97.6%
sub-div97.6%
Applied egg-rr97.6%
*-un-lft-identity97.6%
times-frac97.9%
Applied egg-rr97.9%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))))
double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
def code(x, y, z, t): return x + ((0.3333333333333333 / z) * ((t / y) - y))
function code(x, y, z, t) return Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))) end
function tmp = code(x, y, z, t) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)
\end{array}
Initial program 95.6%
Simplified97.9%
Final simplification97.9%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.6%
Simplified97.9%
Taylor expanded in x around inf 31.0%
Final simplification31.0%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024019
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))