
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* x (/ (* y 0.5) a)) (/ (fma x y (* -9.0 (* z t))) (* a 2.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = fma(x, y, (-9.0 * (z * t))) / (a * 2.0);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); else tmp = Float64(fma(x, y, Float64(-9.0 * Float64(z * t))) / Float64(a * 2.0)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(x * y + N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, -9 \cdot \left(z \cdot t\right)\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.7%
associate-*l*64.7%
Simplified64.7%
Taylor expanded in x around inf 64.7%
*-commutative64.7%
*-commutative64.7%
associate-*l/64.7%
associate-*r/64.7%
associate-*l*96.2%
associate-*r/96.3%
Simplified96.3%
if -inf.0 < (*.f64 x y) Initial program 96.4%
fma-neg96.4%
*-commutative96.4%
associate-*l*96.4%
distribute-lft-neg-in96.4%
metadata-eval96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t a) :precision binary64 (if (<= (* x y) (- INFINITY)) (* x (/ (* y 0.5) a)) (/ (- (* x y) (* z (* t 9.0))) (* a 2.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -((double) INFINITY)) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -Double.POSITIVE_INFINITY) {
tmp = x * ((y * 0.5) / a);
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x * y) <= -math.inf: tmp = x * ((y * 0.5) / a) else: tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x * y) <= -Inf) tmp = x * ((y * 0.5) / a); else tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -inf.0Initial program 64.7%
associate-*l*64.7%
Simplified64.7%
Taylor expanded in x around inf 64.7%
*-commutative64.7%
*-commutative64.7%
associate-*l/64.7%
associate-*r/64.7%
associate-*l*96.2%
associate-*r/96.3%
Simplified96.3%
if -inf.0 < (*.f64 x y) Initial program 96.4%
associate-*l*96.4%
Simplified96.4%
Final simplification96.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 0.5 (/ y (/ a x)))))
(if (<= y -3.1e-90)
t_1
(if (<= y 6.2e-5)
(* -4.5 (/ (* z t) a))
(if (or (<= y 1.7e+82) (not (<= y 2.2e+96)))
t_1
(* -4.5 (/ t (/ a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (y / (a / x));
double tmp;
if (y <= -3.1e-90) {
tmp = t_1;
} else if (y <= 6.2e-5) {
tmp = -4.5 * ((z * t) / a);
} else if ((y <= 1.7e+82) || !(y <= 2.2e+96)) {
tmp = t_1;
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * (y / (a / x))
if (y <= (-3.1d-90)) then
tmp = t_1
else if (y <= 6.2d-5) then
tmp = (-4.5d0) * ((z * t) / a)
else if ((y <= 1.7d+82) .or. (.not. (y <= 2.2d+96))) then
tmp = t_1
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (y / (a / x));
double tmp;
if (y <= -3.1e-90) {
tmp = t_1;
} else if (y <= 6.2e-5) {
tmp = -4.5 * ((z * t) / a);
} else if ((y <= 1.7e+82) || !(y <= 2.2e+96)) {
tmp = t_1;
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 0.5 * (y / (a / x)) tmp = 0 if y <= -3.1e-90: tmp = t_1 elif y <= 6.2e-5: tmp = -4.5 * ((z * t) / a) elif (y <= 1.7e+82) or not (y <= 2.2e+96): tmp = t_1 else: tmp = -4.5 * (t / (a / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(0.5 * Float64(y / Float64(a / x))) tmp = 0.0 if (y <= -3.1e-90) tmp = t_1; elseif (y <= 6.2e-5) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif ((y <= 1.7e+82) || !(y <= 2.2e+96)) tmp = t_1; else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 0.5 * (y / (a / x)); tmp = 0.0; if (y <= -3.1e-90) tmp = t_1; elseif (y <= 6.2e-5) tmp = -4.5 * ((z * t) / a); elseif ((y <= 1.7e+82) || ~((y <= 2.2e+96))) tmp = t_1; else tmp = -4.5 * (t / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-90], t$95$1, If[LessEqual[y, 6.2e-5], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.7e+82], N[Not[LessEqual[y, 2.2e+96]], $MachinePrecision]], t$95$1, N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-5}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+82} \lor \neg \left(y \leq 2.2 \cdot 10^{+96}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if y < -3.1000000000000001e-90 or 6.20000000000000027e-5 < y < 1.69999999999999997e82 or 2.1999999999999999e96 < y Initial program 90.6%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in x around inf 63.9%
associate-/l*67.8%
Simplified67.8%
if -3.1000000000000001e-90 < y < 6.20000000000000027e-5Initial program 96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 74.7%
if 1.69999999999999997e82 < y < 2.1999999999999999e96Initial program 66.7%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in x around 0 36.3%
associate-/l*22.5%
Simplified22.5%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* 0.5 (/ y (/ a x)))))
(if (<= y -3.1e-93)
t_1
(if (<= y 4e-5)
(* -4.5 (/ (* z t) a))
(if (<= y 1.7e+82)
(* x (/ (* y 0.5) a))
(if (<= y 4.4e+96) (* -4.5 (/ t (/ a z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (y / (a / x));
double tmp;
if (y <= -3.1e-93) {
tmp = t_1;
} else if (y <= 4e-5) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.7e+82) {
tmp = x * ((y * 0.5) / a);
} else if (y <= 4.4e+96) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 * (y / (a / x))
if (y <= (-3.1d-93)) then
tmp = t_1
else if (y <= 4d-5) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 1.7d+82) then
tmp = x * ((y * 0.5d0) / a)
else if (y <= 4.4d+96) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 0.5 * (y / (a / x));
double tmp;
if (y <= -3.1e-93) {
tmp = t_1;
} else if (y <= 4e-5) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.7e+82) {
tmp = x * ((y * 0.5) / a);
} else if (y <= 4.4e+96) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = 0.5 * (y / (a / x)) tmp = 0 if y <= -3.1e-93: tmp = t_1 elif y <= 4e-5: tmp = -4.5 * ((z * t) / a) elif y <= 1.7e+82: tmp = x * ((y * 0.5) / a) elif y <= 4.4e+96: tmp = -4.5 * (t / (a / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(0.5 * Float64(y / Float64(a / x))) tmp = 0.0 if (y <= -3.1e-93) tmp = t_1; elseif (y <= 4e-5) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 1.7e+82) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); elseif (y <= 4.4e+96) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = 0.5 * (y / (a / x)); tmp = 0.0; if (y <= -3.1e-93) tmp = t_1; elseif (y <= 4e-5) tmp = -4.5 * ((z * t) / a); elseif (y <= 1.7e+82) tmp = x * ((y * 0.5) / a); elseif (y <= 4.4e+96) tmp = -4.5 * (t / (a / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e-93], t$95$1, If[LessEqual[y, 4e-5], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+82], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+96], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-5}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+96}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.1e-93 or 4.3999999999999998e96 < y Initial program 89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around inf 61.4%
associate-/l*65.9%
Simplified65.9%
if -3.1e-93 < y < 4.00000000000000033e-5Initial program 96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 74.7%
if 4.00000000000000033e-5 < y < 1.69999999999999997e82Initial program 99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 80.1%
*-commutative80.1%
*-commutative80.1%
associate-*l/80.1%
associate-*r/79.9%
associate-*l*80.2%
associate-*r/80.2%
Simplified80.2%
if 1.69999999999999997e82 < y < 4.3999999999999998e96Initial program 66.7%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in x around 0 36.3%
associate-/l*22.5%
Simplified22.5%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -8e-91)
(* 0.5 (/ y (/ a x)))
(if (<= y 0.054)
(* -4.5 (/ (* z t) a))
(if (<= y 1.7e+82)
(* x (/ (* y 0.5) a))
(if (<= y 2.2e+96) (* -4.5 (/ t (/ a z))) (* (/ y 2.0) (/ x a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -8e-91) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 0.054) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.7e+82) {
tmp = x * ((y * 0.5) / a);
} else if (y <= 2.2e+96) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-8d-91)) then
tmp = 0.5d0 * (y / (a / x))
else if (y <= 0.054d0) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 1.7d+82) then
tmp = x * ((y * 0.5d0) / a)
else if (y <= 2.2d+96) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = (y / 2.0d0) * (x / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -8e-91) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 0.054) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.7e+82) {
tmp = x * ((y * 0.5) / a);
} else if (y <= 2.2e+96) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -8e-91: tmp = 0.5 * (y / (a / x)) elif y <= 0.054: tmp = -4.5 * ((z * t) / a) elif y <= 1.7e+82: tmp = x * ((y * 0.5) / a) elif y <= 2.2e+96: tmp = -4.5 * (t / (a / z)) else: tmp = (y / 2.0) * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -8e-91) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (y <= 0.054) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 1.7e+82) tmp = Float64(x * Float64(Float64(y * 0.5) / a)); elseif (y <= 2.2e+96) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(Float64(y / 2.0) * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -8e-91) tmp = 0.5 * (y / (a / x)); elseif (y <= 0.054) tmp = -4.5 * ((z * t) / a); elseif (y <= 1.7e+82) tmp = x * ((y * 0.5) / a); elseif (y <= 2.2e+96) tmp = -4.5 * (t / (a / z)); else tmp = (y / 2.0) * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -8e-91], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.054], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+82], N[(x * N[(N[(y * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+96], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / 2.0), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-91}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;y \leq 0.054:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;x \cdot \frac{y \cdot 0.5}{a}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+96}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{2} \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -8.00000000000000018e-91Initial program 91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in x around inf 57.1%
associate-/l*58.9%
Simplified58.9%
if -8.00000000000000018e-91 < y < 0.0539999999999999994Initial program 96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 74.7%
if 0.0539999999999999994 < y < 1.69999999999999997e82Initial program 99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 80.1%
*-commutative80.1%
*-commutative80.1%
associate-*l/80.1%
associate-*r/79.9%
associate-*l*80.2%
associate-*r/80.2%
Simplified80.2%
if 1.69999999999999997e82 < y < 2.1999999999999999e96Initial program 66.7%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in x around 0 36.3%
associate-/l*22.5%
Simplified22.5%
if 2.1999999999999999e96 < y Initial program 86.0%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around inf 69.4%
*-commutative69.4%
times-frac78.7%
Applied egg-rr78.7%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -3.1e-90)
(* 0.5 (/ y (/ a x)))
(if (<= y 8e-5)
(* -4.5 (/ (* z t) a))
(if (<= y 1.7e+82)
(* (/ y a) (* x 0.5))
(if (<= y 2.3e+96) (* -4.5 (/ t (/ a z))) (* (/ y 2.0) (/ x a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e-90) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 8e-5) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.7e+82) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 2.3e+96) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-3.1d-90)) then
tmp = 0.5d0 * (y / (a / x))
else if (y <= 8d-5) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 1.7d+82) then
tmp = (y / a) * (x * 0.5d0)
else if (y <= 2.3d+96) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = (y / 2.0d0) * (x / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.1e-90) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 8e-5) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.7e+82) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 2.3e+96) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.1e-90: tmp = 0.5 * (y / (a / x)) elif y <= 8e-5: tmp = -4.5 * ((z * t) / a) elif y <= 1.7e+82: tmp = (y / a) * (x * 0.5) elif y <= 2.3e+96: tmp = -4.5 * (t / (a / z)) else: tmp = (y / 2.0) * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.1e-90) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (y <= 8e-5) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 1.7e+82) tmp = Float64(Float64(y / a) * Float64(x * 0.5)); elseif (y <= 2.3e+96) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(Float64(y / 2.0) * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.1e-90) tmp = 0.5 * (y / (a / x)); elseif (y <= 8e-5) tmp = -4.5 * ((z * t) / a); elseif (y <= 1.7e+82) tmp = (y / a) * (x * 0.5); elseif (y <= 2.3e+96) tmp = -4.5 * (t / (a / z)); else tmp = (y / 2.0) * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e-90], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-5], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+82], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+96], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / 2.0), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-90}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-5}:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+96}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{2} \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -3.1000000000000001e-90Initial program 91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in x around inf 57.1%
associate-/l*58.9%
Simplified58.9%
if -3.1000000000000001e-90 < y < 8.00000000000000065e-5Initial program 96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 74.7%
if 8.00000000000000065e-5 < y < 1.69999999999999997e82Initial program 99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 80.1%
times-frac80.2%
div-inv80.2%
metadata-eval80.2%
Applied egg-rr80.2%
if 1.69999999999999997e82 < y < 2.30000000000000015e96Initial program 66.7%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in x around 0 36.3%
associate-/l*22.5%
Simplified22.5%
if 2.30000000000000015e96 < y Initial program 86.0%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around inf 69.4%
*-commutative69.4%
times-frac78.7%
Applied egg-rr78.7%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.6e-90)
(* 0.5 (/ y (/ a x)))
(if (<= y 0.018)
(* -4.5 (/ (* z t) a))
(if (<= y 1.3e+82)
(* (/ y a) (* x 0.5))
(if (<= y 4.1e+96) (/ (* t -4.5) (/ a z)) (* (/ y 2.0) (/ x a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.6e-90) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 0.018) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.3e+82) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 4.1e+96) {
tmp = (t * -4.5) / (a / z);
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.6d-90)) then
tmp = 0.5d0 * (y / (a / x))
else if (y <= 0.018d0) then
tmp = (-4.5d0) * ((z * t) / a)
else if (y <= 1.3d+82) then
tmp = (y / a) * (x * 0.5d0)
else if (y <= 4.1d+96) then
tmp = (t * (-4.5d0)) / (a / z)
else
tmp = (y / 2.0d0) * (x / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.6e-90) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 0.018) {
tmp = -4.5 * ((z * t) / a);
} else if (y <= 1.3e+82) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 4.1e+96) {
tmp = (t * -4.5) / (a / z);
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.6e-90: tmp = 0.5 * (y / (a / x)) elif y <= 0.018: tmp = -4.5 * ((z * t) / a) elif y <= 1.3e+82: tmp = (y / a) * (x * 0.5) elif y <= 4.1e+96: tmp = (t * -4.5) / (a / z) else: tmp = (y / 2.0) * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.6e-90) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (y <= 0.018) tmp = Float64(-4.5 * Float64(Float64(z * t) / a)); elseif (y <= 1.3e+82) tmp = Float64(Float64(y / a) * Float64(x * 0.5)); elseif (y <= 4.1e+96) tmp = Float64(Float64(t * -4.5) / Float64(a / z)); else tmp = Float64(Float64(y / 2.0) * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.6e-90) tmp = 0.5 * (y / (a / x)); elseif (y <= 0.018) tmp = -4.5 * ((z * t) / a); elseif (y <= 1.3e+82) tmp = (y / a) * (x * 0.5); elseif (y <= 4.1e+96) tmp = (t * -4.5) / (a / z); else tmp = (y / 2.0) * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.6e-90], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.018], N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+82], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+96], N[(N[(t * -4.5), $MachinePrecision] / N[(a / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / 2.0), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-90}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;y \leq 0.018:\\
\;\;\;\;-4.5 \cdot \frac{z \cdot t}{a}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+96}:\\
\;\;\;\;\frac{t \cdot -4.5}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{2} \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -1.60000000000000004e-90Initial program 91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in x around inf 57.1%
associate-/l*58.9%
Simplified58.9%
if -1.60000000000000004e-90 < y < 0.0179999999999999986Initial program 96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 74.7%
if 0.0179999999999999986 < y < 1.2999999999999999e82Initial program 99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 80.1%
times-frac80.2%
div-inv80.2%
metadata-eval80.2%
Applied egg-rr80.2%
if 1.2999999999999999e82 < y < 4.09999999999999998e96Initial program 66.7%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in x around 0 36.3%
associate-/l*22.5%
Simplified22.5%
associate-*r/22.5%
Applied egg-rr22.5%
if 4.09999999999999998e96 < y Initial program 86.0%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around inf 69.4%
*-commutative69.4%
times-frac78.7%
Applied egg-rr78.7%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.2e-90)
(* 0.5 (/ y (/ a x)))
(if (<= y 0.06)
(/ (* -4.5 (* z t)) a)
(if (<= y 1.6e+82)
(* (/ y a) (* x 0.5))
(if (<= y 2.2e+96) (/ (* t -4.5) (/ a z)) (* (/ y 2.0) (/ x a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.2e-90) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 0.06) {
tmp = (-4.5 * (z * t)) / a;
} else if (y <= 1.6e+82) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 2.2e+96) {
tmp = (t * -4.5) / (a / z);
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-2.2d-90)) then
tmp = 0.5d0 * (y / (a / x))
else if (y <= 0.06d0) then
tmp = ((-4.5d0) * (z * t)) / a
else if (y <= 1.6d+82) then
tmp = (y / a) * (x * 0.5d0)
else if (y <= 2.2d+96) then
tmp = (t * (-4.5d0)) / (a / z)
else
tmp = (y / 2.0d0) * (x / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.2e-90) {
tmp = 0.5 * (y / (a / x));
} else if (y <= 0.06) {
tmp = (-4.5 * (z * t)) / a;
} else if (y <= 1.6e+82) {
tmp = (y / a) * (x * 0.5);
} else if (y <= 2.2e+96) {
tmp = (t * -4.5) / (a / z);
} else {
tmp = (y / 2.0) * (x / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.2e-90: tmp = 0.5 * (y / (a / x)) elif y <= 0.06: tmp = (-4.5 * (z * t)) / a elif y <= 1.6e+82: tmp = (y / a) * (x * 0.5) elif y <= 2.2e+96: tmp = (t * -4.5) / (a / z) else: tmp = (y / 2.0) * (x / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.2e-90) tmp = Float64(0.5 * Float64(y / Float64(a / x))); elseif (y <= 0.06) tmp = Float64(Float64(-4.5 * Float64(z * t)) / a); elseif (y <= 1.6e+82) tmp = Float64(Float64(y / a) * Float64(x * 0.5)); elseif (y <= 2.2e+96) tmp = Float64(Float64(t * -4.5) / Float64(a / z)); else tmp = Float64(Float64(y / 2.0) * Float64(x / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.2e-90) tmp = 0.5 * (y / (a / x)); elseif (y <= 0.06) tmp = (-4.5 * (z * t)) / a; elseif (y <= 1.6e+82) tmp = (y / a) * (x * 0.5); elseif (y <= 2.2e+96) tmp = (t * -4.5) / (a / z); else tmp = (y / 2.0) * (x / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.2e-90], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.06], N[(N[(-4.5 * N[(z * t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 1.6e+82], N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+96], N[(N[(t * -4.5), $MachinePrecision] / N[(a / z), $MachinePrecision]), $MachinePrecision], N[(N[(y / 2.0), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-90}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\mathbf{elif}\;y \leq 0.06:\\
\;\;\;\;\frac{-4.5 \cdot \left(z \cdot t\right)}{a}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+82}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right)\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+96}:\\
\;\;\;\;\frac{t \cdot -4.5}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{2} \cdot \frac{x}{a}\\
\end{array}
\end{array}
if y < -2.19999999999999986e-90Initial program 91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in x around inf 57.1%
associate-/l*58.9%
Simplified58.9%
if -2.19999999999999986e-90 < y < 0.059999999999999998Initial program 96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 74.7%
associate-/l*72.0%
Simplified72.0%
associate-*r/72.1%
Applied egg-rr72.1%
div-inv71.4%
clear-num71.9%
associate-*r*71.9%
*-commutative71.9%
associate-*l*71.9%
Applied egg-rr71.9%
Taylor expanded in t around 0 74.7%
associate-*r/74.8%
Simplified74.8%
if 0.059999999999999998 < y < 1.59999999999999987e82Initial program 99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 80.1%
times-frac80.2%
div-inv80.2%
metadata-eval80.2%
Applied egg-rr80.2%
if 1.59999999999999987e82 < y < 2.1999999999999999e96Initial program 66.7%
associate-*l*66.7%
Simplified66.7%
Taylor expanded in x around 0 36.3%
associate-/l*22.5%
Simplified22.5%
associate-*r/22.5%
Applied egg-rr22.5%
if 2.1999999999999999e96 < y Initial program 86.0%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around inf 69.4%
*-commutative69.4%
times-frac78.7%
Applied egg-rr78.7%
Final simplification70.5%
(FPCore (x y z t a) :precision binary64 (* -4.5 (* t (/ z a))))
double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (-4.5d0) * (t * (z / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (t * (z / a));
}
def code(x, y, z, t, a): return -4.5 * (t * (z / a))
function code(x, y, z, t, a) return Float64(-4.5 * Float64(t * Float64(z / a))) end
function tmp = code(x, y, z, t, a) tmp = -4.5 * (t * (z / a)); end
code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-4.5 \cdot \left(t \cdot \frac{z}{a}\right)
\end{array}
Initial program 93.1%
associate-*l*93.1%
Simplified93.1%
div-inv93.0%
fma-neg93.0%
distribute-rgt-neg-in93.0%
*-commutative93.0%
distribute-rgt-neg-in93.0%
metadata-eval93.0%
*-commutative93.0%
associate-/r*93.0%
metadata-eval93.0%
Applied egg-rr93.0%
Taylor expanded in x around 0 52.8%
associate-*r/49.9%
Simplified49.9%
Final simplification49.9%
(FPCore (x y z t a) :precision binary64 (* -4.5 (/ (* z t) a)))
double code(double x, double y, double z, double t, double a) {
return -4.5 * ((z * t) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (-4.5d0) * ((z * t) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * ((z * t) / a);
}
def code(x, y, z, t, a): return -4.5 * ((z * t) / a)
function code(x, y, z, t, a) return Float64(-4.5 * Float64(Float64(z * t) / a)) end
function tmp = code(x, y, z, t, a) tmp = -4.5 * ((z * t) / a); end
code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(N[(z * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-4.5 \cdot \frac{z \cdot t}{a}
\end{array}
Initial program 93.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around 0 52.8%
Final simplification52.8%
(FPCore (x y z t a)
:precision binary64
(if (< a -2.090464557976709e+86)
(- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
(if (< a 2.144030707833976e+99)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a < (-2.090464557976709d+86)) then
tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
else if (a < 2.144030707833976d+99) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a < -2.090464557976709e+86: tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))) elif a < 2.144030707833976e+99: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a < -2.090464557976709e+86) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z)))); elseif (a < 2.144030707833976e+99) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a < -2.090464557976709e+86) tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))); elseif (a < 2.144030707833976e+99) tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0); else tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\
\end{array}
\end{array}
herbie shell --seed 2023279
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))