
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a)))) (if (<= t_1 1e+136) (+ x (* t_1 y)) (+ x (/ (- z t) (/ (- z a) y))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e+136) {
tmp = x + (t_1 * y);
} else {
tmp = x + ((z - t) / ((z - a) / 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= 1d+136) then
tmp = x + (t_1 * y)
else
tmp = x + ((z - t) / ((z - a) / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e+136) {
tmp = x + (t_1 * y);
} else {
tmp = x + ((z - t) / ((z - a) / y));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= 1e+136: tmp = x + (t_1 * y) else: tmp = x + ((z - t) / ((z - a) / y)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e+136) tmp = Float64(x + Float64(t_1 * y)); else tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= 1e+136) tmp = x + (t_1 * y); else tmp = x + ((z - t) / ((z - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+136], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq 10^{+136}:\\
\;\;\;\;x + t_1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e136Initial program 99.4%
if 1.00000000000000006e136 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 81.0%
associate-*r/96.2%
associate-*l/99.8%
clear-num99.8%
associate-*l/99.9%
*-un-lft-identity99.9%
Applied egg-rr99.9%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a)))) (if (<= t_1 5e+158) (+ x (* t_1 y)) (- x (/ (* t y) (- z a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 5e+158) {
tmp = x + (t_1 * y);
} else {
tmp = x - ((t * 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= 5d+158) then
tmp = x + (t_1 * y)
else
tmp = x - ((t * y) / (z - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 5e+158) {
tmp = x + (t_1 * y);
} else {
tmp = x - ((t * y) / (z - a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= 5e+158: tmp = x + (t_1 * y) else: tmp = x - ((t * y) / (z - a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 5e+158) tmp = Float64(x + Float64(t_1 * y)); else tmp = Float64(x - Float64(Float64(t * y) / Float64(z - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= 5e+158) tmp = x + (t_1 * y); else tmp = x - ((t * y) / (z - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+158], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(t * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+158}:\\
\;\;\;\;x + t_1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t \cdot y}{z - a}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 4.9999999999999996e158Initial program 99.4%
if 4.9999999999999996e158 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 78.6%
Taylor expanded in t around inf 78.6%
neg-mul-178.6%
distribute-neg-frac78.6%
Simplified78.6%
Taylor expanded in x around 0 99.9%
mul-1-neg99.9%
*-commutative99.9%
associate-*r/78.6%
sub-neg78.6%
Simplified78.6%
associate-*r/99.9%
Applied egg-rr99.9%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z (- z a))))))
(if (<= z -4.2e-32)
t_1
(if (<= z 4e-250)
(- x (/ (* t y) (- z a)))
(if (<= z 1.1e-62)
(- x (/ y (/ a (- z t))))
(if (<= z 1.75e+58) (- x (* y (/ t (- z a)))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / (z - a)));
double tmp;
if (z <= -4.2e-32) {
tmp = t_1;
} else if (z <= 4e-250) {
tmp = x - ((t * y) / (z - a));
} else if (z <= 1.1e-62) {
tmp = x - (y / (a / (z - t)));
} else if (z <= 1.75e+58) {
tmp = x - (y * (t / (z - a)));
} 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 / (z - a)))
if (z <= (-4.2d-32)) then
tmp = t_1
else if (z <= 4d-250) then
tmp = x - ((t * y) / (z - a))
else if (z <= 1.1d-62) then
tmp = x - (y / (a / (z - t)))
else if (z <= 1.75d+58) then
tmp = x - (y * (t / (z - a)))
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 / (z - a)));
double tmp;
if (z <= -4.2e-32) {
tmp = t_1;
} else if (z <= 4e-250) {
tmp = x - ((t * y) / (z - a));
} else if (z <= 1.1e-62) {
tmp = x - (y / (a / (z - t)));
} else if (z <= 1.75e+58) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / (z - a))) tmp = 0 if z <= -4.2e-32: tmp = t_1 elif z <= 4e-250: tmp = x - ((t * y) / (z - a)) elif z <= 1.1e-62: tmp = x - (y / (a / (z - t))) elif z <= 1.75e+58: tmp = x - (y * (t / (z - a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / Float64(z - a)))) tmp = 0.0 if (z <= -4.2e-32) tmp = t_1; elseif (z <= 4e-250) tmp = Float64(x - Float64(Float64(t * y) / Float64(z - a))); elseif (z <= 1.1e-62) tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); elseif (z <= 1.75e+58) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / (z - a))); tmp = 0.0; if (z <= -4.2e-32) tmp = t_1; elseif (z <= 4e-250) tmp = x - ((t * y) / (z - a)); elseif (z <= 1.1e-62) tmp = x - (y / (a / (z - t))); elseif (z <= 1.75e+58) tmp = x - (y * (t / (z - a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-32], t$95$1, If[LessEqual[z, 4e-250], N[(x - N[(N[(t * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-62], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+58], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-250}:\\
\;\;\;\;x - \frac{t \cdot y}{z - a}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-62}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+58}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.1999999999999998e-32 or 1.7499999999999999e58 < z Initial program 99.9%
Taylor expanded in t around 0 86.9%
if -4.1999999999999998e-32 < z < 4.0000000000000002e-250Initial program 94.6%
Taylor expanded in t around inf 94.6%
neg-mul-194.6%
distribute-neg-frac94.6%
Simplified94.6%
Taylor expanded in x around 0 98.6%
mul-1-neg98.6%
*-commutative98.6%
associate-*r/94.6%
sub-neg94.6%
Simplified94.6%
associate-*r/98.6%
Applied egg-rr98.6%
if 4.0000000000000002e-250 < z < 1.10000000000000009e-62Initial program 96.0%
Taylor expanded in a around inf 75.5%
mul-1-neg75.5%
unsub-neg75.5%
associate-/l*84.5%
Simplified84.5%
if 1.10000000000000009e-62 < z < 1.7499999999999999e58Initial program 100.0%
Taylor expanded in t around inf 95.9%
neg-mul-195.9%
distribute-neg-frac95.9%
Simplified95.9%
Taylor expanded in x around 0 87.5%
mul-1-neg87.5%
*-commutative87.5%
associate-*r/95.9%
sub-neg95.9%
Simplified95.9%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e-77) (not (<= z 1.6e-76))) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e-77) || !(z <= 1.6e-76)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / (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 ((z <= (-9d-77)) .or. (.not. (z <= 1.6d-76))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y / (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 ((z <= -9e-77) || !(z <= 1.6e-76)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e-77) or not (z <= 1.6e-76): tmp = x + (y * (z / (z - a))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e-77) || !(z <= 1.6e-76)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9e-77) || ~((z <= 1.6e-76))) tmp = x + (y * (z / (z - a))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e-77], N[Not[LessEqual[z, 1.6e-76]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-77} \lor \neg \left(z \leq 1.6 \cdot 10^{-76}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -9.0000000000000001e-77 or 1.5999999999999999e-76 < z Initial program 99.9%
Taylor expanded in t around 0 83.5%
if -9.0000000000000001e-77 < z < 1.5999999999999999e-76Initial program 94.7%
Taylor expanded in z around 0 78.4%
+-commutative78.4%
associate-/l*80.2%
Simplified80.2%
associate-/r/80.7%
Applied egg-rr80.7%
*-commutative80.7%
clear-num80.7%
un-div-inv81.5%
Applied egg-rr81.5%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e+119) (not (<= z 8e+55))) (+ x (* y (/ z (- z a)))) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e+119) || !(z <= 8e+55)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (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 ((z <= (-3.3d+119)) .or. (.not. (z <= 8d+55))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x - (y * (t / (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 ((z <= -3.3e+119) || !(z <= 8e+55)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e+119) or not (z <= 8e+55): tmp = x + (y * (z / (z - a))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e+119) || !(z <= 8e+55)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.3e+119) || ~((z <= 8e+55))) tmp = x + (y * (z / (z - a))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e+119], N[Not[LessEqual[z, 8e+55]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+119} \lor \neg \left(z \leq 8 \cdot 10^{+55}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -3.3000000000000002e119 or 8.00000000000000008e55 < z Initial program 99.9%
Taylor expanded in t around 0 91.1%
if -3.3000000000000002e119 < z < 8.00000000000000008e55Initial program 96.7%
Taylor expanded in t around inf 87.9%
neg-mul-187.9%
distribute-neg-frac87.9%
Simplified87.9%
Taylor expanded in x around 0 84.8%
mul-1-neg84.8%
*-commutative84.8%
associate-*r/87.9%
sub-neg87.9%
Simplified87.9%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -8.6e+84) (+ x y) (if (<= z 3.3e+65) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.6e+84) {
tmp = x + y;
} else if (z <= 3.3e+65) {
tmp = x + (y * (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 <= (-8.6d+84)) then
tmp = x + y
else if (z <= 3.3d+65) then
tmp = x + (y * (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 <= -8.6e+84) {
tmp = x + y;
} else if (z <= 3.3e+65) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8.6e+84: tmp = x + y elif z <= 3.3e+65: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.6e+84) tmp = Float64(x + y); elseif (z <= 3.3e+65) tmp = Float64(x + Float64(y * 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 <= -8.6e+84) tmp = x + y; elseif (z <= 3.3e+65) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.6e+84], N[(x + y), $MachinePrecision], If[LessEqual[z, 3.3e+65], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+84}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+65}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -8.5999999999999992e84 or 3.30000000000000023e65 < z Initial program 99.9%
Taylor expanded in z around inf 76.8%
+-commutative76.8%
Simplified76.8%
if -8.5999999999999992e84 < z < 3.30000000000000023e65Initial program 96.6%
Taylor expanded in z around 0 76.1%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.5e+85) (+ x y) (if (<= z 2.4e+67) (+ x (/ y (/ a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+85) {
tmp = x + y;
} else if (z <= 2.4e+67) {
tmp = x + (y / (a / 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.5d+85)) then
tmp = x + y
else if (z <= 2.4d+67) then
tmp = x + (y / (a / 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.5e+85) {
tmp = x + y;
} else if (z <= 2.4e+67) {
tmp = x + (y / (a / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e+85: tmp = x + y elif z <= 2.4e+67: tmp = x + (y / (a / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+85) tmp = Float64(x + y); elseif (z <= 2.4e+67) tmp = Float64(x + Float64(y / Float64(a / 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.5e+85) tmp = x + y; elseif (z <= 2.4e+67) tmp = x + (y / (a / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+85], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.4e+67], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+85}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+67}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.5e85 or 2.40000000000000002e67 < z Initial program 99.9%
Taylor expanded in z around inf 76.8%
+-commutative76.8%
Simplified76.8%
if -1.5e85 < z < 2.40000000000000002e67Initial program 96.6%
Taylor expanded in z around 0 72.4%
+-commutative72.4%
associate-/l*75.7%
Simplified75.7%
associate-/r/76.1%
Applied egg-rr76.1%
*-commutative76.1%
clear-num76.1%
un-div-inv76.6%
Applied egg-rr76.6%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.6e+23) (+ x y) (if (<= z 2.35e+67) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e+23) {
tmp = x + y;
} else if (z <= 2.35e+67) {
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 (z <= (-1.6d+23)) then
tmp = x + y
else if (z <= 2.35d+67) 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 (z <= -1.6e+23) {
tmp = x + y;
} else if (z <= 2.35e+67) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.6e+23: tmp = x + y elif z <= 2.35e+67: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e+23) tmp = Float64(x + y); elseif (z <= 2.35e+67) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.6e+23) tmp = x + y; elseif (z <= 2.35e+67) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+23], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.35e+67], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+23}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+67}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.6e23 or 2.35000000000000009e67 < z Initial program 99.9%
Taylor expanded in z around inf 73.6%
+-commutative73.6%
Simplified73.6%
if -1.6e23 < z < 2.35000000000000009e67Initial program 96.4%
Taylor expanded in x around inf 55.3%
Final simplification62.0%
(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 97.6%
Taylor expanded in x around inf 52.6%
Final simplification52.6%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - 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 - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023293
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))