
(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 13 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 -3e+63) (not (<= t 1.55e+150))) (- (+ x (* y (/ z t))) (* a (/ y 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 <= -3e+63) || !(t <= 1.55e+150)) {
tmp = (x + (y * (z / t))) - (a * (y / 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 <= -3e+63) || !(t <= 1.55e+150)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) - Float64(a * Float64(y / 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, -3e+63], N[Not[LessEqual[t, 1.55e+150]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / 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 \cdot 10^{+63} \lor \neg \left(t \leq 1.55 \cdot 10^{+150}\right):\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) - a \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\end{array}
\end{array}
if t < -2.99999999999999999e63 or 1.55000000000000007e150 < t Initial program 58.7%
sub-neg58.7%
+-commutative58.7%
distribute-frac-neg58.7%
distribute-rgt-neg-out58.7%
associate-/l*74.1%
fma-define74.2%
distribute-frac-neg74.2%
distribute-neg-frac274.2%
sub-neg74.2%
distribute-neg-in74.2%
remove-double-neg74.2%
+-commutative74.2%
sub-neg74.2%
Simplified74.2%
Taylor expanded in t around inf 70.4%
associate-+r+77.0%
distribute-rgt1-in77.0%
metadata-eval77.0%
mul0-lft77.0%
associate-+r+77.0%
associate-/l*82.1%
associate-/l*88.7%
Simplified88.7%
if -2.99999999999999999e63 < t < 1.55000000000000007e150Initial program 89.7%
sub-neg89.7%
+-commutative89.7%
distribute-frac-neg89.7%
distribute-rgt-neg-out89.7%
associate-/l*94.8%
fma-define94.9%
distribute-frac-neg94.9%
distribute-neg-frac294.9%
sub-neg94.9%
distribute-neg-in94.9%
remove-double-neg94.9%
+-commutative94.9%
sub-neg94.9%
Simplified94.9%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (+ x y) (/ (* y (- t z)) (- a t)))))
(if (or (<= t_1 -4e-285) (not (<= t_1 2e-118)))
(+ (+ x y) (* (- z t) (/ y (- t a))))
(+ x (/ (* y (- z a)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -4e-285) || !(t_1 <= 2e-118)) {
tmp = (x + y) + ((z - t) * (y / (t - a)));
} else {
tmp = x + ((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) :: t_1
real(8) :: tmp
t_1 = (x + y) + ((y * (t - z)) / (a - t))
if ((t_1 <= (-4d-285)) .or. (.not. (t_1 <= 2d-118))) then
tmp = (x + y) + ((z - t) * (y / (t - a)))
else
tmp = x + ((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 t_1 = (x + y) + ((y * (t - z)) / (a - t));
double tmp;
if ((t_1 <= -4e-285) || !(t_1 <= 2e-118)) {
tmp = (x + y) + ((z - t) * (y / (t - a)));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x + y) + ((y * (t - z)) / (a - t)) tmp = 0 if (t_1 <= -4e-285) or not (t_1 <= 2e-118): tmp = (x + y) + ((z - t) * (y / (t - a))) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x + y) + Float64(Float64(y * Float64(t - z)) / Float64(a - t))) tmp = 0.0 if ((t_1 <= -4e-285) || !(t_1 <= 2e-118)) tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x + y) + ((y * (t - z)) / (a - t)); tmp = 0.0; if ((t_1 <= -4e-285) || ~((t_1 <= 2e-118))) tmp = (x + y) + ((z - t) * (y / (t - a))); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e-285], N[Not[LessEqual[t$95$1, 2e-118]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + \frac{y \cdot \left(t - z\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-285} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-118}\right):\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < -4.0000000000000003e-285 or 1.99999999999999997e-118 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) Initial program 81.0%
Taylor expanded in y around 0 81.0%
associate-*l/91.7%
Simplified91.7%
if -4.0000000000000003e-285 < (-.f64 (+.f64 x y) (/.f64 (*.f64 (-.f64 z t) y) (-.f64 a t))) < 1.99999999999999997e-118Initial program 33.7%
Taylor expanded in t around inf 89.5%
associate--l+89.5%
distribute-lft-out--89.5%
div-sub89.5%
mul-1-neg89.5%
unsub-neg89.5%
*-commutative89.5%
distribute-lft-out--89.5%
Simplified89.5%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.9e+61) (not (<= t 1.55e+150))) (- (+ x (* y (/ z t))) (* a (/ y t))) (+ (+ x y) (* (- z t) (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e+61) || !(t <= 1.55e+150)) {
tmp = (x + (y * (z / t))) - (a * (y / t));
} else {
tmp = (x + y) + ((z - t) * (y / (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 ((t <= (-2.9d+61)) .or. (.not. (t <= 1.55d+150))) then
tmp = (x + (y * (z / t))) - (a * (y / t))
else
tmp = (x + y) + ((z - t) * (y / (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 ((t <= -2.9e+61) || !(t <= 1.55e+150)) {
tmp = (x + (y * (z / t))) - (a * (y / t));
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.9e+61) or not (t <= 1.55e+150): tmp = (x + (y * (z / t))) - (a * (y / t)) else: tmp = (x + y) + ((z - t) * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.9e+61) || !(t <= 1.55e+150)) tmp = Float64(Float64(x + Float64(y * Float64(z / t))) - Float64(a * Float64(y / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.9e+61) || ~((t <= 1.55e+150))) tmp = (x + (y * (z / t))) - (a * (y / t)); else tmp = (x + y) + ((z - t) * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.9e+61], N[Not[LessEqual[t, 1.55e+150]], $MachinePrecision]], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+61} \lor \neg \left(t \leq 1.55 \cdot 10^{+150}\right):\\
\;\;\;\;\left(x + y \cdot \frac{z}{t}\right) - a \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -2.9000000000000001e61 or 1.55000000000000007e150 < t Initial program 58.7%
sub-neg58.7%
+-commutative58.7%
distribute-frac-neg58.7%
distribute-rgt-neg-out58.7%
associate-/l*74.1%
fma-define74.2%
distribute-frac-neg74.2%
distribute-neg-frac274.2%
sub-neg74.2%
distribute-neg-in74.2%
remove-double-neg74.2%
+-commutative74.2%
sub-neg74.2%
Simplified74.2%
Taylor expanded in t around inf 70.4%
associate-+r+77.0%
distribute-rgt1-in77.0%
metadata-eval77.0%
mul0-lft77.0%
associate-+r+77.0%
associate-/l*82.1%
associate-/l*88.7%
Simplified88.7%
if -2.9000000000000001e61 < t < 1.55000000000000007e150Initial program 89.7%
Taylor expanded in y around 0 89.7%
associate-*l/94.8%
Simplified94.8%
Final simplification92.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.1e+108) (not (<= a 11000.0))) (+ x y) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.1e+108) || !(a <= 11000.0)) {
tmp = x + y;
} else {
tmp = x + ((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 ((a <= (-1.1d+108)) .or. (.not. (a <= 11000.0d0))) then
tmp = x + y
else
tmp = x + ((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 ((a <= -1.1e+108) || !(a <= 11000.0)) {
tmp = x + y;
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.1e+108) or not (a <= 11000.0): tmp = x + y else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.1e+108) || !(a <= 11000.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.1e+108) || ~((a <= 11000.0))) tmp = x + y; else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.1e+108], N[Not[LessEqual[a, 11000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+108} \lor \neg \left(a \leq 11000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -1.1000000000000001e108 or 11000 < a Initial program 77.7%
Taylor expanded in a around inf 86.2%
+-commutative86.2%
Simplified86.2%
if -1.1000000000000001e108 < a < 11000Initial program 77.3%
Taylor expanded in t around inf 77.3%
associate--l+77.3%
distribute-lft-out--77.3%
div-sub77.3%
mul-1-neg77.3%
unsub-neg77.3%
*-commutative77.3%
distribute-lft-out--78.0%
Simplified78.0%
Final simplification81.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.1e+108) (not (<= a 1.56e-161))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y (- z a)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.1e+108) || !(a <= 1.56e-161)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((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 ((a <= (-1.1d+108)) .or. (.not. (a <= 1.56d-161))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x + ((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 ((a <= -1.1e+108) || !(a <= 1.56e-161)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.1e+108) or not (a <= 1.56e-161): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * (z - a)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.1e+108) || !(a <= 1.56e-161)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.1e+108) || ~((a <= 1.56e-161))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.1e+108], N[Not[LessEqual[a, 1.56e-161]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+108} \lor \neg \left(a \leq 1.56 \cdot 10^{-161}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if a < -1.1000000000000001e108 or 1.56e-161 < a Initial program 81.5%
Taylor expanded in t around 0 81.4%
+-commutative81.4%
associate-/l*88.8%
Simplified88.8%
if -1.1000000000000001e108 < a < 1.56e-161Initial program 72.8%
Taylor expanded in t around inf 78.6%
associate--l+78.6%
distribute-lft-out--78.6%
div-sub78.7%
mul-1-neg78.7%
unsub-neg78.7%
*-commutative78.7%
distribute-lft-out--79.5%
Simplified79.5%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= x -3.9e-131) (not (<= x 5.7e-149))) (+ x y) (* y (- 1.0 (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x <= -3.9e-131) || !(x <= 5.7e-149)) {
tmp = x + y;
} else {
tmp = y * (1.0 - (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 ((x <= (-3.9d-131)) .or. (.not. (x <= 5.7d-149))) then
tmp = x + y
else
tmp = y * (1.0d0 - (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 ((x <= -3.9e-131) || !(x <= 5.7e-149)) {
tmp = x + y;
} else {
tmp = y * (1.0 - (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (x <= -3.9e-131) or not (x <= 5.7e-149): tmp = x + y else: tmp = y * (1.0 - (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((x <= -3.9e-131) || !(x <= 5.7e-149)) tmp = Float64(x + y); else tmp = Float64(y * Float64(1.0 - Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((x <= -3.9e-131) || ~((x <= 5.7e-149))) tmp = x + y; else tmp = y * (1.0 - (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[x, -3.9e-131], N[Not[LessEqual[x, 5.7e-149]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(y * N[(1.0 - N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-131} \lor \neg \left(x \leq 5.7 \cdot 10^{-149}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\
\end{array}
\end{array}
if x < -3.9000000000000002e-131 or 5.6999999999999999e-149 < x Initial program 81.7%
Taylor expanded in a around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -3.9000000000000002e-131 < x < 5.6999999999999999e-149Initial program 65.7%
Taylor expanded in t around 0 51.2%
+-commutative51.2%
associate-/l*56.2%
Simplified56.2%
Taylor expanded in y around inf 54.7%
Final simplification68.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e+184) (not (<= z 8e+193))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e+184) || !(z <= 8e+193)) {
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 <= (-4.2d+184)) .or. (.not. (z <= 8d+193))) 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 <= -4.2e+184) || !(z <= 8e+193)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e+184) or not (z <= 8e+193): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e+184) || !(z <= 8e+193)) 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 <= -4.2e+184) || ~((z <= 8e+193))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e+184], N[Not[LessEqual[z, 8e+193]], $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 -4.2 \cdot 10^{+184} \lor \neg \left(z \leq 8 \cdot 10^{+193}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.2e184 or 8.00000000000000053e193 < z Initial program 74.7%
sub-neg74.7%
+-commutative74.7%
distribute-frac-neg74.7%
distribute-rgt-neg-out74.7%
associate-/l*95.6%
fma-define95.9%
distribute-frac-neg95.9%
distribute-neg-frac295.9%
sub-neg95.9%
distribute-neg-in95.9%
remove-double-neg95.9%
+-commutative95.9%
sub-neg95.9%
Simplified95.9%
Taylor expanded in z around inf 58.0%
associate-/l*68.2%
Simplified68.2%
if -4.2e184 < z < 8.00000000000000053e193Initial program 78.0%
Taylor expanded in a around inf 70.4%
+-commutative70.4%
Simplified70.4%
Final simplification70.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.5e+136) (not (<= a 215000.0))) (+ x y) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5e+136) || !(a <= 215000.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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 <= (-1.5d+136)) .or. (.not. (a <= 215000.0d0))) then
tmp = x + y
else
tmp = x + (z * (y / 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 <= -1.5e+136) || !(a <= 215000.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.5e+136) or not (a <= 215000.0): tmp = x + y else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.5e+136) || !(a <= 215000.0)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.5e+136) || ~((a <= 215000.0))) tmp = x + y; else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.5e+136], N[Not[LessEqual[a, 215000.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+136} \lor \neg \left(a \leq 215000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if a < -1.49999999999999989e136 or 215000 < a Initial program 77.8%
Taylor expanded in a around inf 86.1%
+-commutative86.1%
Simplified86.1%
if -1.49999999999999989e136 < a < 215000Initial program 77.2%
sub-neg77.2%
+-commutative77.2%
distribute-frac-neg77.2%
distribute-rgt-neg-out77.2%
associate-/l*80.9%
fma-define80.9%
distribute-frac-neg80.9%
distribute-neg-frac280.9%
sub-neg80.9%
distribute-neg-in80.9%
remove-double-neg80.9%
+-commutative80.9%
sub-neg80.9%
Simplified80.9%
Taylor expanded in t around inf 70.9%
associate-+r+77.2%
distribute-rgt1-in77.2%
metadata-eval77.2%
mul0-lft77.2%
associate-+r+77.2%
associate-/l*79.2%
associate-/l*77.8%
Simplified77.8%
Taylor expanded in a around 0 75.8%
*-commutative29.6%
associate-/l*31.0%
Applied egg-rr78.3%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.15e+194) (not (<= z 3e+195))) (* y (/ z t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.15e+194) || !(z <= 3e+195)) {
tmp = y * (z / t);
} 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.15d+194)) .or. (.not. (z <= 3d+195))) then
tmp = y * (z / t)
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.15e+194) || !(z <= 3e+195)) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.15e+194) or not (z <= 3e+195): tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.15e+194) || !(z <= 3e+195)) tmp = Float64(y * Float64(z / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.15e+194) || ~((z <= 3e+195))) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.15e+194], N[Not[LessEqual[z, 3e+195]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+194} \lor \neg \left(z \leq 3 \cdot 10^{+195}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.15000000000000003e194 or 3.0000000000000001e195 < z Initial program 73.3%
sub-neg73.3%
+-commutative73.3%
distribute-frac-neg73.3%
distribute-rgt-neg-out73.3%
associate-/l*94.9%
fma-define95.3%
distribute-frac-neg95.3%
distribute-neg-frac295.3%
sub-neg95.3%
distribute-neg-in95.3%
remove-double-neg95.3%
+-commutative95.3%
sub-neg95.3%
Simplified95.3%
Taylor expanded in z around inf 56.5%
associate-/l*68.2%
Simplified68.2%
Taylor expanded in t around inf 48.4%
associate-*r/57.2%
Simplified57.2%
if -1.15000000000000003e194 < z < 3.0000000000000001e195Initial program 78.2%
Taylor expanded in a around inf 69.2%
+-commutative69.2%
Simplified69.2%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e+192) (* y (/ z t)) (if (<= z 2.25e+195) (+ x y) (* z (/ y t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+192) {
tmp = y * (z / t);
} else if (z <= 2.25e+195) {
tmp = x + y;
} else {
tmp = z * (y / 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 (z <= (-1.5d+192)) then
tmp = y * (z / t)
else if (z <= 2.25d+195) then
tmp = x + y
else
tmp = z * (y / t)
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.5e+192) {
tmp = y * (z / t);
} else if (z <= 2.25e+195) {
tmp = x + y;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e+192: tmp = y * (z / t) elif z <= 2.25e+195: tmp = x + y else: tmp = z * (y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+192) tmp = Float64(y * Float64(z / t)); elseif (z <= 2.25e+195) tmp = Float64(x + y); else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.5e+192) tmp = y * (z / t); elseif (z <= 2.25e+195) tmp = x + y; else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+192], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e+195], N[(x + y), $MachinePrecision], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+192}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+195}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -1.5e192Initial program 76.2%
sub-neg76.2%
+-commutative76.2%
distribute-frac-neg76.2%
distribute-rgt-neg-out76.2%
associate-/l*95.0%
fma-define95.1%
distribute-frac-neg95.1%
distribute-neg-frac295.1%
sub-neg95.1%
distribute-neg-in95.1%
remove-double-neg95.1%
+-commutative95.1%
sub-neg95.1%
Simplified95.1%
Taylor expanded in z around inf 58.0%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in t around inf 42.8%
associate-*r/51.3%
Simplified51.3%
if -1.5e192 < z < 2.25000000000000005e195Initial program 78.2%
Taylor expanded in a around inf 69.2%
+-commutative69.2%
Simplified69.2%
if 2.25000000000000005e195 < z Initial program 70.3%
sub-neg70.3%
+-commutative70.3%
distribute-frac-neg70.3%
distribute-rgt-neg-out70.3%
associate-/l*94.8%
fma-define95.6%
distribute-frac-neg95.6%
distribute-neg-frac295.6%
sub-neg95.6%
distribute-neg-in95.6%
remove-double-neg95.6%
+-commutative95.6%
sub-neg95.6%
Simplified95.6%
Taylor expanded in z around inf 55.0%
associate-/l*69.5%
Simplified69.5%
Taylor expanded in t around inf 54.3%
*-commutative54.3%
associate-/l*63.6%
Applied egg-rr63.6%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.85e-144) x (if (<= x 5.7e-149) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.85e-144) {
tmp = x;
} else if (x <= 5.7e-149) {
tmp = 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 (x <= (-1.85d-144)) then
tmp = x
else if (x <= 5.7d-149) then
tmp = 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 (x <= -1.85e-144) {
tmp = x;
} else if (x <= 5.7e-149) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.85e-144: tmp = x elif x <= 5.7e-149: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.85e-144) tmp = x; elseif (x <= 5.7e-149) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.85e-144) tmp = x; elseif (x <= 5.7e-149) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.85e-144], x, If[LessEqual[x, 5.7e-149], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{-144}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.7 \cdot 10^{-149}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.8500000000000001e-144 or 5.6999999999999999e-149 < x Initial program 81.4%
Taylor expanded in x around inf 66.1%
if -1.8500000000000001e-144 < x < 5.6999999999999999e-149Initial program 66.1%
Taylor expanded in x around 0 63.5%
sub-neg63.5%
*-rgt-identity63.5%
associate-*r/73.6%
distribute-rgt-neg-in73.6%
mul-1-neg73.6%
distribute-lft-in73.7%
mul-1-neg73.7%
unsub-neg73.7%
Simplified73.7%
Taylor expanded in a around inf 34.1%
Final simplification57.8%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 77.5%
Taylor expanded in a around inf 62.9%
+-commutative62.9%
Simplified62.9%
Final simplification62.9%
(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 77.5%
Taylor expanded in x around inf 51.5%
Final simplification51.5%
(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 2024073
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))