
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
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 - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
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 - t) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.35e+134) (not (<= t 3e+38))) (+ x (* y (/ (- z a) t))) (fma (- z t) (/ -1.0 (/ (- a t) y)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.35e+134) || !(t <= 3e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = fma((z - t), (-1.0 / ((a - t) / y)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.35e+134) || !(t <= 3e+38)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = fma(Float64(z - t), Float64(-1.0 / Float64(Float64(a - t) / y)), Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.35e+134], N[Not[LessEqual[t, 3e+38]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(-1.0 / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+134} \lor \neg \left(t \leq 3 \cdot 10^{+38}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{-1}{\frac{a - t}{y}}, x + y\right)\\
\end{array}
\end{array}
if t < -1.35e134 or 3.0000000000000001e38 < t Initial program 51.9%
Taylor expanded in t around -inf 79.2%
mul-1-neg79.2%
unsub-neg79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around 0 80.4%
associate-*r/93.7%
Simplified93.7%
if -1.35e134 < t < 3.0000000000000001e38Initial program 92.2%
sub-neg92.2%
+-commutative92.2%
distribute-frac-neg92.2%
distribute-rgt-neg-out92.2%
associate-/l*96.4%
fma-define96.5%
distribute-frac-neg96.5%
distribute-neg-frac296.5%
sub-neg96.5%
distribute-neg-in96.5%
remove-double-neg96.5%
+-commutative96.5%
sub-neg96.5%
Simplified96.5%
clear-num96.5%
inv-pow96.5%
Applied egg-rr96.5%
unpow-196.5%
Simplified96.5%
Final simplification95.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+128) (not (<= t 1.25e+38))) (+ x (* y (/ (- z a) t))) (fma (- z t) (/ y (- t a)) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+128) || !(t <= 1.25e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = fma((z - t), (y / (t - a)), (x + y));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+128) || !(t <= 1.25e+38)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+128], N[Not[LessEqual[t, 1.25e+38]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+128} \lor \neg \left(t \leq 1.25 \cdot 10^{+38}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if t < -3.3999999999999999e128 or 1.24999999999999992e38 < t Initial program 51.9%
Taylor expanded in t around -inf 79.2%
mul-1-neg79.2%
unsub-neg79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around 0 80.4%
associate-*r/93.7%
Simplified93.7%
if -3.3999999999999999e128 < t < 1.24999999999999992e38Initial program 92.2%
sub-neg92.2%
+-commutative92.2%
distribute-frac-neg92.2%
distribute-rgt-neg-out92.2%
associate-/l*96.4%
fma-define96.5%
distribute-frac-neg96.5%
distribute-neg-frac296.5%
sub-neg96.5%
distribute-neg-in96.5%
remove-double-neg96.5%
+-commutative96.5%
sub-neg96.5%
Simplified96.5%
Final simplification95.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.2e+128) (not (<= t 3e+38))) (+ x (* y (/ (- z a) t))) (+ (+ x y) (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.2e+128) || !(t <= 3e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) + (y / ((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) :: tmp
if ((t <= (-8.2d+128)) .or. (.not. (t <= 3d+38))) then
tmp = x + (y * ((z - a) / t))
else
tmp = (x + y) + (y / ((t - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.2e+128) || !(t <= 3e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) + (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.2e+128) or not (t <= 3e+38): tmp = x + (y * ((z - a) / t)) else: tmp = (x + y) + (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.2e+128) || !(t <= 3e+38)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(Float64(x + y) + Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -8.2e+128) || ~((t <= 3e+38))) tmp = x + (y * ((z - a) / t)); else tmp = (x + y) + (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.2e+128], N[Not[LessEqual[t, 3e+38]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+128} \lor \neg \left(t \leq 3 \cdot 10^{+38}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if t < -8.20000000000000023e128 or 3.0000000000000001e38 < t Initial program 51.9%
Taylor expanded in t around -inf 79.2%
mul-1-neg79.2%
unsub-neg79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around 0 80.4%
associate-*r/93.7%
Simplified93.7%
if -8.20000000000000023e128 < t < 3.0000000000000001e38Initial program 92.2%
Taylor expanded in z around inf 92.3%
associate-/l*95.6%
Simplified95.6%
clear-num95.6%
un-div-inv95.7%
Applied egg-rr95.7%
Final simplification95.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6e+130) (not (<= t 1.65e+38))) (+ x (* y (/ (- z a) t))) (- (+ x y) (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e+130) || !(t <= 1.65e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) - (y * (z / (a - t)));
}
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 ((t <= (-6d+130)) .or. (.not. (t <= 1.65d+38))) then
tmp = x + (y * ((z - a) / t))
else
tmp = (x + y) - (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e+130) || !(t <= 1.65e+38)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) - (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6e+130) or not (t <= 1.65e+38): tmp = x + (y * ((z - a) / t)) else: tmp = (x + y) - (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6e+130) || !(t <= 1.65e+38)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6e+130) || ~((t <= 1.65e+38))) tmp = x + (y * ((z - a) / t)); else tmp = (x + y) - (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6e+130], N[Not[LessEqual[t, 1.65e+38]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+130} \lor \neg \left(t \leq 1.65 \cdot 10^{+38}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -5.9999999999999999e130 or 1.65e38 < t Initial program 51.9%
Taylor expanded in t around -inf 79.2%
mul-1-neg79.2%
unsub-neg79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y around 0 80.4%
associate-*r/93.7%
Simplified93.7%
if -5.9999999999999999e130 < t < 1.65e38Initial program 92.2%
Taylor expanded in z around inf 92.3%
associate-/l*95.6%
Simplified95.6%
Final simplification95.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e+68) (not (<= a 2.1e+30))) (- (+ x y) (* y (/ z a))) (+ x (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e+68) || !(a <= 2.1e+30)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + (y / ((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) :: tmp
if ((a <= (-1.6d+68)) .or. (.not. (a <= 2.1d+30))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x + (y / ((t - a) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e+68) || !(a <= 2.1e+30)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.6e+68) or not (a <= 2.1e+30): tmp = (x + y) - (y * (z / a)) else: tmp = x + (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e+68) || !(a <= 2.1e+30)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.6e+68) || ~((a <= 2.1e+30))) tmp = (x + y) - (y * (z / a)); else tmp = x + (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e+68], N[Not[LessEqual[a, 2.1e+30]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+68} \lor \neg \left(a \leq 2.1 \cdot 10^{+30}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if a < -1.59999999999999997e68 or 2.1e30 < a Initial program 78.0%
Taylor expanded in t around 0 81.4%
associate-/l*89.2%
Simplified89.2%
if -1.59999999999999997e68 < a < 2.1e30Initial program 79.6%
Taylor expanded in z around inf 80.5%
associate-/l*81.8%
Simplified81.8%
clear-num81.8%
un-div-inv81.9%
Applied egg-rr81.9%
Taylor expanded in x around inf 91.9%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.3e+68) (not (<= a 4e+171))) (+ x y) (+ x (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e+68) || !(a <= 4e+171)) {
tmp = x + y;
} else {
tmp = x + (y / ((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) :: tmp
if ((a <= (-2.3d+68)) .or. (.not. (a <= 4d+171))) then
tmp = x + y
else
tmp = x + (y / ((t - a) / z))
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.3e+68) || !(a <= 4e+171)) {
tmp = x + y;
} else {
tmp = x + (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.3e+68) or not (a <= 4e+171): tmp = x + y else: tmp = x + (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.3e+68) || !(a <= 4e+171)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.3e+68) || ~((a <= 4e+171))) tmp = x + y; else tmp = x + (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.3e+68], N[Not[LessEqual[a, 4e+171]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+68} \lor \neg \left(a \leq 4 \cdot 10^{+171}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if a < -2.3e68 or 3.99999999999999982e171 < a Initial program 77.9%
sub-neg77.9%
+-commutative77.9%
distribute-frac-neg77.9%
distribute-rgt-neg-out77.9%
associate-/l*92.7%
fma-define92.9%
distribute-frac-neg92.9%
distribute-neg-frac292.9%
sub-neg92.9%
distribute-neg-in92.9%
remove-double-neg92.9%
+-commutative92.9%
sub-neg92.9%
Simplified92.9%
Taylor expanded in a around inf 85.0%
+-commutative85.0%
Simplified85.0%
if -2.3e68 < a < 3.99999999999999982e171Initial program 79.4%
Taylor expanded in z around inf 80.2%
associate-/l*82.3%
Simplified82.3%
clear-num82.3%
un-div-inv82.3%
Applied egg-rr82.3%
Taylor expanded in x around inf 89.4%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.6e+68) (not (<= a 6.9e+168))) (+ x y) (+ x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.6e+68) || !(a <= 6.9e+168)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (t - 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 ((a <= (-2.6d+68)) .or. (.not. (a <= 6.9d+168))) then
tmp = x + y
else
tmp = x + (y * (z / (t - a)))
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.6e+68) || !(a <= 6.9e+168)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.6e+68) or not (a <= 6.9e+168): tmp = x + y else: tmp = x + (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.6e+68) || !(a <= 6.9e+168)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.6e+68) || ~((a <= 6.9e+168))) tmp = x + y; else tmp = x + (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.6e+68], N[Not[LessEqual[a, 6.9e+168]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+68} \lor \neg \left(a \leq 6.9 \cdot 10^{+168}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if a < -2.5999999999999998e68 or 6.8999999999999998e168 < a Initial program 77.9%
sub-neg77.9%
+-commutative77.9%
distribute-frac-neg77.9%
distribute-rgt-neg-out77.9%
associate-/l*92.7%
fma-define92.9%
distribute-frac-neg92.9%
distribute-neg-frac292.9%
sub-neg92.9%
distribute-neg-in92.9%
remove-double-neg92.9%
+-commutative92.9%
sub-neg92.9%
Simplified92.9%
Taylor expanded in a around inf 85.0%
+-commutative85.0%
Simplified85.0%
if -2.5999999999999998e68 < a < 6.8999999999999998e168Initial program 79.4%
Taylor expanded in z around inf 80.2%
associate-/l*82.3%
Simplified82.3%
Taylor expanded in x around inf 89.3%
Final simplification88.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2e+55) (- (+ x y) (/ y (/ a z))) (if (<= a 2.7e+31) (+ x (/ y (/ (- t a) z))) (- (+ x y) (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+55) {
tmp = (x + y) - (y / (a / z));
} else if (a <= 2.7e+31) {
tmp = x + (y / ((t - a) / z));
} else {
tmp = (x + y) - (y * (z / 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 (a <= (-2d+55)) then
tmp = (x + y) - (y / (a / z))
else if (a <= 2.7d+31) then
tmp = x + (y / ((t - a) / z))
else
tmp = (x + y) - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+55) {
tmp = (x + y) - (y / (a / z));
} else if (a <= 2.7e+31) {
tmp = x + (y / ((t - a) / z));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e+55: tmp = (x + y) - (y / (a / z)) elif a <= 2.7e+31: tmp = x + (y / ((t - a) / z)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+55) tmp = Float64(Float64(x + y) - Float64(y / Float64(a / z))); elseif (a <= 2.7e+31) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / z))); else tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2e+55) tmp = (x + y) - (y / (a / z)); elseif (a <= 2.7e+31) tmp = x + (y / ((t - a) / z)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+55], N[(N[(x + y), $MachinePrecision] - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e+31], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+55}:\\
\;\;\;\;\left(x + y\right) - \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -2.00000000000000002e55Initial program 83.3%
Taylor expanded in z around inf 84.8%
associate-/l*92.3%
Simplified92.3%
clear-num92.3%
un-div-inv92.4%
Applied egg-rr92.4%
Taylor expanded in a around inf 92.0%
if -2.00000000000000002e55 < a < 2.69999999999999986e31Initial program 79.4%
Taylor expanded in z around inf 80.2%
associate-/l*81.6%
Simplified81.6%
clear-num81.6%
un-div-inv81.6%
Applied egg-rr81.6%
Taylor expanded in x around inf 91.8%
if 2.69999999999999986e31 < a Initial program 74.2%
Taylor expanded in t around 0 79.3%
associate-/l*87.2%
Simplified87.2%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.4e+47) (not (<= a 2.2e+31))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.4e+47) || !(a <= 2.2e+31)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
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.4d+47)) .or. (.not. (a <= 2.2d+31))) then
tmp = x + y
else
tmp = x + (y * (z / t))
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.4e+47) || !(a <= 2.2e+31)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.4e+47) or not (a <= 2.2e+31): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.4e+47) || !(a <= 2.2e+31)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.4e+47) || ~((a <= 2.2e+31))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.4e+47], N[Not[LessEqual[a, 2.2e+31]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+47} \lor \neg \left(a \leq 2.2 \cdot 10^{+31}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -2.40000000000000019e47 or 2.2000000000000001e31 < a Initial program 78.6%
sub-neg78.6%
+-commutative78.6%
distribute-frac-neg78.6%
distribute-rgt-neg-out78.6%
associate-/l*90.3%
fma-define90.5%
distribute-frac-neg90.5%
distribute-neg-frac290.5%
sub-neg90.5%
distribute-neg-in90.5%
remove-double-neg90.5%
+-commutative90.5%
sub-neg90.5%
Simplified90.5%
Taylor expanded in a around inf 78.5%
+-commutative78.5%
Simplified78.5%
if -2.40000000000000019e47 < a < 2.2000000000000001e31Initial program 79.2%
Taylor expanded in z around inf 80.1%
associate-/l*81.4%
Simplified81.4%
Taylor expanded in x around inf 91.8%
Taylor expanded in a around 0 79.6%
cancel-sign-sub-inv79.6%
metadata-eval79.6%
associate-*r/82.9%
*-lft-identity82.9%
Simplified82.9%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.3e+101) (not (<= z 8.6e+103))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e+101) || !(z <= 8.6e+103)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
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 ((z <= (-1.3d+101)) .or. (.not. (z <= 8.6d+103))) then
tmp = y * (z / (t - a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.3e+101) || !(z <= 8.6e+103)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.3e+101) or not (z <= 8.6e+103): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.3e+101) || !(z <= 8.6e+103)) tmp = Float64(y * Float64(z / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.3e+101) || ~((z <= 8.6e+103))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.3e+101], N[Not[LessEqual[z, 8.6e+103]], $MachinePrecision]], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+101} \lor \neg \left(z \leq 8.6 \cdot 10^{+103}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.3e101 or 8.59999999999999938e103 < z Initial program 77.1%
sub-neg77.1%
+-commutative77.1%
distribute-frac-neg77.1%
distribute-rgt-neg-out77.1%
associate-/l*88.9%
fma-define89.0%
distribute-frac-neg89.0%
distribute-neg-frac289.0%
sub-neg89.0%
distribute-neg-in89.0%
remove-double-neg89.0%
+-commutative89.0%
sub-neg89.0%
Simplified89.0%
Taylor expanded in z around inf 60.0%
associate-/l*64.2%
Simplified64.2%
if -1.3e101 < z < 8.59999999999999938e103Initial program 79.9%
sub-neg79.9%
+-commutative79.9%
distribute-frac-neg79.9%
distribute-rgt-neg-out79.9%
associate-/l*83.7%
fma-define83.8%
distribute-frac-neg83.8%
distribute-neg-frac283.8%
sub-neg83.8%
distribute-neg-in83.8%
remove-double-neg83.8%
+-commutative83.8%
sub-neg83.8%
Simplified83.8%
Taylor expanded in a around inf 71.3%
+-commutative71.3%
Simplified71.3%
Final simplification68.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.5e+101) (* z (/ y (- t a))) (if (<= z 1.25e+106) (+ x y) (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+101) {
tmp = z * (y / (t - a));
} else if (z <= 1.25e+106) {
tmp = x + y;
} else {
tmp = y * (z / (t - 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 (z <= (-3.5d+101)) then
tmp = z * (y / (t - a))
else if (z <= 1.25d+106) then
tmp = x + y
else
tmp = y * (z / (t - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e+101) {
tmp = z * (y / (t - a));
} else if (z <= 1.25e+106) {
tmp = x + y;
} else {
tmp = y * (z / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.5e+101: tmp = z * (y / (t - a)) elif z <= 1.25e+106: tmp = x + y else: tmp = y * (z / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e+101) tmp = Float64(z * Float64(y / Float64(t - a))); elseif (z <= 1.25e+106) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.5e+101) tmp = z * (y / (t - a)); elseif (z <= 1.25e+106) tmp = x + y; else tmp = y * (z / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e+101], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+106], N[(x + y), $MachinePrecision], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+101}:\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+106}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < -3.50000000000000023e101Initial program 77.8%
sub-neg77.8%
+-commutative77.8%
distribute-frac-neg77.8%
distribute-rgt-neg-out77.8%
associate-/l*87.7%
fma-define87.7%
distribute-frac-neg87.7%
distribute-neg-frac287.7%
sub-neg87.7%
distribute-neg-in87.7%
remove-double-neg87.7%
+-commutative87.7%
sub-neg87.7%
Simplified87.7%
Taylor expanded in z around inf 61.1%
*-commutative61.1%
*-lft-identity61.1%
times-frac64.0%
/-rgt-identity64.0%
Simplified64.0%
if -3.50000000000000023e101 < z < 1.25e106Initial program 79.9%
sub-neg79.9%
+-commutative79.9%
distribute-frac-neg79.9%
distribute-rgt-neg-out79.9%
associate-/l*83.7%
fma-define83.8%
distribute-frac-neg83.8%
distribute-neg-frac283.8%
sub-neg83.8%
distribute-neg-in83.8%
remove-double-neg83.8%
+-commutative83.8%
sub-neg83.8%
Simplified83.8%
Taylor expanded in a around inf 71.3%
+-commutative71.3%
Simplified71.3%
if 1.25e106 < z Initial program 76.5%
sub-neg76.5%
+-commutative76.5%
distribute-frac-neg76.5%
distribute-rgt-neg-out76.5%
associate-/l*89.9%
fma-define90.1%
distribute-frac-neg90.1%
distribute-neg-frac290.1%
sub-neg90.1%
distribute-neg-in90.1%
remove-double-neg90.1%
+-commutative90.1%
sub-neg90.1%
Simplified90.1%
Taylor expanded in z around inf 59.2%
associate-/l*64.9%
Simplified64.9%
Final simplification69.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e-137) (not (<= a 2.65e-192))) (+ x y) (* y (/ z t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e-137) || !(a <= 2.65e-192)) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
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.2d-137)) .or. (.not. (a <= 2.65d-192))) then
tmp = x + y
else
tmp = y * (z / t)
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.2e-137) || !(a <= 2.65e-192)) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e-137) or not (a <= 2.65e-192): tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e-137) || !(a <= 2.65e-192)) tmp = Float64(x + y); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.2e-137) || ~((a <= 2.65e-192))) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.2e-137], N[Not[LessEqual[a, 2.65e-192]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-137} \lor \neg \left(a \leq 2.65 \cdot 10^{-192}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -2.2000000000000001e-137 or 2.64999999999999985e-192 < a Initial program 80.0%
sub-neg80.0%
+-commutative80.0%
distribute-frac-neg80.0%
distribute-rgt-neg-out80.0%
associate-/l*87.7%
fma-define87.7%
distribute-frac-neg87.7%
distribute-neg-frac287.7%
sub-neg87.7%
distribute-neg-in87.7%
remove-double-neg87.7%
+-commutative87.7%
sub-neg87.7%
Simplified87.7%
Taylor expanded in a around inf 68.6%
+-commutative68.6%
Simplified68.6%
if -2.2000000000000001e-137 < a < 2.64999999999999985e-192Initial program 75.9%
sub-neg75.9%
+-commutative75.9%
distribute-frac-neg75.9%
distribute-rgt-neg-out75.9%
associate-/l*79.1%
fma-define79.3%
distribute-frac-neg79.3%
distribute-neg-frac279.3%
sub-neg79.3%
distribute-neg-in79.3%
remove-double-neg79.3%
+-commutative79.3%
sub-neg79.3%
Simplified79.3%
Taylor expanded in z around inf 62.1%
Taylor expanded in t around inf 55.6%
associate-/l*57.1%
Simplified57.1%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.5e+186) y (if (<= y 6.7e+145) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.5e+186) {
tmp = y;
} else if (y <= 6.7e+145) {
tmp = x;
} else {
tmp = y;
}
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.5d+186)) then
tmp = y
else if (y <= 6.7d+145) then
tmp = x
else
tmp = y
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.5e+186) {
tmp = y;
} else if (y <= 6.7e+145) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.5e+186: tmp = y elif y <= 6.7e+145: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.5e+186) tmp = y; elseif (y <= 6.7e+145) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.5e+186) tmp = y; elseif (y <= 6.7e+145) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.5e+186], y, If[LessEqual[y, 6.7e+145], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+186}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 6.7 \cdot 10^{+145}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -2.49999999999999977e186 or 6.6999999999999996e145 < y Initial program 67.1%
sub-neg67.1%
+-commutative67.1%
distribute-frac-neg67.1%
distribute-rgt-neg-out67.1%
associate-/l*83.4%
fma-define83.6%
distribute-frac-neg83.6%
distribute-neg-frac283.6%
sub-neg83.6%
distribute-neg-in83.6%
remove-double-neg83.6%
+-commutative83.6%
sub-neg83.6%
Simplified83.6%
Taylor expanded in a around inf 42.9%
+-commutative42.9%
Simplified42.9%
Taylor expanded in y around inf 37.7%
if -2.49999999999999977e186 < y < 6.6999999999999996e145Initial program 83.4%
sub-neg83.4%
+-commutative83.4%
distribute-frac-neg83.4%
distribute-rgt-neg-out83.4%
associate-/l*86.3%
fma-define86.3%
distribute-frac-neg86.3%
distribute-neg-frac286.3%
sub-neg86.3%
distribute-neg-in86.3%
remove-double-neg86.3%
+-commutative86.3%
sub-neg86.3%
Simplified86.3%
Taylor expanded in t around inf 60.3%
distribute-rgt1-in60.3%
metadata-eval60.3%
mul0-lft60.3%
Simplified60.3%
Taylor expanded in x around 0 60.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.4e+43) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.4e+43) {
tmp = x + y;
} else {
tmp = x;
}
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 (t <= 1.4d+43) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.4e+43) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.4e+43: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.4e+43) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.4e+43) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.4e+43], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{+43}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < 1.40000000000000009e43Initial program 85.2%
sub-neg85.2%
+-commutative85.2%
distribute-frac-neg85.2%
distribute-rgt-neg-out85.2%
associate-/l*90.6%
fma-define90.8%
distribute-frac-neg90.8%
distribute-neg-frac290.8%
sub-neg90.8%
distribute-neg-in90.8%
remove-double-neg90.8%
+-commutative90.8%
sub-neg90.8%
Simplified90.8%
Taylor expanded in a around inf 59.5%
+-commutative59.5%
Simplified59.5%
if 1.40000000000000009e43 < t Initial program 55.4%
sub-neg55.4%
+-commutative55.4%
distribute-frac-neg55.4%
distribute-rgt-neg-out55.4%
associate-/l*66.3%
fma-define66.2%
distribute-frac-neg66.2%
distribute-neg-frac266.2%
sub-neg66.2%
distribute-neg-in66.2%
remove-double-neg66.2%
+-commutative66.2%
sub-neg66.2%
Simplified66.2%
Taylor expanded in t around inf 67.2%
distribute-rgt1-in67.2%
metadata-eval67.2%
mul0-lft67.2%
Simplified67.2%
Taylor expanded in x around 0 67.2%
Final simplification61.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 78.9%
sub-neg78.9%
+-commutative78.9%
distribute-frac-neg78.9%
distribute-rgt-neg-out78.9%
associate-/l*85.5%
fma-define85.6%
distribute-frac-neg85.6%
distribute-neg-frac285.6%
sub-neg85.6%
distribute-neg-in85.6%
remove-double-neg85.6%
+-commutative85.6%
sub-neg85.6%
Simplified85.6%
Taylor expanded in t around inf 47.1%
distribute-rgt1-in47.1%
metadata-eval47.1%
mul0-lft47.1%
Simplified47.1%
Taylor expanded in x around 0 47.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} 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) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
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 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024185
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -13664970889390727/100000000000000000000000) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 14754293444577233/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)))))
(- (+ x y) (/ (* (- z t) y) (- a t))))