
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (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)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (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)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- a t)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * 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 + (((z - t) / (a - t)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (a - t)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(a - t)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (a - t)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{a - t} \cdot y
\end{array}
Initial program 87.1%
associate-/l*97.7%
Simplified97.7%
clear-num97.6%
associate-/r/97.6%
clear-num98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.5e+91)
(+ x y)
(if (<= t 3.9e-54)
(+ x (* z (/ y a)))
(if (<= t 22000000.0)
(* (/ (- z t) (- a t)) y)
(if (<= t 4.9e+35) (- x (/ t (/ a y))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.5e+91) {
tmp = x + y;
} else if (t <= 3.9e-54) {
tmp = x + (z * (y / a));
} else if (t <= 22000000.0) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 4.9e+35) {
tmp = x - (t / (a / y));
} 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 <= (-7.5d+91)) then
tmp = x + y
else if (t <= 3.9d-54) then
tmp = x + (z * (y / a))
else if (t <= 22000000.0d0) then
tmp = ((z - t) / (a - t)) * y
else if (t <= 4.9d+35) then
tmp = x - (t / (a / y))
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 <= -7.5e+91) {
tmp = x + y;
} else if (t <= 3.9e-54) {
tmp = x + (z * (y / a));
} else if (t <= 22000000.0) {
tmp = ((z - t) / (a - t)) * y;
} else if (t <= 4.9e+35) {
tmp = x - (t / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.5e+91: tmp = x + y elif t <= 3.9e-54: tmp = x + (z * (y / a)) elif t <= 22000000.0: tmp = ((z - t) / (a - t)) * y elif t <= 4.9e+35: tmp = x - (t / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.5e+91) tmp = Float64(x + y); elseif (t <= 3.9e-54) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= 22000000.0) tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y); elseif (t <= 4.9e+35) tmp = Float64(x - Float64(t / Float64(a / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.5e+91) tmp = x + y; elseif (t <= 3.9e-54) tmp = x + (z * (y / a)); elseif (t <= 22000000.0) tmp = ((z - t) / (a - t)) * y; elseif (t <= 4.9e+35) tmp = x - (t / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.5e+91], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.9e-54], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 22000000.0], N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 4.9e+35], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+91}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{-54}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 22000000:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{+35}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.50000000000000033e91 or 4.90000000000000025e35 < t Initial program 69.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -7.50000000000000033e91 < t < 3.9e-54Initial program 97.2%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in t around 0 77.8%
+-commutative77.8%
associate-/l*77.4%
Simplified77.4%
associate-/r/80.1%
Applied egg-rr80.1%
if 3.9e-54 < t < 2.2e7Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
clear-num99.6%
associate-/r/99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 83.5%
div-sub83.5%
Simplified83.5%
if 2.2e7 < t < 4.90000000000000025e35Initial program 87.1%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around inf 76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in z around 0 85.7%
mul-1-neg85.7%
unsub-neg85.7%
associate-/l*85.7%
Simplified85.7%
Final simplification82.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+118) (not (<= t 6e+18))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+118) || !(t <= 6e+18)) {
tmp = x + y;
} else {
tmp = x + (z * (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 ((t <= (-1.05d+118)) .or. (.not. (t <= 6d+18))) then
tmp = x + y
else
tmp = x + (z * (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 ((t <= -1.05e+118) || !(t <= 6e+18)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+118) or not (t <= 6e+18): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+118) || !(t <= 6e+18)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+118) || ~((t <= 6e+18))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+118], N[Not[LessEqual[t, 6e+18]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+118} \lor \neg \left(t \leq 6 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.05e118 or 6e18 < t Initial program 68.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 86.6%
+-commutative86.6%
Simplified86.6%
if -1.05e118 < t < 6e18Initial program 97.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 88.0%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.1e+118) (not (<= t 4.25e-19))) (- x (/ y (/ t (- z t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.1e+118) || !(t <= 4.25e-19)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (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 ((t <= (-1.1d+118)) .or. (.not. (t <= 4.25d-19))) then
tmp = x - (y / (t / (z - t)))
else
tmp = x + (z * (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 ((t <= -1.1e+118) || !(t <= 4.25e-19)) {
tmp = x - (y / (t / (z - t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.1e+118) or not (t <= 4.25e-19): tmp = x - (y / (t / (z - t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.1e+118) || !(t <= 4.25e-19)) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.1e+118) || ~((t <= 4.25e-19))) tmp = x - (y / (t / (z - t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.1e+118], N[Not[LessEqual[t, 4.25e-19]], $MachinePrecision]], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+118} \lor \neg \left(t \leq 4.25 \cdot 10^{-19}\right):\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.09999999999999993e118 or 4.25000000000000002e-19 < t Initial program 72.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 63.9%
mul-1-neg63.9%
unsub-neg63.9%
associate-/l*89.0%
Simplified89.0%
if -1.09999999999999993e118 < t < 4.25000000000000002e-19Initial program 97.3%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 89.6%
associate-*l/92.2%
*-commutative92.2%
Simplified92.2%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.5e+112) x (if (<= a -1.9e+77) (* y (/ z a)) (if (<= a 1.9e+118) (+ x y) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+112) {
tmp = x;
} else if (a <= -1.9e+77) {
tmp = y * (z / a);
} else if (a <= 1.9e+118) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-9.5d+112)) then
tmp = x
else if (a <= (-1.9d+77)) then
tmp = y * (z / a)
else if (a <= 1.9d+118) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.5e+112) {
tmp = x;
} else if (a <= -1.9e+77) {
tmp = y * (z / a);
} else if (a <= 1.9e+118) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.5e+112: tmp = x elif a <= -1.9e+77: tmp = y * (z / a) elif a <= 1.9e+118: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.5e+112) tmp = x; elseif (a <= -1.9e+77) tmp = Float64(y * Float64(z / a)); elseif (a <= 1.9e+118) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.5e+112) tmp = x; elseif (a <= -1.9e+77) tmp = y * (z / a); elseif (a <= 1.9e+118) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+112], x, If[LessEqual[a, -1.9e+77], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.9e+118], N[(x + y), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+112}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{+77}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{+118}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.5000000000000008e112 or 1.90000000000000008e118 < a Initial program 84.2%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in x around inf 69.5%
if -9.5000000000000008e112 < a < -1.9000000000000001e77Initial program 99.3%
associate-/l*99.6%
Simplified99.6%
clear-num99.8%
associate-/r/99.6%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in t around 0 85.5%
if -1.9000000000000001e77 < a < 1.90000000000000008e118Initial program 87.7%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around inf 63.9%
+-commutative63.9%
Simplified63.9%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e+219) (not (<= z 2.1e+83))) (* y (/ z (- a t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+219) || !(z <= 2.1e+83)) {
tmp = y * (z / (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 <= (-4d+219)) .or. (.not. (z <= 2.1d+83))) then
tmp = y * (z / (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 <= -4e+219) || !(z <= 2.1e+83)) {
tmp = y * (z / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e+219) or not (z <= 2.1e+83): tmp = y * (z / (a - t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e+219) || !(z <= 2.1e+83)) tmp = Float64(y * Float64(z / 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 <= -4e+219) || ~((z <= 2.1e+83))) tmp = y * (z / (a - t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+219], N[Not[LessEqual[z, 2.1e+83]], $MachinePrecision]], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+219} \lor \neg \left(z \leq 2.1 \cdot 10^{+83}\right):\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.99999999999999986e219 or 2.10000000000000002e83 < z Initial program 91.7%
associate-/l*91.6%
Simplified91.6%
clear-num91.6%
associate-/r/91.6%
clear-num91.6%
Applied egg-rr91.6%
Taylor expanded in y around inf 70.8%
div-sub70.8%
Simplified70.8%
Taylor expanded in z around inf 65.9%
if -3.99999999999999986e219 < z < 2.10000000000000002e83Initial program 85.7%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in t around inf 68.9%
+-commutative68.9%
Simplified68.9%
Final simplification68.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.5e+91) (not (<= t 3.8e+18))) (+ x y) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e+91) || !(t <= 3.8e+18)) {
tmp = x + y;
} else {
tmp = x + ((z * y) / 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 <= (-7.5d+91)) .or. (.not. (t <= 3.8d+18))) then
tmp = x + y
else
tmp = x + ((z * y) / 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 <= -7.5e+91) || !(t <= 3.8e+18)) {
tmp = x + y;
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.5e+91) or not (t <= 3.8e+18): tmp = x + y else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.5e+91) || !(t <= 3.8e+18)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.5e+91) || ~((t <= 3.8e+18))) tmp = x + y; else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.5e+91], N[Not[LessEqual[t, 3.8e+18]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{+91} \lor \neg \left(t \leq 3.8 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -7.50000000000000033e91 or 3.8e18 < t Initial program 69.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -7.50000000000000033e91 < t < 3.8e18Initial program 97.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in t around 0 76.3%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e+93) (not (<= t 3.9e+18))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e+93) || !(t <= 3.9e+18)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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.45d+93)) .or. (.not. (t <= 3.9d+18))) then
tmp = x + y
else
tmp = x + (z * (y / 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.45e+93) || !(t <= 3.9e+18)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e+93) or not (t <= 3.9e+18): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e+93) || !(t <= 3.9e+18)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.45e+93) || ~((t <= 3.9e+18))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e+93], N[Not[LessEqual[t, 3.9e+18]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+93} \lor \neg \left(t \leq 3.9 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.4499999999999999e93 or 3.9e18 < t Initial program 69.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -1.4499999999999999e93 < t < 3.9e18Initial program 97.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in t around 0 76.3%
+-commutative76.3%
associate-/l*75.9%
Simplified75.9%
associate-/r/77.8%
Applied egg-rr77.8%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -7e+219) (* (/ z t) (- y)) (if (<= z 2.8e+138) (+ x y) (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+219) {
tmp = (z / t) * -y;
} else if (z <= 2.8e+138) {
tmp = x + y;
} else {
tmp = (z * y) / 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 <= (-7d+219)) then
tmp = (z / t) * -y
else if (z <= 2.8d+138) then
tmp = x + y
else
tmp = (z * y) / 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 <= -7e+219) {
tmp = (z / t) * -y;
} else if (z <= 2.8e+138) {
tmp = x + y;
} else {
tmp = (z * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7e+219: tmp = (z / t) * -y elif z <= 2.8e+138: tmp = x + y else: tmp = (z * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+219) tmp = Float64(Float64(z / t) * Float64(-y)); elseif (z <= 2.8e+138) tmp = Float64(x + y); else tmp = Float64(Float64(z * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7e+219) tmp = (z / t) * -y; elseif (z <= 2.8e+138) tmp = x + y; else tmp = (z * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+219], N[(N[(z / t), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[z, 2.8e+138], N[(x + y), $MachinePrecision], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+219}:\\
\;\;\;\;\frac{z}{t} \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+138}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\end{array}
\end{array}
if z < -7.0000000000000002e219Initial program 89.5%
associate-/l*89.4%
Simplified89.4%
clear-num89.3%
associate-/r/89.4%
clear-num89.4%
Applied egg-rr89.4%
Taylor expanded in y around inf 72.7%
div-sub72.7%
Simplified72.7%
Taylor expanded in a around 0 61.8%
associate-*r/61.8%
neg-mul-161.8%
Simplified61.8%
Taylor expanded in z around inf 56.6%
associate-*r/56.6%
neg-mul-156.6%
Simplified56.6%
if -7.0000000000000002e219 < z < 2.8000000000000001e138Initial program 86.4%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in t around inf 67.6%
+-commutative67.6%
Simplified67.6%
if 2.8000000000000001e138 < z Initial program 90.3%
associate-/l*90.1%
Simplified90.1%
clear-num90.1%
associate-/r/90.1%
clear-num90.1%
Applied egg-rr90.1%
Taylor expanded in y around inf 72.9%
div-sub72.9%
Simplified72.9%
Taylor expanded in t around 0 45.5%
*-commutative45.5%
associate-*l/53.9%
Applied egg-rr53.9%
Final simplification65.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -2e+25) x (if (<= a 1e+118) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+25) {
tmp = x;
} else if (a <= 1e+118) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2d+25)) then
tmp = x
else if (a <= 1d+118) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+25) {
tmp = x;
} else if (a <= 1e+118) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2e+25: tmp = x elif a <= 1e+118: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+25) tmp = x; elseif (a <= 1e+118) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2e+25) tmp = x; elseif (a <= 1e+118) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+25], x, If[LessEqual[a, 1e+118], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 10^{+118}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.00000000000000018e25 or 9.99999999999999967e117 < a Initial program 86.3%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around inf 65.5%
if -2.00000000000000018e25 < a < 9.99999999999999967e117Initial program 87.5%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in t around inf 63.3%
+-commutative63.3%
Simplified63.3%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -9.2e+100) y (if (<= y 1e+150) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.2e+100) {
tmp = y;
} else if (y <= 1e+150) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-9.2d+100)) then
tmp = y
else if (y <= 1d+150) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.2e+100) {
tmp = y;
} else if (y <= 1e+150) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -9.2e+100: tmp = y elif y <= 1e+150: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -9.2e+100) tmp = y; elseif (y <= 1e+150) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -9.2e+100) tmp = y; elseif (y <= 1e+150) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -9.2e+100], y, If[LessEqual[y, 1e+150], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{+100}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 10^{+150}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -9.1999999999999996e100 or 9.99999999999999981e149 < y Initial program 67.6%
associate-/l*98.6%
Simplified98.6%
clear-num98.5%
associate-/r/98.6%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 85.5%
div-sub85.5%
Simplified85.5%
Taylor expanded in t around inf 34.9%
if -9.1999999999999996e100 < y < 9.99999999999999981e149Initial program 95.6%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in x around inf 63.7%
Final simplification54.9%
(FPCore (x y z t a) :precision binary64 (if (<= z 6.5e+138) (+ x y) (/ (* z y) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 6.5e+138) {
tmp = x + y;
} else {
tmp = (z * y) / 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 <= 6.5d+138) then
tmp = x + y
else
tmp = (z * y) / 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 <= 6.5e+138) {
tmp = x + y;
} else {
tmp = (z * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 6.5e+138: tmp = x + y else: tmp = (z * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 6.5e+138) tmp = Float64(x + y); else tmp = Float64(Float64(z * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 6.5e+138) tmp = x + y; else tmp = (z * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 6.5e+138], N[(x + y), $MachinePrecision], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.5 \cdot 10^{+138}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\end{array}
\end{array}
if z < 6.50000000000000054e138Initial program 86.6%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in t around inf 64.2%
+-commutative64.2%
Simplified64.2%
if 6.50000000000000054e138 < z Initial program 90.3%
associate-/l*90.1%
Simplified90.1%
clear-num90.1%
associate-/r/90.1%
clear-num90.1%
Applied egg-rr90.1%
Taylor expanded in y around inf 72.9%
div-sub72.9%
Simplified72.9%
Taylor expanded in t around 0 45.5%
*-commutative45.5%
associate-*l/53.9%
Applied egg-rr53.9%
Final simplification63.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 87.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around inf 48.9%
Final simplification48.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024019
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))