
(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 11 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
(let* ((t_1 (/ (* y (- z t)) (- a t))))
(if (<= t_1 (- INFINITY))
(+ x (* y (/ (- z t) (- a t))))
(if (<= t_1 5e+301) (+ t_1 x) (+ x (* (- z t) (/ y (- a t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (a - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (y * ((z - t) / (a - t)));
} else if (t_1 <= 5e+301) {
tmp = t_1 + x;
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (a - t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (y * ((z - t) / (a - t)));
} else if (t_1 <= 5e+301) {
tmp = t_1 + x;
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (a - t) tmp = 0 if t_1 <= -math.inf: tmp = x + (y * ((z - t) / (a - t))) elif t_1 <= 5e+301: tmp = t_1 + x else: tmp = x + ((z - t) * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))); elseif (t_1 <= 5e+301) tmp = Float64(t_1 + x); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (a - t); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (y * ((z - t) / (a - t))); elseif (t_1 <= 5e+301) tmp = t_1 + x; else tmp = x + ((z - t) * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+301], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;t\_1 + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 44.7%
associate-/l*100.0%
Simplified100.0%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 5.0000000000000004e301Initial program 99.4%
if 5.0000000000000004e301 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 56.6%
*-commutative56.6%
associate-/l*100.0%
Applied egg-rr100.0%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.1e-40)
(+ y x)
(if (<= t 3.8e-97)
(+ x (/ (* y z) a))
(if (<= t 2.5e+68) (- x (/ (* y z) t)) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.1e-40) {
tmp = y + x;
} else if (t <= 3.8e-97) {
tmp = x + ((y * z) / a);
} else if (t <= 2.5e+68) {
tmp = x - ((y * z) / t);
} else {
tmp = y + 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 <= (-1.1d-40)) then
tmp = y + x
else if (t <= 3.8d-97) then
tmp = x + ((y * z) / a)
else if (t <= 2.5d+68) then
tmp = x - ((y * z) / t)
else
tmp = y + 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 <= -1.1e-40) {
tmp = y + x;
} else if (t <= 3.8e-97) {
tmp = x + ((y * z) / a);
} else if (t <= 2.5e+68) {
tmp = x - ((y * z) / t);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.1e-40: tmp = y + x elif t <= 3.8e-97: tmp = x + ((y * z) / a) elif t <= 2.5e+68: tmp = x - ((y * z) / t) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.1e-40) tmp = Float64(y + x); elseif (t <= 3.8e-97) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= 2.5e+68) tmp = Float64(x - Float64(Float64(y * z) / t)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.1e-40) tmp = y + x; elseif (t <= 3.8e-97) tmp = x + ((y * z) / a); elseif (t <= 2.5e+68) tmp = x - ((y * z) / t); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.1e-40], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.8e-97], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+68], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{-40}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-97}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{+68}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.10000000000000004e-40 or 2.5000000000000002e68 < t Initial program 78.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -1.10000000000000004e-40 < t < 3.8000000000000001e-97Initial program 98.1%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in t around 0 79.2%
if 3.8000000000000001e-97 < t < 2.5000000000000002e68Initial program 93.6%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in t around inf 64.5%
associate-+r+64.5%
associate--l+64.5%
distribute-lft-out--64.5%
div-sub64.5%
associate-+r+64.5%
+-commutative64.5%
mul-1-neg64.5%
unsub-neg64.5%
*-commutative64.5%
distribute-lft-out--64.5%
Simplified64.5%
Taylor expanded in z around inf 70.9%
associate-*r/70.9%
neg-mul-170.9%
distribute-rgt-neg-in70.9%
Simplified70.9%
Final simplification78.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8e-41)
(+ y x)
(if (<= t 2.6e-60)
(+ x (/ (* y z) a))
(if (<= t 4.4e+67) (- x (* y (/ z t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8e-41) {
tmp = y + x;
} else if (t <= 2.6e-60) {
tmp = x + ((y * z) / a);
} else if (t <= 4.4e+67) {
tmp = x - (y * (z / t));
} else {
tmp = y + 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 <= (-8d-41)) then
tmp = y + x
else if (t <= 2.6d-60) then
tmp = x + ((y * z) / a)
else if (t <= 4.4d+67) then
tmp = x - (y * (z / t))
else
tmp = y + 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 <= -8e-41) {
tmp = y + x;
} else if (t <= 2.6e-60) {
tmp = x + ((y * z) / a);
} else if (t <= 4.4e+67) {
tmp = x - (y * (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8e-41: tmp = y + x elif t <= 2.6e-60: tmp = x + ((y * z) / a) elif t <= 4.4e+67: tmp = x - (y * (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8e-41) tmp = Float64(y + x); elseif (t <= 2.6e-60) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= 4.4e+67) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8e-41) tmp = y + x; elseif (t <= 2.6e-60) tmp = x + ((y * z) / a); elseif (t <= 4.4e+67) tmp = x - (y * (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8e-41], N[(y + x), $MachinePrecision], If[LessEqual[t, 2.6e-60], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+67], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-41}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-60}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+67}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -8.00000000000000005e-41 or 4.4e67 < t Initial program 78.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -8.00000000000000005e-41 < t < 2.5999999999999998e-60Initial program 98.2%
associate-/l*90.3%
Simplified90.3%
Taylor expanded in t around 0 77.1%
if 2.5999999999999998e-60 < t < 4.4e67Initial program 91.5%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 68.9%
associate-+r+68.9%
associate--l+68.9%
distribute-lft-out--68.9%
div-sub68.9%
associate-+r+68.9%
+-commutative68.9%
mul-1-neg68.9%
unsub-neg68.9%
*-commutative68.9%
distribute-lft-out--68.9%
Simplified68.9%
Taylor expanded in z around inf 77.5%
mul-1-neg77.5%
associate-/l*77.3%
distribute-rgt-neg-in77.3%
Simplified77.3%
Taylor expanded in y around 0 77.5%
mul-1-neg77.5%
associate-*r/77.3%
sub-neg77.3%
Simplified77.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.22e-60) (not (<= t 1.8e+67))) (+ x (* y (/ (- t z) t))) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.22e-60) || !(t <= 1.8e+67)) {
tmp = x + (y * ((t - z) / t));
} 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.22d-60)) .or. (.not. (t <= 1.8d+67))) then
tmp = x + (y * ((t - z) / t))
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.22e-60) || !(t <= 1.8e+67)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.22e-60) or not (t <= 1.8e+67): tmp = x + (y * ((t - z) / t)) else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.22e-60) || !(t <= 1.8e+67)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); 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 <= -1.22e-60) || ~((t <= 1.8e+67))) tmp = x + (y * ((t - z) / t)); else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.22e-60], N[Not[LessEqual[t, 1.8e+67]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{-60} \lor \neg \left(t \leq 1.8 \cdot 10^{+67}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -1.22e-60 or 1.7999999999999999e67 < t Initial program 79.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 72.3%
mul-1-neg72.3%
associate-/l*91.9%
distribute-rgt-neg-in91.9%
distribute-frac-neg91.9%
neg-sub091.9%
sub-neg91.9%
+-commutative91.9%
associate--r+91.9%
neg-sub091.9%
remove-double-neg91.9%
Simplified91.9%
if -1.22e-60 < t < 1.7999999999999999e67Initial program 97.0%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in z around inf 90.6%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.8e-58) (not (<= t 4.8e+47))) (+ 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 <= -5.8e-58) || !(t <= 4.8e+47)) {
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 <= (-5.8d-58)) .or. (.not. (t <= 4.8d+47))) 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 <= -5.8e-58) || !(t <= 4.8e+47)) {
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 <= -5.8e-58) or not (t <= 4.8e+47): 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 <= -5.8e-58) || !(t <= 4.8e+47)) tmp = Float64(x + Float64(y * Float64(Float64(t - 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 <= -5.8e-58) || ~((t <= 4.8e+47))) 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, -5.8e-58], N[Not[LessEqual[t, 4.8e+47]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $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 -5.8 \cdot 10^{-58} \lor \neg \left(t \leq 4.8 \cdot 10^{+47}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -5.7999999999999998e-58 or 4.80000000000000037e47 < t Initial program 80.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.0%
mul-1-neg73.0%
associate-/l*92.1%
distribute-rgt-neg-in92.1%
distribute-frac-neg92.1%
neg-sub092.1%
sub-neg92.1%
+-commutative92.1%
associate--r+92.1%
neg-sub092.1%
remove-double-neg92.1%
Simplified92.1%
if -5.7999999999999998e-58 < t < 4.80000000000000037e47Initial program 97.0%
*-commutative97.0%
associate-/l*94.5%
Applied egg-rr94.5%
Taylor expanded in z around inf 89.1%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e-62) (not (<= t 1.22e-39))) (+ x (* y (/ (- t z) t))) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e-62) || !(t <= 1.22e-39)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3d-62)) .or. (.not. (t <= 1.22d-39))) then
tmp = x + (y * ((t - z) / t))
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e-62) || !(t <= 1.22e-39)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3e-62) or not (t <= 1.22e-39): tmp = x + (y * ((t - z) / t)) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e-62) || !(t <= 1.22e-39)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3e-62) || ~((t <= 1.22e-39))) tmp = x + (y * ((t - z) / t)); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e-62], N[Not[LessEqual[t, 1.22e-39]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-62} \lor \neg \left(t \leq 1.22 \cdot 10^{-39}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -3.0000000000000001e-62 or 1.2200000000000001e-39 < t Initial program 81.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 72.7%
mul-1-neg72.7%
associate-/l*89.4%
distribute-rgt-neg-in89.4%
distribute-frac-neg89.4%
neg-sub089.4%
sub-neg89.4%
+-commutative89.4%
associate--r+89.4%
neg-sub089.4%
remove-double-neg89.4%
Simplified89.4%
if -3.0000000000000001e-62 < t < 1.2200000000000001e-39Initial program 98.2%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in t around 0 77.4%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.22e-60) (+ x (* y (/ (- t z) t))) (if (<= t 2e+67) (+ x (/ (* y z) (- a t))) (+ x (- y (* y (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.22e-60) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 2e+67) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y - (y * (z / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.22d-60)) then
tmp = x + (y * ((t - z) / t))
else if (t <= 2d+67) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y - (y * (z / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.22e-60) {
tmp = x + (y * ((t - z) / t));
} else if (t <= 2e+67) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y - (y * (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.22e-60: tmp = x + (y * ((t - z) / t)) elif t <= 2e+67: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y - (y * (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.22e-60) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); elseif (t <= 2e+67) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y - Float64(y * Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.22e-60) tmp = x + (y * ((t - z) / t)); elseif (t <= 2e+67) tmp = x + ((y * z) / (a - t)); else tmp = x + (y - (y * (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.22e-60], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+67], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{-60}:\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+67}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{t}\right)\\
\end{array}
\end{array}
if t < -1.22e-60Initial program 79.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 71.1%
mul-1-neg71.1%
associate-/l*90.6%
distribute-rgt-neg-in90.6%
distribute-frac-neg90.6%
neg-sub090.6%
sub-neg90.6%
+-commutative90.6%
associate--r+90.6%
neg-sub090.6%
remove-double-neg90.6%
Simplified90.6%
if -1.22e-60 < t < 1.99999999999999997e67Initial program 97.0%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in z around inf 90.6%
if 1.99999999999999997e67 < t Initial program 80.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 71.7%
associate-+r+71.7%
associate--l+71.7%
distribute-lft-out--71.7%
div-sub71.7%
associate-+r+71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
*-commutative71.7%
distribute-lft-out--74.3%
Simplified74.3%
Taylor expanded in z around inf 87.3%
associate-/l*94.8%
Simplified94.8%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e-40) (not (<= t 1.35e+33))) (+ y x) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e-40) || !(t <= 1.35e+33)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.05d-40)) .or. (.not. (t <= 1.35d+33))) then
tmp = y + x
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e-40) || !(t <= 1.35e+33)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e-40) or not (t <= 1.35e+33): tmp = y + x else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e-40) || !(t <= 1.35e+33)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e-40) || ~((t <= 1.35e+33))) tmp = y + x; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e-40], N[Not[LessEqual[t, 1.35e+33]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-40} \lor \neg \left(t \leq 1.35 \cdot 10^{+33}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.05000000000000009e-40 or 1.34999999999999996e33 < t Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 79.9%
+-commutative79.9%
Simplified79.9%
if -1.05000000000000009e-40 < t < 1.34999999999999996e33Initial program 97.0%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in t around 0 73.8%
Final simplification76.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.6e+138) x (if (<= a 5.8e+155) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.6e+138) {
tmp = x;
} else if (a <= 5.8e+155) {
tmp = y + x;
} 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 <= (-2.6d+138)) then
tmp = x
else if (a <= 5.8d+155) then
tmp = y + x
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 <= -2.6e+138) {
tmp = x;
} else if (a <= 5.8e+155) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.6e+138: tmp = x elif a <= 5.8e+155: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.6e+138) tmp = x; elseif (a <= 5.8e+155) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.6e+138) tmp = x; elseif (a <= 5.8e+155) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.6e+138], x, If[LessEqual[a, 5.8e+155], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+138}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+155}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.6000000000000001e138 or 5.7999999999999998e155 < a Initial program 90.2%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in x around inf 73.3%
if -2.6000000000000001e138 < a < 5.7999999999999998e155Initial program 88.4%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in t around inf 56.6%
+-commutative56.6%
Simplified56.6%
(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*95.5%
Simplified95.5%
(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*95.5%
Simplified95.5%
Taylor expanded in x around inf 44.6%
(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 2024110
(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))))