
(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 16 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 (<= t -9e+98)
(+ (- x (* a (/ y t))) (* y (/ z t)))
(if (<= t 1.75e+105)
(fma (- z t) (/ y (- t a)) (+ x y))
(+ x (* y (- (/ z t) (/ a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+98) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else if (t <= 1.75e+105) {
tmp = fma((z - t), (y / (t - a)), (x + y));
} else {
tmp = x + (y * ((z / t) - (a / t)));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9e+98) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); elseif (t <= 1.75e+105) tmp = fma(Float64(z - t), Float64(y / Float64(t - a)), Float64(x + y)); else tmp = Float64(x + Float64(y * Float64(Float64(z / t) - Float64(a / t)))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+98], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+105], N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z / t), $MachinePrecision] - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+98}:\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+105}:\\
\;\;\;\;\mathsf{fma}\left(z - t, \frac{y}{t - a}, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\
\end{array}
\end{array}
if t < -9.0000000000000004e98Initial program 41.0%
Taylor expanded in t around inf 74.5%
sub-neg74.5%
mul-1-neg74.5%
unsub-neg74.5%
associate-/l*74.8%
mul-1-neg74.8%
remove-double-neg74.8%
associate-/l*85.5%
Simplified85.5%
if -9.0000000000000004e98 < t < 1.74999999999999996e105Initial program 90.0%
sub-neg90.0%
+-commutative90.0%
distribute-frac-neg90.0%
distribute-rgt-neg-out90.0%
associate-/l*90.8%
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%
if 1.74999999999999996e105 < t Initial program 65.9%
Taylor expanded in t around -inf 76.7%
mul-1-neg76.7%
unsub-neg76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y around 0 95.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z a) t)))))
(if (<= t -1.8e-39)
t_1
(if (<= t 9e-106) (+ x y) (if (<= t 5.6e+71) (+ x (* y (/ z t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - a) / t));
double tmp;
if (t <= -1.8e-39) {
tmp = t_1;
} else if (t <= 9e-106) {
tmp = x + y;
} else if (t <= 5.6e+71) {
tmp = x + (y * (z / 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) :: tmp
t_1 = x + (y * ((z - a) / t))
if (t <= (-1.8d-39)) then
tmp = t_1
else if (t <= 9d-106) then
tmp = x + y
else if (t <= 5.6d+71) then
tmp = x + (y * (z / 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 = x + (y * ((z - a) / t));
double tmp;
if (t <= -1.8e-39) {
tmp = t_1;
} else if (t <= 9e-106) {
tmp = x + y;
} else if (t <= 5.6e+71) {
tmp = x + (y * (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - a) / t)) tmp = 0 if t <= -1.8e-39: tmp = t_1 elif t <= 9e-106: tmp = x + y elif t <= 5.6e+71: tmp = x + (y * (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - a) / t))) tmp = 0.0 if (t <= -1.8e-39) tmp = t_1; elseif (t <= 9e-106) tmp = Float64(x + y); elseif (t <= 5.6e+71) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - a) / t)); tmp = 0.0; if (t <= -1.8e-39) tmp = t_1; elseif (t <= 9e-106) tmp = x + y; elseif (t <= 5.6e+71) tmp = x + (y * (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.8e-39], t$95$1, If[LessEqual[t, 9e-106], N[(x + y), $MachinePrecision], If[LessEqual[t, 5.6e+71], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - a}{t}\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-106}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+71}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.8e-39 or 5.60000000000000004e71 < t Initial program 61.5%
Taylor expanded in t around -inf 75.3%
mul-1-neg75.3%
unsub-neg75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in y around 0 76.3%
associate-/l*85.7%
Simplified85.7%
if -1.8e-39 < t < 8.99999999999999911e-106Initial program 95.6%
sub-neg95.6%
+-commutative95.6%
distribute-frac-neg95.6%
distribute-rgt-neg-out95.6%
associate-/l*93.1%
fma-define93.1%
distribute-frac-neg93.1%
distribute-neg-frac293.1%
sub-neg93.1%
distribute-neg-in93.1%
remove-double-neg93.1%
+-commutative93.1%
sub-neg93.1%
Simplified93.1%
Taylor expanded in a around inf 69.5%
+-commutative69.5%
Simplified69.5%
if 8.99999999999999911e-106 < t < 5.60000000000000004e71Initial program 83.9%
Taylor expanded in t around -inf 69.5%
mul-1-neg69.5%
unsub-neg69.5%
*-commutative69.5%
Simplified69.5%
Taylor expanded in a around 0 87.9%
associate-/l*90.0%
Simplified90.0%
Final simplification80.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.8e+98)
(+ (- x (* a (/ y t))) (* y (/ z t)))
(if (<= t 2e+60)
(+ (+ x y) (/ (* y (- z t)) (- t a)))
(+ x (* y (/ (- z a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.8e+98) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else if (t <= 2e+60) {
tmp = (x + y) + ((y * (z - t)) / (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) :: tmp
if (t <= (-8.8d+98)) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else if (t <= 2d+60) then
tmp = (x + y) + ((y * (z - t)) / (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 tmp;
if (t <= -8.8e+98) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else if (t <= 2e+60) {
tmp = (x + y) + ((y * (z - t)) / (t - a));
} else {
tmp = x + (y * ((z - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.8e+98: tmp = (x - (a * (y / t))) + (y * (z / t)) elif t <= 2e+60: tmp = (x + y) + ((y * (z - t)) / (t - a)) else: tmp = x + (y * ((z - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.8e+98) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); elseif (t <= 2e+60) tmp = Float64(Float64(x + y) + Float64(Float64(y * Float64(z - t)) / Float64(t - a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.8e+98) tmp = (x - (a * (y / t))) + (y * (z / t)); elseif (t <= 2e+60) tmp = (x + y) + ((y * (z - t)) / (t - a)); else tmp = x + (y * ((z - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.8e+98], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+60], N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+98}:\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+60}:\\
\;\;\;\;\left(x + y\right) + \frac{y \cdot \left(z - t\right)}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if t < -8.80000000000000034e98Initial program 41.0%
Taylor expanded in t around inf 74.5%
sub-neg74.5%
mul-1-neg74.5%
unsub-neg74.5%
associate-/l*74.8%
mul-1-neg74.8%
remove-double-neg74.8%
associate-/l*85.5%
Simplified85.5%
if -8.80000000000000034e98 < t < 1.9999999999999999e60Initial program 90.8%
if 1.9999999999999999e60 < t Initial program 66.1%
Taylor expanded in t around -inf 75.6%
mul-1-neg75.6%
unsub-neg75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in y around 0 78.0%
associate-/l*92.4%
Simplified92.4%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.4e-38) (not (<= t 1.8e-93))) (+ x (* y (/ (- z a) t))) (- (+ x y) (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.4e-38) || !(t <= 1.8e-93)) {
tmp = x + (y * ((z - a) / t));
} 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 ((t <= (-1.4d-38)) .or. (.not. (t <= 1.8d-93))) then
tmp = x + (y * ((z - a) / t))
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 ((t <= -1.4e-38) || !(t <= 1.8e-93)) {
tmp = x + (y * ((z - a) / t));
} else {
tmp = (x + y) - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.4e-38) or not (t <= 1.8e-93): tmp = x + (y * ((z - a) / t)) else: tmp = (x + y) - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.4e-38) || !(t <= 1.8e-93)) tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); 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 ((t <= -1.4e-38) || ~((t <= 1.8e-93))) tmp = x + (y * ((z - a) / t)); else tmp = (x + y) - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.4e-38], N[Not[LessEqual[t, 1.8e-93]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-38} \lor \neg \left(t \leq 1.8 \cdot 10^{-93}\right):\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.4e-38 or 1.8000000000000001e-93 < t Initial program 66.2%
Taylor expanded in t around -inf 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y around 0 76.3%
associate-/l*84.0%
Simplified84.0%
if -1.4e-38 < t < 1.8000000000000001e-93Initial program 95.8%
Taylor expanded in t around 0 89.8%
associate-/l*87.8%
Simplified87.8%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.1e-37) (+ (- x (* a (/ y t))) (* y (/ z t))) (if (<= t 2.75e-93) (- (+ 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 (t <= -3.1e-37) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else if (t <= 2.75e-93) {
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 (t <= (-3.1d-37)) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else if (t <= 2.75d-93) 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 (t <= -3.1e-37) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else if (t <= 2.75e-93) {
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 t <= -3.1e-37: tmp = (x - (a * (y / t))) + (y * (z / t)) elif t <= 2.75e-93: 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 (t <= -3.1e-37) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); elseif (t <= 2.75e-93) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.1e-37) tmp = (x - (a * (y / t))) + (y * (z / t)); elseif (t <= 2.75e-93) 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[LessEqual[t, -3.1e-37], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.75e-93], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-37}:\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-93}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if t < -3.09999999999999993e-37Initial program 58.8%
Taylor expanded in t around inf 75.2%
sub-neg75.2%
mul-1-neg75.2%
unsub-neg75.2%
associate-/l*75.3%
mul-1-neg75.3%
remove-double-neg75.3%
associate-/l*81.8%
Simplified81.8%
if -3.09999999999999993e-37 < t < 2.74999999999999984e-93Initial program 95.8%
Taylor expanded in t around 0 89.8%
associate-/l*87.8%
Simplified87.8%
if 2.74999999999999984e-93 < t Initial program 73.0%
Taylor expanded in t around -inf 74.6%
mul-1-neg74.6%
unsub-neg74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in y around 0 77.2%
associate-/l*86.2%
Simplified86.2%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.3e-37) (+ x (* y (- (/ z t) (/ a t)))) (if (<= t 1.2e-94) (- (+ 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 (t <= -2.3e-37) {
tmp = x + (y * ((z / t) - (a / t)));
} else if (t <= 1.2e-94) {
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 (t <= (-2.3d-37)) then
tmp = x + (y * ((z / t) - (a / t)))
else if (t <= 1.2d-94) 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 (t <= -2.3e-37) {
tmp = x + (y * ((z / t) - (a / t)));
} else if (t <= 1.2e-94) {
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 t <= -2.3e-37: tmp = x + (y * ((z / t) - (a / t))) elif t <= 1.2e-94: 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 (t <= -2.3e-37) tmp = Float64(x + Float64(y * Float64(Float64(z / t) - Float64(a / t)))); elseif (t <= 1.2e-94) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.3e-37) tmp = x + (y * ((z / t) - (a / t))); elseif (t <= 1.2e-94) 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[LessEqual[t, -2.3e-37], N[(x + N[(y * N[(N[(z / t), $MachinePrecision] - N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-94], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-37}:\\
\;\;\;\;x + y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-94}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - a}{t}\\
\end{array}
\end{array}
if t < -2.3e-37Initial program 58.8%
Taylor expanded in t around -inf 75.1%
mul-1-neg75.1%
unsub-neg75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in y around 0 81.7%
if -2.3e-37 < t < 1.2e-94Initial program 95.8%
Taylor expanded in t around 0 89.8%
associate-/l*87.8%
Simplified87.8%
if 1.2e-94 < t Initial program 73.0%
Taylor expanded in t around -inf 74.6%
mul-1-neg74.6%
unsub-neg74.6%
*-commutative74.6%
Simplified74.6%
Taylor expanded in y around 0 77.2%
associate-/l*86.2%
Simplified86.2%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.8e+83) (not (<= a 3.05e+90))) (+ x y) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.8e+83) || !(a <= 3.05e+90)) {
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 <= (-5.8d+83)) .or. (.not. (a <= 3.05d+90))) 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 <= -5.8e+83) || !(a <= 3.05e+90)) {
tmp = x + y;
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.8e+83) or not (a <= 3.05e+90): tmp = x + y else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.8e+83) || !(a <= 3.05e+90)) 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 <= -5.8e+83) || ~((a <= 3.05e+90))) tmp = x + y; else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.8e+83], N[Not[LessEqual[a, 3.05e+90]], $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 -5.8 \cdot 10^{+83} \lor \neg \left(a \leq 3.05 \cdot 10^{+90}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -5.79999999999999999e83 or 3.0499999999999998e90 < a Initial program 83.4%
sub-neg83.4%
+-commutative83.4%
distribute-frac-neg83.4%
distribute-rgt-neg-out83.4%
associate-/l*90.2%
fma-define90.2%
distribute-frac-neg90.2%
distribute-neg-frac290.2%
sub-neg90.2%
distribute-neg-in90.2%
remove-double-neg90.2%
+-commutative90.2%
sub-neg90.2%
Simplified90.2%
Taylor expanded in a around inf 83.1%
+-commutative83.1%
Simplified83.1%
if -5.79999999999999999e83 < a < 3.0499999999999998e90Initial program 74.0%
Taylor expanded in t around -inf 72.9%
mul-1-neg72.9%
unsub-neg72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in a around 0 71.5%
associate-/l*74.3%
Simplified74.3%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+232) (not (<= z 2e+83))) (* y (/ z (- t a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+232) || !(z <= 2e+83)) {
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.45d+232)) .or. (.not. (z <= 2d+83))) 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.45e+232) || !(z <= 2e+83)) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+232) or not (z <= 2e+83): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+232) || !(z <= 2e+83)) 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.45e+232) || ~((z <= 2e+83))) 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.45e+232], N[Not[LessEqual[z, 2e+83]], $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.45 \cdot 10^{+232} \lor \neg \left(z \leq 2 \cdot 10^{+83}\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.45000000000000012e232 or 2.00000000000000006e83 < z Initial program 83.3%
sub-neg83.3%
+-commutative83.3%
distribute-frac-neg83.3%
distribute-rgt-neg-out83.3%
associate-/l*89.8%
fma-define89.9%
distribute-frac-neg89.9%
distribute-neg-frac289.9%
sub-neg89.9%
distribute-neg-in89.9%
remove-double-neg89.9%
+-commutative89.9%
sub-neg89.9%
Simplified89.9%
Taylor expanded in z around inf 68.4%
associate-/l*73.7%
Simplified73.7%
if -1.45000000000000012e232 < z < 2.00000000000000006e83Initial program 75.9%
sub-neg75.9%
+-commutative75.9%
distribute-frac-neg75.9%
distribute-rgt-neg-out75.9%
associate-/l*77.9%
fma-define77.8%
distribute-frac-neg77.8%
distribute-neg-frac277.8%
sub-neg77.8%
distribute-neg-in77.8%
remove-double-neg77.8%
+-commutative77.8%
sub-neg77.8%
Simplified77.8%
Taylor expanded in a around inf 67.6%
+-commutative67.6%
Simplified67.6%
Final simplification68.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.08e+232) (* z (/ y (- t a))) (if (<= z 1.6e+83) (+ x y) (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.08e+232) {
tmp = z * (y / (t - a));
} else if (z <= 1.6e+83) {
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 <= (-1.08d+232)) then
tmp = z * (y / (t - a))
else if (z <= 1.6d+83) 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 <= -1.08e+232) {
tmp = z * (y / (t - a));
} else if (z <= 1.6e+83) {
tmp = x + y;
} else {
tmp = y * (z / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.08e+232: tmp = z * (y / (t - a)) elif z <= 1.6e+83: tmp = x + y else: tmp = y * (z / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.08e+232) tmp = Float64(z * Float64(y / Float64(t - a))); elseif (z <= 1.6e+83) 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 <= -1.08e+232) tmp = z * (y / (t - a)); elseif (z <= 1.6e+83) tmp = x + y; else tmp = y * (z / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.08e+232], N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+83], N[(x + y), $MachinePrecision], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+232}:\\
\;\;\;\;z \cdot \frac{y}{t - a}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+83}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < -1.08e232Initial program 95.1%
sub-neg95.1%
+-commutative95.1%
distribute-frac-neg95.1%
distribute-rgt-neg-out95.1%
associate-/l*93.8%
fma-define93.7%
distribute-frac-neg93.7%
distribute-neg-frac293.7%
sub-neg93.7%
distribute-neg-in93.7%
remove-double-neg93.7%
+-commutative93.7%
sub-neg93.7%
Simplified93.7%
Taylor expanded in z around inf 85.6%
*-commutative85.6%
*-lft-identity85.6%
times-frac88.1%
/-rgt-identity88.1%
Simplified88.1%
if -1.08e232 < z < 1.5999999999999999e83Initial program 75.9%
sub-neg75.9%
+-commutative75.9%
distribute-frac-neg75.9%
distribute-rgt-neg-out75.9%
associate-/l*77.9%
fma-define77.8%
distribute-frac-neg77.8%
distribute-neg-frac277.8%
sub-neg77.8%
distribute-neg-in77.8%
remove-double-neg77.8%
+-commutative77.8%
sub-neg77.8%
Simplified77.8%
Taylor expanded in a around inf 67.6%
+-commutative67.6%
Simplified67.6%
if 1.5999999999999999e83 < z Initial program 76.0%
sub-neg76.0%
+-commutative76.0%
distribute-frac-neg76.0%
distribute-rgt-neg-out76.0%
associate-/l*87.3%
fma-define87.6%
distribute-frac-neg87.6%
distribute-neg-frac287.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
+-commutative87.6%
sub-neg87.6%
Simplified87.6%
Taylor expanded in z around inf 57.7%
associate-/l*72.1%
Simplified72.1%
Final simplification69.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.02e+232) (not (<= z 4.4e+142))) (* y (/ z t)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e+232) || !(z <= 4.4e+142)) {
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.02d+232)) .or. (.not. (z <= 4.4d+142))) 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.02e+232) || !(z <= 4.4e+142)) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.02e+232) or not (z <= 4.4e+142): tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.02e+232) || !(z <= 4.4e+142)) 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.02e+232) || ~((z <= 4.4e+142))) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.02e+232], N[Not[LessEqual[z, 4.4e+142]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+232} \lor \neg \left(z \leq 4.4 \cdot 10^{+142}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.0199999999999999e232 or 4.39999999999999974e142 < z Initial program 82.1%
sub-neg82.1%
+-commutative82.1%
distribute-frac-neg82.1%
distribute-rgt-neg-out82.1%
associate-/l*89.9%
fma-define90.0%
distribute-frac-neg90.0%
distribute-neg-frac290.0%
sub-neg90.0%
distribute-neg-in90.0%
remove-double-neg90.0%
+-commutative90.0%
sub-neg90.0%
Simplified90.0%
Taylor expanded in z around inf 73.4%
*-commutative73.4%
*-lft-identity73.4%
times-frac80.9%
/-rgt-identity80.9%
Simplified80.9%
Taylor expanded in t around inf 45.8%
associate-/l*52.1%
Simplified52.1%
if -1.0199999999999999e232 < z < 4.39999999999999974e142Initial program 76.5%
sub-neg76.5%
+-commutative76.5%
distribute-frac-neg76.5%
distribute-rgt-neg-out76.5%
associate-/l*78.4%
fma-define78.3%
distribute-frac-neg78.3%
distribute-neg-frac278.3%
sub-neg78.3%
distribute-neg-in78.3%
remove-double-neg78.3%
+-commutative78.3%
sub-neg78.3%
Simplified78.3%
Taylor expanded in a around inf 66.7%
+-commutative66.7%
Simplified66.7%
Final simplification64.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.2e+233) (/ (* y z) (- a)) (if (<= z 8e+142) (+ x y) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e+233) {
tmp = (y * z) / -a;
} else if (z <= 8e+142) {
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 (z <= (-7.2d+233)) then
tmp = (y * z) / -a
else if (z <= 8d+142) 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 (z <= -7.2e+233) {
tmp = (y * z) / -a;
} else if (z <= 8e+142) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.2e+233: tmp = (y * z) / -a elif z <= 8e+142: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e+233) tmp = Float64(Float64(y * z) / Float64(-a)); elseif (z <= 8e+142) 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 (z <= -7.2e+233) tmp = (y * z) / -a; elseif (z <= 8e+142) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e+233], N[(N[(y * z), $MachinePrecision] / (-a)), $MachinePrecision], If[LessEqual[z, 8e+142], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+233}:\\
\;\;\;\;\frac{y \cdot z}{-a}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+142}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -7.1999999999999996e233Initial program 94.9%
Taylor expanded in t around 0 73.8%
associate-/l*63.9%
Simplified63.9%
Taylor expanded in z around inf 63.8%
if -7.1999999999999996e233 < z < 8.00000000000000041e142Initial program 76.6%
sub-neg76.6%
+-commutative76.6%
distribute-frac-neg76.6%
distribute-rgt-neg-out76.6%
associate-/l*78.5%
fma-define78.4%
distribute-frac-neg78.4%
distribute-neg-frac278.4%
sub-neg78.4%
distribute-neg-in78.4%
remove-double-neg78.4%
+-commutative78.4%
sub-neg78.4%
Simplified78.4%
Taylor expanded in a around inf 66.4%
+-commutative66.4%
Simplified66.4%
if 8.00000000000000041e142 < z Initial program 70.7%
sub-neg70.7%
+-commutative70.7%
distribute-frac-neg70.7%
distribute-rgt-neg-out70.7%
associate-/l*86.5%
fma-define86.8%
distribute-frac-neg86.8%
distribute-neg-frac286.8%
sub-neg86.8%
distribute-neg-in86.8%
remove-double-neg86.8%
+-commutative86.8%
sub-neg86.8%
Simplified86.8%
Taylor expanded in z around inf 62.7%
*-commutative62.7%
*-lft-identity62.7%
times-frac74.6%
/-rgt-identity74.6%
Simplified74.6%
Taylor expanded in t around inf 45.8%
associate-/l*57.7%
Simplified57.7%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -5e+234) (* z (/ y (- a))) (if (<= z 1.2e+141) (+ x y) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+234) {
tmp = z * (y / -a);
} else if (z <= 1.2e+141) {
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 (z <= (-5d+234)) then
tmp = z * (y / -a)
else if (z <= 1.2d+141) 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 (z <= -5e+234) {
tmp = z * (y / -a);
} else if (z <= 1.2e+141) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e+234: tmp = z * (y / -a) elif z <= 1.2e+141: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+234) tmp = Float64(z * Float64(y / Float64(-a))); elseif (z <= 1.2e+141) 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 (z <= -5e+234) tmp = z * (y / -a); elseif (z <= 1.2e+141) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e+234], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+141], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+234}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+141}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -5.0000000000000003e234Initial program 94.9%
sub-neg94.9%
+-commutative94.9%
distribute-frac-neg94.9%
distribute-rgt-neg-out94.9%
associate-/l*93.6%
fma-define93.5%
distribute-frac-neg93.5%
distribute-neg-frac293.5%
sub-neg93.5%
distribute-neg-in93.5%
remove-double-neg93.5%
+-commutative93.5%
sub-neg93.5%
Simplified93.5%
Taylor expanded in z around inf 84.9%
*-commutative84.9%
*-lft-identity84.9%
times-frac87.6%
/-rgt-identity87.6%
Simplified87.6%
Taylor expanded in t around 0 61.5%
associate-*r/61.5%
neg-mul-161.5%
Simplified61.5%
if -5.0000000000000003e234 < z < 1.19999999999999999e141Initial program 76.6%
sub-neg76.6%
+-commutative76.6%
distribute-frac-neg76.6%
distribute-rgt-neg-out76.6%
associate-/l*78.5%
fma-define78.4%
distribute-frac-neg78.4%
distribute-neg-frac278.4%
sub-neg78.4%
distribute-neg-in78.4%
remove-double-neg78.4%
+-commutative78.4%
sub-neg78.4%
Simplified78.4%
Taylor expanded in a around inf 66.4%
+-commutative66.4%
Simplified66.4%
if 1.19999999999999999e141 < z Initial program 70.7%
sub-neg70.7%
+-commutative70.7%
distribute-frac-neg70.7%
distribute-rgt-neg-out70.7%
associate-/l*86.5%
fma-define86.8%
distribute-frac-neg86.8%
distribute-neg-frac286.8%
sub-neg86.8%
distribute-neg-in86.8%
remove-double-neg86.8%
+-commutative86.8%
sub-neg86.8%
Simplified86.8%
Taylor expanded in z around inf 62.7%
*-commutative62.7%
*-lft-identity62.7%
times-frac74.6%
/-rgt-identity74.6%
Simplified74.6%
Taylor expanded in t around inf 45.8%
associate-/l*57.7%
Simplified57.7%
Final simplification65.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.18e+232) (* (/ y t) z) (if (<= z 5.5e+139) (+ x y) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.18e+232) {
tmp = (y / t) * z;
} else if (z <= 5.5e+139) {
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 (z <= (-1.18d+232)) then
tmp = (y / t) * z
else if (z <= 5.5d+139) 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 (z <= -1.18e+232) {
tmp = (y / t) * z;
} else if (z <= 5.5e+139) {
tmp = x + y;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.18e+232: tmp = (y / t) * z elif z <= 5.5e+139: tmp = x + y else: tmp = y * (z / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.18e+232) tmp = Float64(Float64(y / t) * z); elseif (z <= 5.5e+139) 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 (z <= -1.18e+232) tmp = (y / t) * z; elseif (z <= 5.5e+139) tmp = x + y; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.18e+232], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 5.5e+139], N[(x + y), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{+232}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+139}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.18e232Initial program 95.1%
sub-neg95.1%
+-commutative95.1%
distribute-frac-neg95.1%
distribute-rgt-neg-out95.1%
associate-/l*93.8%
fma-define93.7%
distribute-frac-neg93.7%
distribute-neg-frac293.7%
sub-neg93.7%
distribute-neg-in93.7%
remove-double-neg93.7%
+-commutative93.7%
sub-neg93.7%
Simplified93.7%
Taylor expanded in z around inf 85.6%
*-commutative85.6%
*-lft-identity85.6%
times-frac88.1%
/-rgt-identity88.1%
Simplified88.1%
Taylor expanded in t around inf 50.3%
if -1.18e232 < z < 5.4999999999999996e139Initial program 76.5%
sub-neg76.5%
+-commutative76.5%
distribute-frac-neg76.5%
distribute-rgt-neg-out76.5%
associate-/l*78.4%
fma-define78.3%
distribute-frac-neg78.3%
distribute-neg-frac278.3%
sub-neg78.3%
distribute-neg-in78.3%
remove-double-neg78.3%
+-commutative78.3%
sub-neg78.3%
Simplified78.3%
Taylor expanded in a around inf 66.7%
+-commutative66.7%
Simplified66.7%
if 5.4999999999999996e139 < z Initial program 70.7%
sub-neg70.7%
+-commutative70.7%
distribute-frac-neg70.7%
distribute-rgt-neg-out70.7%
associate-/l*86.5%
fma-define86.8%
distribute-frac-neg86.8%
distribute-neg-frac286.8%
sub-neg86.8%
distribute-neg-in86.8%
remove-double-neg86.8%
+-commutative86.8%
sub-neg86.8%
Simplified86.8%
Taylor expanded in z around inf 62.7%
*-commutative62.7%
*-lft-identity62.7%
times-frac74.6%
/-rgt-identity74.6%
Simplified74.6%
Taylor expanded in t around inf 45.8%
associate-/l*57.7%
Simplified57.7%
Final simplification64.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -3.1e-156) x (if (<= x 7.5e-172) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -3.1e-156) {
tmp = x;
} else if (x <= 7.5e-172) {
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 <= (-3.1d-156)) then
tmp = x
else if (x <= 7.5d-172) 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 <= -3.1e-156) {
tmp = x;
} else if (x <= 7.5e-172) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -3.1e-156: tmp = x elif x <= 7.5e-172: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -3.1e-156) tmp = x; elseif (x <= 7.5e-172) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -3.1e-156) tmp = x; elseif (x <= 7.5e-172) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3.1e-156], x, If[LessEqual[x, 7.5e-172], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-156}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-172}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.0999999999999998e-156 or 7.4999999999999999e-172 < x Initial program 81.1%
sub-neg81.1%
+-commutative81.1%
distribute-frac-neg81.1%
distribute-rgt-neg-out81.1%
associate-/l*85.0%
fma-define84.9%
distribute-frac-neg84.9%
distribute-neg-frac284.9%
sub-neg84.9%
distribute-neg-in84.9%
remove-double-neg84.9%
+-commutative84.9%
sub-neg84.9%
Simplified84.9%
add-cube-cbrt83.4%
pow383.4%
Applied egg-rr83.4%
Taylor expanded in y around 0 61.7%
if -3.0999999999999998e-156 < x < 7.4999999999999999e-172Initial program 65.0%
sub-neg65.0%
+-commutative65.0%
distribute-frac-neg65.0%
distribute-rgt-neg-out65.0%
associate-/l*64.4%
fma-define64.2%
distribute-frac-neg64.2%
distribute-neg-frac264.2%
sub-neg64.2%
distribute-neg-in64.2%
remove-double-neg64.2%
+-commutative64.2%
sub-neg64.2%
Simplified64.2%
Taylor expanded in a around inf 34.5%
+-commutative34.5%
Simplified34.5%
Taylor expanded in y around inf 28.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.7e+86) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e+86) {
tmp = x;
} 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 (t <= (-4.7d+86)) then
tmp = x
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 (t <= -4.7e+86) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7e+86: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7e+86) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7e+86) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7e+86], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{+86}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.7000000000000002e86Initial program 45.7%
sub-neg45.7%
+-commutative45.7%
distribute-frac-neg45.7%
distribute-rgt-neg-out45.7%
associate-/l*51.8%
fma-define51.5%
distribute-frac-neg51.5%
distribute-neg-frac251.5%
sub-neg51.5%
distribute-neg-in51.5%
remove-double-neg51.5%
+-commutative51.5%
sub-neg51.5%
Simplified51.5%
add-cube-cbrt50.5%
pow350.5%
Applied egg-rr50.5%
Taylor expanded in y around 0 56.6%
if -4.7000000000000002e86 < t Initial program 85.1%
sub-neg85.1%
+-commutative85.1%
distribute-frac-neg85.1%
distribute-rgt-neg-out85.1%
associate-/l*87.3%
fma-define87.2%
distribute-frac-neg87.2%
distribute-neg-frac287.2%
sub-neg87.2%
distribute-neg-in87.2%
remove-double-neg87.2%
+-commutative87.2%
sub-neg87.2%
Simplified87.2%
Taylor expanded in a around inf 61.9%
+-commutative61.9%
Simplified61.9%
Final simplification60.8%
(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.4%
sub-neg77.4%
+-commutative77.4%
distribute-frac-neg77.4%
distribute-rgt-neg-out77.4%
associate-/l*80.3%
fma-define80.2%
distribute-frac-neg80.2%
distribute-neg-frac280.2%
sub-neg80.2%
distribute-neg-in80.2%
remove-double-neg80.2%
+-commutative80.2%
sub-neg80.2%
Simplified80.2%
add-cube-cbrt78.8%
pow378.9%
Applied egg-rr78.9%
Taylor expanded in y around 0 50.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 2024137
(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))))