
(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 10 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 84.4%
associate-/l*97.7%
Simplified97.7%
clear-num97.6%
un-div-inv98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.8e+179)
(+ x y)
(if (<= t -3.5e+119)
(- x (* y (/ z t)))
(if (<= t -4.5e+86)
(+ x y)
(if (<= t -9.6e+41)
(+ x (/ y (/ a (- z t))))
(if (<= t 1.6e+134) (+ x (* z (/ y (- a t)))) (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+179) {
tmp = x + y;
} else if (t <= -3.5e+119) {
tmp = x - (y * (z / t));
} else if (t <= -4.5e+86) {
tmp = x + y;
} else if (t <= -9.6e+41) {
tmp = x + (y / (a / (z - t)));
} else if (t <= 1.6e+134) {
tmp = x + (z * (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 (t <= (-7.8d+179)) then
tmp = x + y
else if (t <= (-3.5d+119)) then
tmp = x - (y * (z / t))
else if (t <= (-4.5d+86)) then
tmp = x + y
else if (t <= (-9.6d+41)) then
tmp = x + (y / (a / (z - t)))
else if (t <= 1.6d+134) then
tmp = x + (z * (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 (t <= -7.8e+179) {
tmp = x + y;
} else if (t <= -3.5e+119) {
tmp = x - (y * (z / t));
} else if (t <= -4.5e+86) {
tmp = x + y;
} else if (t <= -9.6e+41) {
tmp = x + (y / (a / (z - t)));
} else if (t <= 1.6e+134) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e+179: tmp = x + y elif t <= -3.5e+119: tmp = x - (y * (z / t)) elif t <= -4.5e+86: tmp = x + y elif t <= -9.6e+41: tmp = x + (y / (a / (z - t))) elif t <= 1.6e+134: tmp = x + (z * (y / (a - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e+179) tmp = Float64(x + y); elseif (t <= -3.5e+119) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= -4.5e+86) tmp = Float64(x + y); elseif (t <= -9.6e+41) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (t <= 1.6e+134) tmp = Float64(x + Float64(z * 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 (t <= -7.8e+179) tmp = x + y; elseif (t <= -3.5e+119) tmp = x - (y * (z / t)); elseif (t <= -4.5e+86) tmp = x + y; elseif (t <= -9.6e+41) tmp = x + (y / (a / (z - t))); elseif (t <= 1.6e+134) tmp = x + (z * (y / (a - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e+179], N[(x + y), $MachinePrecision], If[LessEqual[t, -3.5e+119], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.5e+86], N[(x + y), $MachinePrecision], If[LessEqual[t, -9.6e+41], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+134], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+179}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{+119}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{+86}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -9.6 \cdot 10^{+41}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+134}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.79999999999999947e179 or -3.5000000000000001e119 < t < -4.49999999999999993e86 or 1.6e134 < t Initial program 67.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 84.4%
+-commutative84.4%
Simplified84.4%
if -7.79999999999999947e179 < t < -3.5000000000000001e119Initial program 76.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 60.2%
mul-1-neg60.2%
unsub-neg60.2%
associate-/l*75.9%
div-sub75.9%
sub-neg75.9%
*-inverses75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in z around inf 76.9%
associate-*r/86.1%
Simplified86.1%
if -4.49999999999999993e86 < t < -9.6000000000000007e41Initial program 92.4%
associate-/l*99.9%
Simplified99.9%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 77.8%
if -9.6000000000000007e41 < t < 1.6e134Initial program 93.6%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 85.9%
*-commutative85.9%
associate-/l*90.2%
Applied egg-rr90.2%
Final simplification87.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.8e+180)
(+ x y)
(if (<= t -9.5e+119)
(- x (* y (/ z t)))
(if (or (<= t -4.3e+86) (not (<= t 11500000000.0)))
(+ x y)
(+ x (* z (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+180) {
tmp = x + y;
} else if (t <= -9.5e+119) {
tmp = x - (y * (z / t));
} else if ((t <= -4.3e+86) || !(t <= 11500000000.0)) {
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.8d+180)) then
tmp = x + y
else if (t <= (-9.5d+119)) then
tmp = x - (y * (z / t))
else if ((t <= (-4.3d+86)) .or. (.not. (t <= 11500000000.0d0))) 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.8e+180) {
tmp = x + y;
} else if (t <= -9.5e+119) {
tmp = x - (y * (z / t));
} else if ((t <= -4.3e+86) || !(t <= 11500000000.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.8e+180: tmp = x + y elif t <= -9.5e+119: tmp = x - (y * (z / t)) elif (t <= -4.3e+86) or not (t <= 11500000000.0): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.8e+180) tmp = Float64(x + y); elseif (t <= -9.5e+119) tmp = Float64(x - Float64(y * Float64(z / t))); elseif ((t <= -4.3e+86) || !(t <= 11500000000.0)) 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.8e+180) tmp = x + y; elseif (t <= -9.5e+119) tmp = x - (y * (z / t)); elseif ((t <= -4.3e+86) || ~((t <= 11500000000.0))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.8e+180], N[(x + y), $MachinePrecision], If[LessEqual[t, -9.5e+119], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.3e+86], N[Not[LessEqual[t, 11500000000.0]], $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.8 \cdot 10^{+180}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{+119}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -4.3 \cdot 10^{+86} \lor \neg \left(t \leq 11500000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.8000000000000001e180 or -9.4999999999999994e119 < t < -4.3000000000000002e86 or 1.15e10 < t Initial program 70.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 79.0%
+-commutative79.0%
Simplified79.0%
if -1.8000000000000001e180 < t < -9.4999999999999994e119Initial program 76.4%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 60.2%
mul-1-neg60.2%
unsub-neg60.2%
associate-/l*75.9%
div-sub75.9%
sub-neg75.9%
*-inverses75.9%
metadata-eval75.9%
Simplified75.9%
Taylor expanded in z around inf 76.9%
associate-*r/86.1%
Simplified86.1%
if -4.3000000000000002e86 < t < 1.15e10Initial program 95.7%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in t around 0 74.3%
*-commutative74.3%
associate-/l*77.0%
Applied egg-rr77.0%
Final simplification78.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (+ (/ z t) -1.0)))))
(if (<= t -4.2e+135)
t_1
(if (<= t -2.2e+55)
(+ x (* y (/ t (- t a))))
(if (<= t 1.75e+137) (+ x (* z (/ y (- 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 <= -4.2e+135) {
tmp = t_1;
} else if (t <= -2.2e+55) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1.75e+137) {
tmp = x + (z * (y / (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 <= (-4.2d+135)) then
tmp = t_1
else if (t <= (-2.2d+55)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 1.75d+137) then
tmp = x + (z * (y / (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 <= -4.2e+135) {
tmp = t_1;
} else if (t <= -2.2e+55) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 1.75e+137) {
tmp = x + (z * (y / (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 <= -4.2e+135: tmp = t_1 elif t <= -2.2e+55: tmp = x + (y * (t / (t - a))) elif t <= 1.75e+137: tmp = x + (z * (y / (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 <= -4.2e+135) tmp = t_1; elseif (t <= -2.2e+55) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 1.75e+137) tmp = Float64(x + Float64(z * Float64(y / 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 <= -4.2e+135) tmp = t_1; elseif (t <= -2.2e+55) tmp = x + (y * (t / (t - a))); elseif (t <= 1.75e+137) tmp = x + (z * (y / (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, -4.2e+135], t$95$1, If[LessEqual[t, -2.2e+55], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e+137], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $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 -4.2 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{+55}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+137}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.20000000000000019e135 or 1.7500000000000001e137 < t Initial program 64.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 63.5%
mul-1-neg63.5%
unsub-neg63.5%
associate-/l*95.1%
div-sub95.1%
sub-neg95.1%
*-inverses95.1%
metadata-eval95.1%
Simplified95.1%
if -4.20000000000000019e135 < t < -2.2000000000000001e55Initial program 91.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
*-commutative86.8%
associate-/l*95.5%
Simplified95.5%
if -2.2000000000000001e55 < t < 1.7500000000000001e137Initial program 93.2%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 85.2%
*-commutative85.2%
associate-/l*89.4%
Applied egg-rr89.4%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e+179) (not (<= t 4.6e+133))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+179) || !(t <= 4.6e+133)) {
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 <= (-7d+179)) .or. (.not. (t <= 4.6d+133))) 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 <= -7e+179) || !(t <= 4.6e+133)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e+179) or not (t <= 4.6e+133): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e+179) || !(t <= 4.6e+133)) 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 <= -7e+179) || ~((t <= 4.6e+133))) 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, -7e+179], N[Not[LessEqual[t, 4.6e+133]], $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 -7 \cdot 10^{+179} \lor \neg \left(t \leq 4.6 \cdot 10^{+133}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -7.0000000000000003e179 or 4.5999999999999998e133 < t Initial program 64.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 85.0%
+-commutative85.0%
Simplified85.0%
if -7.0000000000000003e179 < t < 4.5999999999999998e133Initial program 92.2%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 81.9%
*-commutative81.9%
associate-/l*86.0%
Applied egg-rr86.0%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+86) (not (<= t 7e+135))) (- x (* y (+ (/ z t) -1.0))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+86) || !(t <= 7e+135)) {
tmp = x - (y * ((z / t) + -1.0));
} 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 <= (-4.5d+86)) .or. (.not. (t <= 7d+135))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
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 <= -4.5e+86) || !(t <= 7e+135)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+86) or not (t <= 7e+135): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.5e+86) || !(t <= 7e+135)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); 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 <= -4.5e+86) || ~((t <= 7e+135))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.5e+86], N[Not[LessEqual[t, 7e+135]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $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 -4.5 \cdot 10^{+86} \lor \neg \left(t \leq 7 \cdot 10^{+135}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.49999999999999993e86 or 7.0000000000000005e135 < t Initial program 68.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 64.8%
mul-1-neg64.8%
unsub-neg64.8%
associate-/l*91.6%
div-sub91.6%
sub-neg91.6%
*-inverses91.6%
metadata-eval91.6%
Simplified91.6%
if -4.49999999999999993e86 < t < 7.0000000000000005e135Initial program 93.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 84.8%
*-commutative84.8%
associate-/l*88.7%
Applied egg-rr88.7%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.5e+86) (not (<= t 300000000000.0))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.5e+86) || !(t <= 300000000000.0)) {
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 <= (-8.5d+86)) .or. (.not. (t <= 300000000000.0d0))) 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 <= -8.5e+86) || !(t <= 300000000000.0)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.5e+86) or not (t <= 300000000000.0): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.5e+86) || !(t <= 300000000000.0)) 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 <= -8.5e+86) || ~((t <= 300000000000.0))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.5e+86], N[Not[LessEqual[t, 300000000000.0]], $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 -8.5 \cdot 10^{+86} \lor \neg \left(t \leq 300000000000\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -8.5000000000000005e86 or 3e11 < t Initial program 71.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 75.6%
+-commutative75.6%
Simplified75.6%
if -8.5000000000000005e86 < t < 3e11Initial program 95.7%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in t around 0 74.3%
*-commutative74.3%
associate-/l*77.0%
Applied egg-rr77.0%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -8e+183) x (if (<= a 3.2e+135) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8e+183) {
tmp = x;
} else if (a <= 3.2e+135) {
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 <= (-8d+183)) then
tmp = x
else if (a <= 3.2d+135) 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 <= -8e+183) {
tmp = x;
} else if (a <= 3.2e+135) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8e+183: tmp = x elif a <= 3.2e+135: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8e+183) tmp = x; elseif (a <= 3.2e+135) 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 <= -8e+183) tmp = x; elseif (a <= 3.2e+135) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8e+183], x, If[LessEqual[a, 3.2e+135], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{+183}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+135}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.99999999999999957e183 or 3.19999999999999975e135 < a Initial program 83.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 71.8%
if -7.99999999999999957e183 < a < 3.19999999999999975e135Initial program 84.8%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in t around inf 63.2%
+-commutative63.2%
Simplified63.2%
Final simplification65.7%
(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 84.4%
associate-/l*97.7%
Simplified97.7%
Final simplification97.7%
(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 84.4%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(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 2024079
(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))))