
(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 (if (<= z 1.4e+119) (+ x (* y (/ (- z t) (- a t)))) (+ x (* (- z t) (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.4e+119) {
tmp = x + (y * ((z - t) / (a - t)));
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.4d+119) then
tmp = x + (y * ((z - t) / (a - t)))
else
tmp = x + ((z - t) * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.4e+119) {
tmp = x + (y * ((z - t) / (a - t)));
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.4e+119: tmp = x + (y * ((z - t) / (a - t))) else: tmp = x + ((z - t) * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.4e+119) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))); 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) tmp = 0.0; if (z <= 1.4e+119) tmp = x + (y * ((z - t) / (a - t))); else tmp = x + ((z - t) * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.4e+119], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+119}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if z < 1.40000000000000007e119Initial program 87.8%
associate-/l*99.5%
Simplified99.5%
if 1.40000000000000007e119 < z Initial program 74.0%
*-commutative74.0%
associate-/l*99.9%
Applied egg-rr99.9%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* t (/ y (- t a))))))
(if (<= t -3.8e+75)
t_1
(if (<= t -20500.0)
(- x (* y (/ z t)))
(if (or (<= t -2.9e-50) (not (<= t 1.8e-119)))
t_1
(+ x (* z (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t * (y / (t - a)));
double tmp;
if (t <= -3.8e+75) {
tmp = t_1;
} else if (t <= -20500.0) {
tmp = x - (y * (z / t));
} else if ((t <= -2.9e-50) || !(t <= 1.8e-119)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (t * (y / (t - a)))
if (t <= (-3.8d+75)) then
tmp = t_1
else if (t <= (-20500.0d0)) then
tmp = x - (y * (z / t))
else if ((t <= (-2.9d-50)) .or. (.not. (t <= 1.8d-119))) then
tmp = t_1
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 t_1 = x + (t * (y / (t - a)));
double tmp;
if (t <= -3.8e+75) {
tmp = t_1;
} else if (t <= -20500.0) {
tmp = x - (y * (z / t));
} else if ((t <= -2.9e-50) || !(t <= 1.8e-119)) {
tmp = t_1;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t * (y / (t - a))) tmp = 0 if t <= -3.8e+75: tmp = t_1 elif t <= -20500.0: tmp = x - (y * (z / t)) elif (t <= -2.9e-50) or not (t <= 1.8e-119): tmp = t_1 else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t * Float64(y / Float64(t - a)))) tmp = 0.0 if (t <= -3.8e+75) tmp = t_1; elseif (t <= -20500.0) tmp = Float64(x - Float64(y * Float64(z / t))); elseif ((t <= -2.9e-50) || !(t <= 1.8e-119)) tmp = t_1; else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t * (y / (t - a))); tmp = 0.0; if (t <= -3.8e+75) tmp = t_1; elseif (t <= -20500.0) tmp = x - (y * (z / t)); elseif ((t <= -2.9e-50) || ~((t <= 1.8e-119))) tmp = t_1; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.8e+75], t$95$1, If[LessEqual[t, -20500.0], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.9e-50], N[Not[LessEqual[t, 1.8e-119]], $MachinePrecision]], t$95$1, N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{t - a}\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -20500:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-50} \lor \neg \left(t \leq 1.8 \cdot 10^{-119}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.8000000000000002e75 or -20500 < t < -2.90000000000000008e-50 or 1.8e-119 < t Initial program 80.0%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in z around 0 68.1%
associate-*r/68.1%
mul-1-neg68.1%
distribute-lft-neg-out68.1%
*-commutative68.1%
associate-/l*85.6%
distribute-neg-frac85.6%
distribute-neg-frac285.6%
neg-sub085.6%
associate--r-85.6%
neg-sub085.6%
Simplified85.6%
Taylor expanded in y around 0 68.1%
associate-/l*83.3%
Simplified83.3%
if -3.8000000000000002e75 < t < -20500Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 94.4%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in a around 0 83.4%
mul-1-neg83.4%
unsub-neg83.4%
associate-/l*83.5%
Simplified83.5%
if -2.90000000000000008e-50 < t < 1.8e-119Initial program 93.5%
*-commutative93.5%
associate-/l*97.8%
Applied egg-rr97.8%
Taylor expanded in t around 0 81.7%
*-commutative81.7%
associate-*r/88.0%
Simplified88.0%
Final simplification84.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -9e+76)
(+ x y)
(if (<= t -5.2e-51)
(- x (* y (/ z t)))
(if (<= t 2.12e-47) (+ x (* z (/ y a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+76) {
tmp = x + y;
} else if (t <= -5.2e-51) {
tmp = x - (y * (z / t));
} else if (t <= 2.12e-47) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-9d+76)) then
tmp = x + y
else if (t <= (-5.2d-51)) then
tmp = x - (y * (z / t))
else if (t <= 2.12d-47) then
tmp = x + (z * (y / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9e+76) {
tmp = x + y;
} else if (t <= -5.2e-51) {
tmp = x - (y * (z / t));
} else if (t <= 2.12e-47) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9e+76: tmp = x + y elif t <= -5.2e-51: tmp = x - (y * (z / t)) elif t <= 2.12e-47: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9e+76) tmp = Float64(x + y); elseif (t <= -5.2e-51) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 2.12e-47) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9e+76) tmp = x + y; elseif (t <= -5.2e-51) tmp = x - (y * (z / t)); elseif (t <= 2.12e-47) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9e+76], N[(x + y), $MachinePrecision], If[LessEqual[t, -5.2e-51], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.12e-47], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+76}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-51}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2.12 \cdot 10^{-47}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -8.9999999999999995e76 or 2.12e-47 < t Initial program 74.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 84.1%
if -8.9999999999999995e76 < t < -5.2e-51Initial program 99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 86.9%
associate-/l*86.9%
Simplified86.9%
Taylor expanded in a around 0 71.5%
mul-1-neg71.5%
unsub-neg71.5%
associate-/l*71.6%
Simplified71.6%
if -5.2e-51 < t < 2.12e-47Initial program 94.6%
*-commutative94.6%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in t around 0 77.5%
*-commutative77.5%
associate-*r/82.7%
Simplified82.7%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+46) (not (<= z 8.6e+48))) (+ x (* y (/ z (- a t)))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+46) || !(z <= 8.6e+48)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - 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 <= (-5.2d+46)) .or. (.not. (z <= 8.6d+48))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x + (t * (y / (t - 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 <= -5.2e+46) || !(z <= 8.6e+48)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+46) or not (z <= 8.6e+48): tmp = x + (y * (z / (a - t))) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+46) || !(z <= 8.6e+48)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+46) || ~((z <= 8.6e+48))) tmp = x + (y * (z / (a - t))); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+46], N[Not[LessEqual[z, 8.6e+48]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+46} \lor \neg \left(z \leq 8.6 \cdot 10^{+48}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -5.20000000000000027e46 or 8.59999999999999957e48 < z Initial program 83.6%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 80.7%
associate-/l*84.8%
Simplified84.8%
if -5.20000000000000027e46 < z < 8.59999999999999957e48Initial program 88.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 80.7%
associate-*r/80.7%
mul-1-neg80.7%
distribute-lft-neg-out80.7%
*-commutative80.7%
associate-/l*92.6%
distribute-neg-frac92.6%
distribute-neg-frac292.6%
neg-sub092.6%
associate--r-92.6%
neg-sub092.6%
Simplified92.6%
Taylor expanded in y around 0 80.7%
associate-/l*88.8%
Simplified88.8%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+46) (not (<= z 7e+47))) (+ x (* z (/ y (- a t)))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+46) || !(z <= 7e+47)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t * (y / (t - 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 <= (-5.2d+46)) .or. (.not. (z <= 7d+47))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (t * (y / (t - 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 <= -5.2e+46) || !(z <= 7e+47)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+46) or not (z <= 7e+47): tmp = x + (z * (y / (a - t))) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+46) || !(z <= 7e+47)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.2e+46) || ~((z <= 7e+47))) tmp = x + (z * (y / (a - t))); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+46], N[Not[LessEqual[z, 7e+47]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+46} \lor \neg \left(z \leq 7 \cdot 10^{+47}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -5.20000000000000027e46 or 7.00000000000000031e47 < z Initial program 83.6%
*-commutative83.6%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 80.7%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
if -5.20000000000000027e46 < z < 7.00000000000000031e47Initial program 88.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 80.7%
associate-*r/80.7%
mul-1-neg80.7%
distribute-lft-neg-out80.7%
*-commutative80.7%
associate-/l*92.6%
distribute-neg-frac92.6%
distribute-neg-frac292.6%
neg-sub092.6%
associate--r-92.6%
neg-sub092.6%
Simplified92.6%
Taylor expanded in y around 0 80.7%
associate-/l*88.8%
Simplified88.8%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e+46) (not (<= z 6.7e+47))) (+ x (* z (/ y (- a t)))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e+46) || !(z <= 6.7e+47)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - 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+46)) .or. (.not. (z <= 6.7d+47))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y * (t / (t - 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+46) || !(z <= 6.7e+47)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e+46) or not (z <= 6.7e+47): tmp = x + (z * (y / (a - t))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5e+46) || !(z <= 6.7e+47)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.5e+46) || ~((z <= 6.7e+47))) tmp = x + (z * (y / (a - t))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5e+46], N[Not[LessEqual[z, 6.7e+47]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+46} \lor \neg \left(z \leq 6.7 \cdot 10^{+47}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -6.50000000000000008e46 or 6.69999999999999973e47 < z Initial program 83.6%
*-commutative83.6%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 80.7%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
if -6.50000000000000008e46 < z < 6.69999999999999973e47Initial program 88.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 80.7%
associate-*r/80.7%
mul-1-neg80.7%
distribute-lft-neg-out80.7%
*-commutative80.7%
associate-/l*92.6%
distribute-neg-frac92.6%
distribute-neg-frac292.6%
neg-sub092.6%
associate--r-92.6%
neg-sub092.6%
Simplified92.6%
Final simplification91.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e-49) (not (<= t 2.7e-42))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e-49) || !(t <= 2.7e-42)) {
tmp = x + y;
} 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-49)) .or. (.not. (t <= 2.7d-42))) then
tmp = x + y
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-49) || !(t <= 2.7e-42)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e-49) or not (t <= 2.7e-42): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e-49) || !(t <= 2.7e-42)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e-49) || ~((t <= 2.7e-42))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e-49], N[Not[LessEqual[t, 2.7e-42]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-49} \lor \neg \left(t \leq 2.7 \cdot 10^{-42}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.0499999999999999e-49 or 2.69999999999999999e-42 < t Initial program 80.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 77.8%
if -1.0499999999999999e-49 < t < 2.69999999999999999e-42Initial program 94.6%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in t around 0 77.5%
associate-/l*79.1%
Simplified79.1%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.5e+53) (not (<= t 4.4e-54))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e+53) || !(t <= 4.4e-54)) {
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.5d+53)) .or. (.not. (t <= 4.4d-54))) 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.5e+53) || !(t <= 4.4e-54)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.5e+53) or not (t <= 4.4e-54): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.5e+53) || !(t <= 4.4e-54)) 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.5e+53) || ~((t <= 4.4e-54))) 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.5e+53], N[Not[LessEqual[t, 4.4e-54]], $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.5 \cdot 10^{+53} \lor \neg \left(t \leq 4.4 \cdot 10^{-54}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.49999999999999999e53 or 4.3999999999999999e-54 < t Initial program 75.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 82.9%
if -1.49999999999999999e53 < t < 4.3999999999999999e-54Initial program 95.7%
*-commutative95.7%
associate-/l*98.5%
Applied egg-rr98.5%
Taylor expanded in t around 0 73.6%
*-commutative73.6%
associate-*r/77.7%
Simplified77.7%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.6e+220) (+ x (* t (/ y a))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.6e+220) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-4.6d+220)) then
tmp = x + (t * (y / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.6e+220) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.6e+220: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.6e+220) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.6e+220) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.6e+220], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.6 \cdot 10^{+220}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -4.59999999999999993e220Initial program 91.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around inf 91.3%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 78.1%
mul-1-neg78.1%
unsub-neg78.1%
associate-/l*78.1%
Simplified78.1%
sub-neg78.1%
associate-*r/78.1%
distribute-neg-frac278.1%
add-sqr-sqrt78.1%
sqrt-unprod73.4%
sqr-neg73.4%
sqrt-unprod0.0%
add-sqr-sqrt78.0%
associate-*r/78.2%
Applied egg-rr78.2%
if -4.59999999999999993e220 < a Initial program 85.6%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in t around inf 65.7%
Final simplification66.8%
(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 86.1%
associate-/l*97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + 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 + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 86.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in t around inf 64.9%
Final simplification64.9%
(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 86.1%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in t around 0 60.5%
Taylor expanded in x around inf 51.6%
Final simplification51.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 2024077
(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))))