
(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 12 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 (/ 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}
Initial program 88.8%
associate-/l*97.4%
Simplified97.4%
clear-num97.4%
un-div-inv97.9%
Applied egg-rr97.9%
Final simplification97.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.6e+142)
(+ x y)
(if (<= t -1.45e+40)
(+ x (* y (/ z (- a t))))
(if (or (<= t -1.9e-22) (not (<= t 2.6e+94)))
(+ x y)
(+ x (/ (* y z) (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.6e+142) {
tmp = x + y;
} else if (t <= -1.45e+40) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -1.9e-22) || !(t <= 2.6e+94)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-3.6d+142)) then
tmp = x + y
else if (t <= (-1.45d+40)) then
tmp = x + (y * (z / (a - t)))
else if ((t <= (-1.9d-22)) .or. (.not. (t <= 2.6d+94))) then
tmp = x + y
else
tmp = x + ((y * z) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.6e+142) {
tmp = x + y;
} else if (t <= -1.45e+40) {
tmp = x + (y * (z / (a - t)));
} else if ((t <= -1.9e-22) || !(t <= 2.6e+94)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.6e+142: tmp = x + y elif t <= -1.45e+40: tmp = x + (y * (z / (a - t))) elif (t <= -1.9e-22) or not (t <= 2.6e+94): tmp = x + y else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.6e+142) tmp = Float64(x + y); elseif (t <= -1.45e+40) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); elseif ((t <= -1.9e-22) || !(t <= 2.6e+94)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.6e+142) tmp = x + y; elseif (t <= -1.45e+40) tmp = x + (y * (z / (a - t))); elseif ((t <= -1.9e-22) || ~((t <= 2.6e+94))) tmp = x + y; else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.6e+142], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.45e+40], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.9e-22], N[Not[LessEqual[t, 2.6e+94]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+142}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{+40}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-22} \lor \neg \left(t \leq 2.6 \cdot 10^{+94}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -3.6000000000000001e142 or -1.45000000000000009e40 < t < -1.90000000000000012e-22 or 2.5999999999999999e94 < t Initial program 73.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 88.2%
+-commutative88.2%
Simplified88.2%
if -3.6000000000000001e142 < t < -1.45000000000000009e40Initial program 92.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 91.0%
associate-/l*94.9%
Simplified94.9%
if -1.90000000000000012e-22 < t < 2.5999999999999999e94Initial program 96.2%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 89.1%
Final simplification89.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (+ (/ z t) -1.0)))))
(if (<= t -6.2e+119)
t_1
(if (<= t -2e+40)
(+ x (* y (/ z (- a t))))
(if (<= t -1.8e-22)
(+ x (* t (/ y (- t a))))
(if (<= t 880.0) (+ x (/ (* y z) (- a t))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -6.2e+119) {
tmp = t_1;
} else if (t <= -2e+40) {
tmp = x + (y * (z / (a - t)));
} else if (t <= -1.8e-22) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 880.0) {
tmp = x + ((y * z) / (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) :: tmp
t_1 = x - (y * ((z / t) + (-1.0d0)))
if (t <= (-6.2d+119)) then
tmp = t_1
else if (t <= (-2d+40)) then
tmp = x + (y * (z / (a - t)))
else if (t <= (-1.8d-22)) then
tmp = x + (t * (y / (t - a)))
else if (t <= 880.0d0) then
tmp = x + ((y * z) / (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 = x - (y * ((z / t) + -1.0));
double tmp;
if (t <= -6.2e+119) {
tmp = t_1;
} else if (t <= -2e+40) {
tmp = x + (y * (z / (a - t)));
} else if (t <= -1.8e-22) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 880.0) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * ((z / t) + -1.0)) tmp = 0 if t <= -6.2e+119: tmp = t_1 elif t <= -2e+40: tmp = x + (y * (z / (a - t))) elif t <= -1.8e-22: tmp = x + (t * (y / (t - a))) elif t <= 880.0: tmp = x + ((y * z) / (a - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))) tmp = 0.0 if (t <= -6.2e+119) tmp = t_1; elseif (t <= -2e+40) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); elseif (t <= -1.8e-22) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); elseif (t <= 880.0) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * ((z / t) + -1.0)); tmp = 0.0; if (t <= -6.2e+119) tmp = t_1; elseif (t <= -2e+40) tmp = x + (y * (z / (a - t))); elseif (t <= -1.8e-22) tmp = x + (t * (y / (t - a))); elseif (t <= 880.0) tmp = x + ((y * z) / (a - 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 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.2e+119], t$95$1, If[LessEqual[t, -2e+40], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.8e-22], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 880.0], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2 \cdot 10^{+40}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-22}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 880:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.1999999999999999e119 or 880 < t Initial program 74.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 69.2%
mul-1-neg69.2%
unsub-neg69.2%
associate-/l*91.4%
div-sub91.4%
sub-neg91.4%
*-inverses91.4%
metadata-eval91.4%
Simplified91.4%
if -6.1999999999999999e119 < t < -2.00000000000000006e40Initial program 95.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 93.8%
associate-/l*98.6%
Simplified98.6%
if -2.00000000000000006e40 < t < -1.7999999999999999e-22Initial program 99.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 99.7%
mul-1-neg99.7%
unsub-neg99.7%
associate-/l*100.0%
Simplified100.0%
if -1.7999999999999999e-22 < t < 880Initial program 97.6%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 91.8%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.5e+119)
(- x (* y (+ (/ z t) -1.0)))
(if (<= t -1.3e+42)
(+ x (* y (/ z (- a t))))
(if (<= t -1.9e-22)
(+ x (* t (/ y (- t a))))
(if (<= t 920.0)
(+ x (/ (* y z) (- a t)))
(+ x (* y (/ (- t z) t))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+119) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= -1.3e+42) {
tmp = x + (y * (z / (a - t)));
} else if (t <= -1.9e-22) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 920.0) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * ((t - 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 (t <= (-4.5d+119)) then
tmp = x - (y * ((z / t) + (-1.0d0)))
else if (t <= (-1.3d+42)) then
tmp = x + (y * (z / (a - t)))
else if (t <= (-1.9d-22)) then
tmp = x + (t * (y / (t - a)))
else if (t <= 920.0d0) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y * ((t - 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 (t <= -4.5e+119) {
tmp = x - (y * ((z / t) + -1.0));
} else if (t <= -1.3e+42) {
tmp = x + (y * (z / (a - t)));
} else if (t <= -1.9e-22) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 920.0) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * ((t - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e+119: tmp = x - (y * ((z / t) + -1.0)) elif t <= -1.3e+42: tmp = x + (y * (z / (a - t))) elif t <= -1.9e-22: tmp = x + (t * (y / (t - a))) elif t <= 920.0: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y * ((t - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e+119) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); elseif (t <= -1.3e+42) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); elseif (t <= -1.9e-22) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); elseif (t <= 920.0) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e+119) tmp = x - (y * ((z / t) + -1.0)); elseif (t <= -1.3e+42) tmp = x + (y * (z / (a - t))); elseif (t <= -1.9e-22) tmp = x + (t * (y / (t - a))); elseif (t <= 920.0) tmp = x + ((y * z) / (a - t)); else tmp = x + (y * ((t - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e+119], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.3e+42], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.9e-22], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 920.0], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+119}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{+42}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-22}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 920:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\end{array}
\end{array}
if t < -4.5000000000000002e119Initial program 76.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.4%
mul-1-neg73.4%
unsub-neg73.4%
associate-/l*92.7%
div-sub92.8%
sub-neg92.8%
*-inverses92.8%
metadata-eval92.8%
Simplified92.8%
if -4.5000000000000002e119 < t < -1.29999999999999995e42Initial program 95.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 93.8%
associate-/l*98.6%
Simplified98.6%
if -1.29999999999999995e42 < t < -1.90000000000000012e-22Initial program 99.7%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 99.7%
mul-1-neg99.7%
unsub-neg99.7%
associate-/l*100.0%
Simplified100.0%
if -1.90000000000000012e-22 < t < 920Initial program 97.6%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 91.8%
if 920 < t Initial program 73.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 73.4%
associate-*r/99.9%
*-commutative99.9%
associate-/r/90.0%
Simplified90.0%
Taylor expanded in a around 0 67.1%
mul-1-neg67.1%
unsub-neg67.1%
associate-/l*90.8%
Simplified90.8%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(if (or (<= t -1.9e-22)
(and (not (<= t 4.8e-22)) (or (<= t 1.5e+47) (not (<= t 7.5e+90)))))
(+ x y)
(+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e-22) || (!(t <= 4.8e-22) && ((t <= 1.5e+47) || !(t <= 7.5e+90)))) {
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.9d-22)) .or. (.not. (t <= 4.8d-22)) .and. (t <= 1.5d+47) .or. (.not. (t <= 7.5d+90))) 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.9e-22) || (!(t <= 4.8e-22) && ((t <= 1.5e+47) || !(t <= 7.5e+90)))) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.9e-22) or (not (t <= 4.8e-22) and ((t <= 1.5e+47) or not (t <= 7.5e+90))): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e-22) || (!(t <= 4.8e-22) && ((t <= 1.5e+47) || !(t <= 7.5e+90)))) 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.9e-22) || (~((t <= 4.8e-22)) && ((t <= 1.5e+47) || ~((t <= 7.5e+90))))) 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.9e-22], And[N[Not[LessEqual[t, 4.8e-22]], $MachinePrecision], Or[LessEqual[t, 1.5e+47], N[Not[LessEqual[t, 7.5e+90]], $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.9 \cdot 10^{-22} \lor \neg \left(t \leq 4.8 \cdot 10^{-22}\right) \land \left(t \leq 1.5 \cdot 10^{+47} \lor \neg \left(t \leq 7.5 \cdot 10^{+90}\right)\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.90000000000000012e-22 or 4.80000000000000005e-22 < t < 1.5000000000000001e47 or 7.50000000000000014e90 < t Initial program 79.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 81.4%
+-commutative81.4%
Simplified81.4%
if -1.90000000000000012e-22 < t < 4.80000000000000005e-22 or 1.5000000000000001e47 < t < 7.50000000000000014e90Initial program 97.1%
associate-/l*95.2%
Simplified95.2%
clear-num95.2%
un-div-inv96.2%
Applied egg-rr96.2%
Taylor expanded in t around 0 78.5%
associate-/r/79.3%
Applied egg-rr79.3%
Final simplification80.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.9e-22)
(+ x y)
(if (<= t 6.8e-104)
(+ x (/ (* y z) a))
(if (<= t 1.05e+93) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.9e-22) {
tmp = x + y;
} else if (t <= 6.8e-104) {
tmp = x + ((y * z) / a);
} else if (t <= 1.05e+93) {
tmp = x - (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 (t <= (-1.9d-22)) then
tmp = x + y
else if (t <= 6.8d-104) then
tmp = x + ((y * z) / a)
else if (t <= 1.05d+93) then
tmp = x - (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 (t <= -1.9e-22) {
tmp = x + y;
} else if (t <= 6.8e-104) {
tmp = x + ((y * z) / a);
} else if (t <= 1.05e+93) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.9e-22: tmp = x + y elif t <= 6.8e-104: tmp = x + ((y * z) / a) elif t <= 1.05e+93: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.9e-22) tmp = Float64(x + y); elseif (t <= 6.8e-104) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= 1.05e+93) tmp = Float64(x - 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 (t <= -1.9e-22) tmp = x + y; elseif (t <= 6.8e-104) tmp = x + ((y * z) / a); elseif (t <= 1.05e+93) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.9e-22], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.8e-104], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e+93], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-22}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-104}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+93}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.90000000000000012e-22 or 1.0499999999999999e93 < t Initial program 77.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 84.3%
+-commutative84.3%
Simplified84.3%
if -1.90000000000000012e-22 < t < 6.80000000000000031e-104Initial program 98.1%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in t around 0 83.5%
if 6.80000000000000031e-104 < t < 1.0499999999999999e93Initial program 91.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 79.0%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in a around 0 61.9%
mul-1-neg61.9%
unsub-neg61.9%
associate-/l*65.8%
Simplified65.8%
Final simplification80.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+139) (not (<= t 3.2e+95))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+139) || !(t <= 3.2e+95)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.05d+139)) .or. (.not. (t <= 3.2d+95))) then
tmp = x + y
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+139) || !(t <= 3.2e+95)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+139) or not (t <= 3.2e+95): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+139) || !(t <= 3.2e+95)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+139) || ~((t <= 3.2e+95))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+139], N[Not[LessEqual[t, 3.2e+95]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+139} \lor \neg \left(t \leq 3.2 \cdot 10^{+95}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.0499999999999999e139 or 3.2000000000000001e95 < t Initial program 69.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 89.0%
+-commutative89.0%
Simplified89.0%
if -1.0499999999999999e139 < t < 3.2000000000000001e95Initial program 95.9%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around inf 87.4%
associate-/l*87.0%
Simplified87.0%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.9e-22) (+ x (* t (/ y (- t a)))) (if (<= t 2.2e+94) (+ x (/ (* y z) (- a t))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.9e-22) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 2.2e+94) {
tmp = x + ((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 (t <= (-1.9d-22)) then
tmp = x + (t * (y / (t - a)))
else if (t <= 2.2d+94) then
tmp = x + ((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 (t <= -1.9e-22) {
tmp = x + (t * (y / (t - a)));
} else if (t <= 2.2e+94) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.9e-22: tmp = x + (t * (y / (t - a))) elif t <= 2.2e+94: tmp = x + ((y * z) / (a - t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.9e-22) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); elseif (t <= 2.2e+94) tmp = Float64(x + Float64(Float64(y * 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 (t <= -1.9e-22) tmp = x + (t * (y / (t - a))); elseif (t <= 2.2e+94) tmp = x + ((y * z) / (a - t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.9e-22], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.2e+94], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-22}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+94}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.90000000000000012e-22Initial program 86.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 78.7%
mul-1-neg78.7%
unsub-neg78.7%
associate-/l*89.0%
Simplified89.0%
if -1.90000000000000012e-22 < t < 2.20000000000000012e94Initial program 96.2%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 89.1%
if 2.20000000000000012e94 < t Initial program 64.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 88.5%
+-commutative88.5%
Simplified88.5%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.7e-22) (- x (* y (/ t (- a t)))) (if (<= t 920.0) (+ x (/ (* y z) (- a t))) (+ x (* y (/ (- t z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e-22) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 920.0) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * ((t - 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 (t <= (-1.7d-22)) then
tmp = x - (y * (t / (a - t)))
else if (t <= 920.0d0) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y * ((t - 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 (t <= -1.7e-22) {
tmp = x - (y * (t / (a - t)));
} else if (t <= 920.0) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y * ((t - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e-22: tmp = x - (y * (t / (a - t))) elif t <= 920.0: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y * ((t - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e-22) tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); elseif (t <= 920.0) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e-22) tmp = x - (y * (t / (a - t))); elseif (t <= 920.0) tmp = x + ((y * z) / (a - t)); else tmp = x + (y * ((t - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e-22], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 920.0], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-22}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{elif}\;t \leq 920:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\end{array}
\end{array}
if t < -1.6999999999999999e-22Initial program 86.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 89.6%
neg-mul-189.6%
distribute-neg-frac89.6%
Simplified89.6%
if -1.6999999999999999e-22 < t < 920Initial program 97.6%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 91.8%
if 920 < t Initial program 73.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 73.4%
associate-*r/99.9%
*-commutative99.9%
associate-/r/90.0%
Simplified90.0%
Taylor expanded in a around 0 67.1%
mul-1-neg67.1%
unsub-neg67.1%
associate-/l*90.8%
Simplified90.8%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e-48) (not (<= t 3.2e-41))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.5e-48) || !(t <= 3.2e-41)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.5d-48)) .or. (.not. (t <= 3.2d-41))) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.5e-48) || !(t <= 3.2e-41)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.5e-48) or not (t <= 3.2e-41): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.5e-48) || !(t <= 3.2e-41)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.5e-48) || ~((t <= 3.2e-41))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.5e-48], N[Not[LessEqual[t, 3.2e-41]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{-48} \lor \neg \left(t \leq 3.2 \cdot 10^{-41}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -6.5e-48 or 3.20000000000000012e-41 < t Initial program 81.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 75.2%
+-commutative75.2%
Simplified75.2%
if -6.5e-48 < t < 3.20000000000000012e-41Initial program 97.4%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in x around inf 46.9%
Final simplification62.2%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 88.8%
associate-/l*97.4%
Simplified97.4%
Final simplification97.4%
(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 88.8%
associate-/l*97.4%
Simplified97.4%
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 2024130
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))