
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ 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 87.5%
associate-/l*98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- a t))))))
(if (<= t -1.22e+67)
(+ x y)
(if (<= t -1e-126)
t_1
(if (<= t 2.1e-184)
(+ x (* y (/ (- z t) a)))
(if (<= t 4.8e+107) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (a - t)));
double tmp;
if (t <= -1.22e+67) {
tmp = x + y;
} else if (t <= -1e-126) {
tmp = t_1;
} else if (t <= 2.1e-184) {
tmp = x + (y * ((z - t) / a));
} else if (t <= 4.8e+107) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (z * (y / (a - t)))
if (t <= (-1.22d+67)) then
tmp = x + y
else if (t <= (-1d-126)) then
tmp = t_1
else if (t <= 2.1d-184) then
tmp = x + (y * ((z - t) / a))
else if (t <= 4.8d+107) then
tmp = t_1
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 t_1 = x + (z * (y / (a - t)));
double tmp;
if (t <= -1.22e+67) {
tmp = x + y;
} else if (t <= -1e-126) {
tmp = t_1;
} else if (t <= 2.1e-184) {
tmp = x + (y * ((z - t) / a));
} else if (t <= 4.8e+107) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (a - t))) tmp = 0 if t <= -1.22e+67: tmp = x + y elif t <= -1e-126: tmp = t_1 elif t <= 2.1e-184: tmp = x + (y * ((z - t) / a)) elif t <= 4.8e+107: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(a - t)))) tmp = 0.0 if (t <= -1.22e+67) tmp = Float64(x + y); elseif (t <= -1e-126) tmp = t_1; elseif (t <= 2.1e-184) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (t <= 4.8e+107) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (a - t))); tmp = 0.0; if (t <= -1.22e+67) tmp = x + y; elseif (t <= -1e-126) tmp = t_1; elseif (t <= 2.1e-184) tmp = x + (y * ((z - t) / a)); elseif (t <= 4.8e+107) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.22e+67], N[(x + y), $MachinePrecision], If[LessEqual[t, -1e-126], t$95$1, If[LessEqual[t, 2.1e-184], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e+107], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a - t}\\
\mathbf{if}\;t \leq -1.22 \cdot 10^{+67}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-184}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+107}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.22000000000000004e67 or 4.8000000000000001e107 < t Initial program 70.0%
+-commutative70.0%
associate-*l/96.8%
fma-def96.8%
Simplified96.8%
Taylor expanded in t around inf 84.8%
+-commutative84.8%
Simplified84.8%
if -1.22000000000000004e67 < t < -9.9999999999999995e-127 or 2.0999999999999999e-184 < t < 4.8000000000000001e107Initial program 93.6%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 77.3%
associate-*l/83.3%
*-commutative83.3%
Simplified83.3%
if -9.9999999999999995e-127 < t < 2.0999999999999999e-184Initial program 97.1%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.9%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 94.6%
Final simplification86.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* z (/ y (- a t))))))
(if (<= z -2.6e+77)
t_1
(if (<= z -5.1e-31)
(- x (/ y (/ t (- z t))))
(if (<= z -6e-58)
(+ x (/ z (/ (- a t) y)))
(if (<= z 1.15e-142) (- x (/ y (+ (/ a t) -1.0))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (z * (y / (a - t)));
double tmp;
if (z <= -2.6e+77) {
tmp = t_1;
} else if (z <= -5.1e-31) {
tmp = x - (y / (t / (z - t)));
} else if (z <= -6e-58) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 1.15e-142) {
tmp = x - (y / ((a / t) + -1.0));
} 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 + (z * (y / (a - t)))
if (z <= (-2.6d+77)) then
tmp = t_1
else if (z <= (-5.1d-31)) then
tmp = x - (y / (t / (z - t)))
else if (z <= (-6d-58)) then
tmp = x + (z / ((a - t) / y))
else if (z <= 1.15d-142) then
tmp = x - (y / ((a / t) + (-1.0d0)))
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 + (z * (y / (a - t)));
double tmp;
if (z <= -2.6e+77) {
tmp = t_1;
} else if (z <= -5.1e-31) {
tmp = x - (y / (t / (z - t)));
} else if (z <= -6e-58) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 1.15e-142) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (z * (y / (a - t))) tmp = 0 if z <= -2.6e+77: tmp = t_1 elif z <= -5.1e-31: tmp = x - (y / (t / (z - t))) elif z <= -6e-58: tmp = x + (z / ((a - t) / y)) elif z <= 1.15e-142: tmp = x - (y / ((a / t) + -1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(z * Float64(y / Float64(a - t)))) tmp = 0.0 if (z <= -2.6e+77) tmp = t_1; elseif (z <= -5.1e-31) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); elseif (z <= -6e-58) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); elseif (z <= 1.15e-142) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (z * (y / (a - t))); tmp = 0.0; if (z <= -2.6e+77) tmp = t_1; elseif (z <= -5.1e-31) tmp = x - (y / (t / (z - t))); elseif (z <= -6e-58) tmp = x + (z / ((a - t) / y)); elseif (z <= 1.15e-142) tmp = x - (y / ((a / t) + -1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+77], t$95$1, If[LessEqual[z, -5.1e-31], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6e-58], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-142], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{a - t}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-31}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-58}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-142}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.6000000000000002e77 or 1.15000000000000001e-142 < z Initial program 87.4%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around inf 84.0%
associate-*l/91.0%
*-commutative91.0%
Simplified91.0%
if -2.6000000000000002e77 < z < -5.0999999999999997e-31Initial program 85.9%
+-commutative85.9%
associate-*l/95.2%
fma-def95.2%
Simplified95.2%
Taylor expanded in a around 0 81.0%
mul-1-neg81.0%
unsub-neg81.0%
associate-/l*95.0%
Simplified95.0%
if -5.0999999999999997e-31 < z < -6.00000000000000015e-58Initial program 80.0%
+-commutative80.0%
associate-*l/99.7%
fma-def99.7%
Simplified99.7%
fma-udef99.7%
clear-num100.0%
associate-*l/100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 100.0%
associate-/l*100.0%
associate-/r/99.7%
Simplified99.7%
*-commutative99.7%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
if -6.00000000000000015e-58 < z < 1.15000000000000001e-142Initial program 88.5%
+-commutative88.5%
associate-*l/91.9%
fma-def91.9%
Simplified91.9%
Taylor expanded in z around 0 80.6%
mul-1-neg80.6%
unsub-neg80.6%
*-commutative80.6%
associate-/l*91.0%
div-sub91.0%
sub-neg91.0%
*-inverses91.0%
metadata-eval91.0%
Simplified91.0%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e+66) (not (<= t 1.85e+105))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+66) || !(t <= 1.85e+105)) {
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+66)) .or. (.not. (t <= 1.85d+105))) 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+66) || !(t <= 1.85e+105)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e+66) or not (t <= 1.85e+105): 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+66) || !(t <= 1.85e+105)) 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+66) || ~((t <= 1.85e+105))) 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+66], N[Not[LessEqual[t, 1.85e+105]], $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^{+66} \lor \neg \left(t \leq 1.85 \cdot 10^{+105}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -6.9999999999999994e66 or 1.84999999999999992e105 < t Initial program 70.0%
+-commutative70.0%
associate-*l/96.8%
fma-def96.8%
Simplified96.8%
Taylor expanded in t around inf 84.8%
+-commutative84.8%
Simplified84.8%
if -6.9999999999999994e66 < t < 1.84999999999999992e105Initial program 94.9%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in z around inf 81.8%
associate-*l/84.6%
*-commutative84.6%
Simplified84.6%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e-55) (not (<= t 1.4e+87))) (+ x (* (/ y t) (- t z))) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e-55) || !(t <= 1.4e+87)) {
tmp = x + ((y / t) * (t - z));
} else {
tmp = x + (z / ((a - t) / 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.45d-55)) .or. (.not. (t <= 1.4d+87))) then
tmp = x + ((y / t) * (t - z))
else
tmp = x + (z / ((a - t) / 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.45e-55) || !(t <= 1.4e+87)) {
tmp = x + ((y / t) * (t - z));
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e-55) or not (t <= 1.4e+87): tmp = x + ((y / t) * (t - z)) else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e-55) || !(t <= 1.4e+87)) tmp = Float64(x + Float64(Float64(y / t) * Float64(t - z))); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.45e-55) || ~((t <= 1.4e+87))) tmp = x + ((y / t) * (t - z)); else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e-55], N[Not[LessEqual[t, 1.4e+87]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-55} \lor \neg \left(t \leq 1.4 \cdot 10^{+87}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -1.45e-55 or 1.40000000000000008e87 < t Initial program 76.1%
+-commutative76.1%
associate-*l/96.9%
fma-def96.9%
Simplified96.9%
Taylor expanded in a around 0 68.7%
mul-1-neg68.7%
unsub-neg68.7%
associate-/l*88.3%
Simplified88.3%
associate-/r/86.2%
Applied egg-rr86.2%
if -1.45e-55 < t < 1.40000000000000008e87Initial program 95.8%
+-commutative95.8%
associate-*l/94.9%
fma-def94.9%
Simplified94.9%
fma-udef94.9%
clear-num94.8%
associate-*l/95.1%
*-un-lft-identity95.1%
Applied egg-rr95.1%
Taylor expanded in z around inf 85.8%
associate-/l*89.0%
associate-/r/87.2%
Simplified87.2%
*-commutative87.2%
clear-num87.1%
un-div-inv87.4%
Applied egg-rr87.4%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+37) (not (<= z 1.15e-141))) (+ x (* z (/ y (- a t)))) (- x (/ y (+ (/ a t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+37) || !(z <= 1.15e-141)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
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.5d+37)) .or. (.not. (z <= 1.15d-141))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (y / ((a / t) + (-1.0d0)))
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.5e+37) || !(z <= 1.15e-141)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+37) or not (z <= 1.15e-141): tmp = x + (z * (y / (a - t))) else: tmp = x - (y / ((a / t) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+37) || !(z <= 1.15e-141)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.5e+37) || ~((z <= 1.15e-141))) tmp = x + (z * (y / (a - t))); else tmp = x - (y / ((a / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+37], N[Not[LessEqual[z, 1.15e-141]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+37} \lor \neg \left(z \leq 1.15 \cdot 10^{-141}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\end{array}
\end{array}
if z < -1.50000000000000011e37 or 1.14999999999999997e-141 < z Initial program 87.5%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in z around inf 84.2%
associate-*l/90.8%
*-commutative90.8%
Simplified90.8%
if -1.50000000000000011e37 < z < 1.14999999999999997e-141Initial program 87.6%
+-commutative87.6%
associate-*l/92.2%
fma-def92.2%
Simplified92.2%
Taylor expanded in z around 0 77.3%
mul-1-neg77.3%
unsub-neg77.3%
*-commutative77.3%
associate-/l*88.7%
div-sub88.8%
sub-neg88.8%
*-inverses88.8%
metadata-eval88.8%
Simplified88.8%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.6e-57) (not (<= t 1.35e-31))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.6e-57) || !(t <= 1.35e-31)) {
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.6d-57)) .or. (.not. (t <= 1.35d-31))) 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.6e-57) || !(t <= 1.35e-31)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.6e-57) or not (t <= 1.35e-31): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.6e-57) || !(t <= 1.35e-31)) tmp = Float64(x + y); 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.6e-57) || ~((t <= 1.35e-31))) 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.6e-57], N[Not[LessEqual[t, 1.35e-31]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-57} \lor \neg \left(t \leq 1.35 \cdot 10^{-31}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.6e-57 or 1.35000000000000007e-31 < t Initial program 77.9%
+-commutative77.9%
associate-*l/97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in t around inf 76.9%
+-commutative76.9%
Simplified76.9%
if -1.6e-57 < t < 1.35000000000000007e-31Initial program 97.3%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in t around 0 77.8%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e-53) (not (<= t 1.1e-30))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e-53) || !(t <= 1.1e-30)) {
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-53)) .or. (.not. (t <= 1.1d-30))) 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-53) || !(t <= 1.1e-30)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e-53) or not (t <= 1.1e-30): 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-53) || !(t <= 1.1e-30)) 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-53) || ~((t <= 1.1e-30))) 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-53], N[Not[LessEqual[t, 1.1e-30]], $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^{-53} \lor \neg \left(t \leq 1.1 \cdot 10^{-30}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.04999999999999989e-53 or 1.09999999999999992e-30 < t Initial program 77.9%
+-commutative77.9%
associate-*l/97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in t around inf 76.9%
+-commutative76.9%
Simplified76.9%
if -1.04999999999999989e-53 < t < 1.09999999999999992e-30Initial program 97.3%
+-commutative97.3%
associate-*l/94.0%
fma-def94.0%
Simplified94.0%
Taylor expanded in t around 0 77.8%
+-commutative77.8%
associate-/l*78.8%
Simplified78.8%
clear-num78.8%
associate-/r/78.8%
clear-num78.8%
Applied egg-rr78.8%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.5e-54) (not (<= t 5.1e-30))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e-54) || !(t <= 5.1e-30)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-7.5d-54)) .or. (.not. (t <= 5.1d-30))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e-54) || !(t <= 5.1e-30)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.5e-54) or not (t <= 5.1e-30): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.5e-54) || !(t <= 5.1e-30)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.5e-54) || ~((t <= 5.1e-30))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.5e-54], N[Not[LessEqual[t, 5.1e-30]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-54} \lor \neg \left(t \leq 5.1 \cdot 10^{-30}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -7.5000000000000005e-54 or 5.09999999999999972e-30 < t Initial program 77.9%
+-commutative77.9%
associate-*l/97.4%
fma-def97.4%
Simplified97.4%
Taylor expanded in t around inf 76.9%
+-commutative76.9%
Simplified76.9%
if -7.5000000000000005e-54 < t < 5.09999999999999972e-30Initial program 97.3%
+-commutative97.3%
associate-*l/94.0%
fma-def94.0%
Simplified94.0%
Taylor expanded in t around 0 77.8%
+-commutative77.8%
associate-/l*78.8%
Simplified78.8%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.8e-56) (not (<= t 1.66e-124))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.8e-56) || !(t <= 1.66e-124)) {
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 <= (-5.8d-56)) .or. (.not. (t <= 1.66d-124))) 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 <= -5.8e-56) || !(t <= 1.66e-124)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.8e-56) or not (t <= 1.66e-124): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.8e-56) || !(t <= 1.66e-124)) 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 <= -5.8e-56) || ~((t <= 1.66e-124))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.8e-56], N[Not[LessEqual[t, 1.66e-124]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-56} \lor \neg \left(t \leq 1.66 \cdot 10^{-124}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.79999999999999982e-56 or 1.6599999999999999e-124 < t Initial program 80.4%
+-commutative80.4%
associate-*l/97.2%
fma-def97.2%
Simplified97.2%
Taylor expanded in t around inf 70.2%
+-commutative70.2%
Simplified70.2%
if -5.79999999999999982e-56 < t < 1.6599999999999999e-124Initial program 98.0%
+-commutative98.0%
associate-*l/93.6%
fma-def93.6%
Simplified93.6%
Taylor expanded in y around 0 46.9%
Final simplification60.7%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 87.5%
associate-/l*98.8%
Simplified98.8%
associate-/r/95.7%
Applied egg-rr95.7%
Final simplification95.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 87.5%
associate-/l*98.8%
Simplified98.8%
clear-num98.7%
associate-/r/98.7%
clear-num98.7%
Applied egg-rr98.7%
Final simplification98.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 87.5%
+-commutative87.5%
associate-*l/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in y around 0 48.2%
Final simplification48.2%
(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 2024020
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))