
(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 (+ 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 85.5%
associate-/l*97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ z (/ t y)))))
(if (<= t -2.1e+136)
(+ x y)
(if (<= t -6.8e-44)
t_1
(if (<= t -2.1e-111)
(+ x (* y (/ z a)))
(if (<= t -2.2e-174)
t_1
(if (<= t -4.5e-272)
(+ x (/ (* y z) a))
(if (<= t 1.36e-34) (+ x (/ y (/ a z))) (+ x y)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (z / (t / y));
double tmp;
if (t <= -2.1e+136) {
tmp = x + y;
} else if (t <= -6.8e-44) {
tmp = t_1;
} else if (t <= -2.1e-111) {
tmp = x + (y * (z / a));
} else if (t <= -2.2e-174) {
tmp = t_1;
} else if (t <= -4.5e-272) {
tmp = x + ((y * z) / a);
} else if (t <= 1.36e-34) {
tmp = x + (y / (a / z));
} 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 / (t / y))
if (t <= (-2.1d+136)) then
tmp = x + y
else if (t <= (-6.8d-44)) then
tmp = t_1
else if (t <= (-2.1d-111)) then
tmp = x + (y * (z / a))
else if (t <= (-2.2d-174)) then
tmp = t_1
else if (t <= (-4.5d-272)) then
tmp = x + ((y * z) / a)
else if (t <= 1.36d-34) then
tmp = x + (y / (a / z))
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 / (t / y));
double tmp;
if (t <= -2.1e+136) {
tmp = x + y;
} else if (t <= -6.8e-44) {
tmp = t_1;
} else if (t <= -2.1e-111) {
tmp = x + (y * (z / a));
} else if (t <= -2.2e-174) {
tmp = t_1;
} else if (t <= -4.5e-272) {
tmp = x + ((y * z) / a);
} else if (t <= 1.36e-34) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (z / (t / y)) tmp = 0 if t <= -2.1e+136: tmp = x + y elif t <= -6.8e-44: tmp = t_1 elif t <= -2.1e-111: tmp = x + (y * (z / a)) elif t <= -2.2e-174: tmp = t_1 elif t <= -4.5e-272: tmp = x + ((y * z) / a) elif t <= 1.36e-34: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(z / Float64(t / y))) tmp = 0.0 if (t <= -2.1e+136) tmp = Float64(x + y); elseif (t <= -6.8e-44) tmp = t_1; elseif (t <= -2.1e-111) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= -2.2e-174) tmp = t_1; elseif (t <= -4.5e-272) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= 1.36e-34) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (z / (t / y)); tmp = 0.0; if (t <= -2.1e+136) tmp = x + y; elseif (t <= -6.8e-44) tmp = t_1; elseif (t <= -2.1e-111) tmp = x + (y * (z / a)); elseif (t <= -2.2e-174) tmp = t_1; elseif (t <= -4.5e-272) tmp = x + ((y * z) / a); elseif (t <= 1.36e-34) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e+136], N[(x + y), $MachinePrecision], If[LessEqual[t, -6.8e-44], t$95$1, If[LessEqual[t, -2.1e-111], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.2e-174], t$95$1, If[LessEqual[t, -4.5e-272], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e-34], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{z}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -6.8 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-111}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{-174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-272}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 1.36 \cdot 10^{-34}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.0999999999999999e136 or 1.3600000000000001e-34 < t Initial program 74.7%
+-commutative74.7%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 84.4%
if -2.0999999999999999e136 < t < -6.80000000000000033e-44 or -2.0999999999999999e-111 < t < -2.20000000000000022e-174Initial program 94.9%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in z around inf 86.4%
associate-*l/89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in a around 0 77.0%
+-commutative77.0%
mul-1-neg77.0%
unsub-neg77.0%
associate-*l/78.7%
*-commutative78.7%
Simplified78.7%
clear-num78.7%
un-div-inv80.5%
Applied egg-rr80.5%
if -6.80000000000000033e-44 < t < -2.0999999999999999e-111Initial program 86.3%
+-commutative86.3%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 78.7%
if -2.20000000000000022e-174 < t < -4.4999999999999998e-272Initial program 98.8%
+-commutative98.8%
associate-*r/95.3%
fma-def95.3%
Simplified95.3%
Taylor expanded in t around 0 77.4%
if -4.4999999999999998e-272 < t < 1.3600000000000001e-34Initial program 95.6%
+-commutative95.6%
associate-*r/93.8%
fma-def93.8%
Simplified93.8%
Taylor expanded in t around 0 79.0%
associate-/l*83.2%
Simplified83.2%
Final simplification82.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.4e+136)
(+ x y)
(if (<= t -1.3e-43)
(- x (* z (/ y t)))
(if (<= t 1.06e-34) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.4e+136) {
tmp = x + y;
} else if (t <= -1.3e-43) {
tmp = x - (z * (y / t));
} else if (t <= 1.06e-34) {
tmp = x + (y / (a / z));
} 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 <= (-3.4d+136)) then
tmp = x + y
else if (t <= (-1.3d-43)) then
tmp = x - (z * (y / t))
else if (t <= 1.06d-34) then
tmp = x + (y / (a / z))
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 <= -3.4e+136) {
tmp = x + y;
} else if (t <= -1.3e-43) {
tmp = x - (z * (y / t));
} else if (t <= 1.06e-34) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.4e+136: tmp = x + y elif t <= -1.3e-43: tmp = x - (z * (y / t)) elif t <= 1.06e-34: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.4e+136) tmp = Float64(x + y); elseif (t <= -1.3e-43) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 1.06e-34) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.4e+136) tmp = x + y; elseif (t <= -1.3e-43) tmp = x - (z * (y / t)); elseif (t <= 1.06e-34) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.4e+136], N[(x + y), $MachinePrecision], If[LessEqual[t, -1.3e-43], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.06e-34], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-43}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{-34}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.39999999999999997e136 or 1.06000000000000006e-34 < t Initial program 74.7%
+-commutative74.7%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 84.4%
if -3.39999999999999997e136 < t < -1.3e-43Initial program 93.1%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around inf 81.5%
associate-*l/88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in a around 0 74.0%
+-commutative74.0%
mul-1-neg74.0%
unsub-neg74.0%
associate-*l/78.5%
*-commutative78.5%
Simplified78.5%
if -1.3e-43 < t < 1.06000000000000006e-34Initial program 95.6%
+-commutative95.6%
associate-*r/92.9%
fma-def92.9%
Simplified92.9%
Taylor expanded in t around 0 74.9%
associate-/l*76.8%
Simplified76.8%
Final simplification80.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.6e+137) (not (<= t 1.15e-9))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.6e+137) || !(t <= 1.15e-9)) {
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 <= (-4.6d+137)) .or. (.not. (t <= 1.15d-9))) 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 <= -4.6e+137) || !(t <= 1.15e-9)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.6e+137) or not (t <= 1.15e-9): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.6e+137) || !(t <= 1.15e-9)) 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 <= -4.6e+137) || ~((t <= 1.15e-9))) 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, -4.6e+137], N[Not[LessEqual[t, 1.15e-9]], $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 -4.6 \cdot 10^{+137} \lor \neg \left(t \leq 1.15 \cdot 10^{-9}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -4.59999999999999999e137 or 1.15e-9 < t Initial program 72.8%
+-commutative72.8%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 84.9%
if -4.59999999999999999e137 < t < 1.15e-9Initial program 95.1%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around inf 86.0%
associate-*l/88.6%
*-commutative88.6%
Simplified88.6%
Final simplification87.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.05e+40) (not (<= t 9.5e-36))) (+ x (- y (* z (/ y t)))) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e+40) || !(t <= 9.5e-36)) {
tmp = x + (y - (z * (y / 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 <= (-2.05d+40)) .or. (.not. (t <= 9.5d-36))) then
tmp = x + (y - (z * (y / 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 <= -2.05e+40) || !(t <= 9.5e-36)) {
tmp = x + (y - (z * (y / t)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.05e+40) or not (t <= 9.5e-36): tmp = x + (y - (z * (y / t))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.05e+40) || !(t <= 9.5e-36)) tmp = Float64(x + Float64(y - Float64(z * Float64(y / 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 <= -2.05e+40) || ~((t <= 9.5e-36))) tmp = x + (y - (z * (y / t))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.05e+40], N[Not[LessEqual[t, 9.5e-36]], $MachinePrecision]], N[(x + N[(y - N[(z * N[(y / t), $MachinePrecision]), $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 -2.05 \cdot 10^{+40} \lor \neg \left(t \leq 9.5 \cdot 10^{-36}\right):\\
\;\;\;\;x + \left(y - z \cdot \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.0500000000000001e40 or 9.5000000000000003e-36 < t Initial program 77.1%
associate-*l/95.4%
Simplified95.4%
Taylor expanded in a around 0 86.4%
associate-*r/86.4%
neg-mul-186.4%
Simplified86.4%
Taylor expanded in t around 0 84.9%
+-commutative84.9%
mul-1-neg84.9%
unsub-neg84.9%
associate-*l/91.0%
*-commutative91.0%
Simplified91.0%
if -2.0500000000000001e40 < t < 9.5000000000000003e-36Initial program 95.5%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in z around inf 88.2%
associate-*l/90.0%
*-commutative90.0%
Simplified90.0%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.42e+20) (not (<= z 7.6e-31))) (+ 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.42e+20) || !(z <= 7.6e-31)) {
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.42d+20)) .or. (.not. (z <= 7.6d-31))) 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.42e+20) || !(z <= 7.6e-31)) {
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.42e+20) or not (z <= 7.6e-31): 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.42e+20) || !(z <= 7.6e-31)) 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.42e+20) || ~((z <= 7.6e-31))) 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.42e+20], N[Not[LessEqual[z, 7.6e-31]], $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.42 \cdot 10^{+20} \lor \neg \left(z \leq 7.6 \cdot 10^{-31}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\end{array}
\end{array}
if z < -1.42e20 or 7.5999999999999999e-31 < z Initial program 85.4%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in z around inf 81.7%
associate-*l/90.4%
*-commutative90.4%
Simplified90.4%
if -1.42e20 < z < 7.5999999999999999e-31Initial program 85.5%
+-commutative85.5%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around 0 76.8%
+-commutative76.8%
mul-1-neg76.8%
unsub-neg76.8%
associate-/l*91.2%
div-sub91.2%
sub-neg91.2%
*-inverses91.2%
metadata-eval91.2%
Simplified91.2%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.5e+39) (not (<= t 1.45e-36))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.5e+39) || !(t <= 1.45e-36)) {
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 <= (-9.5d+39)) .or. (.not. (t <= 1.45d-36))) 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 <= -9.5e+39) || !(t <= 1.45e-36)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.5e+39) or not (t <= 1.45e-36): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.5e+39) || !(t <= 1.45e-36)) 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 <= -9.5e+39) || ~((t <= 1.45e-36))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.5e+39], N[Not[LessEqual[t, 1.45e-36]], $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 -9.5 \cdot 10^{+39} \lor \neg \left(t \leq 1.45 \cdot 10^{-36}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -9.50000000000000011e39 or 1.45000000000000006e-36 < t Initial program 77.1%
+-commutative77.1%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 80.1%
if -9.50000000000000011e39 < t < 1.45000000000000006e-36Initial program 95.5%
+-commutative95.5%
associate-*r/94.1%
fma-def94.1%
Simplified94.1%
fma-udef94.1%
Applied egg-rr94.1%
Taylor expanded in t around 0 74.9%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.35e+42) (+ x y) (if (<= t 1.56e-34) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e+42) {
tmp = x + y;
} else if (t <= 1.56e-34) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.35d+42)) then
tmp = x + y
else if (t <= 1.56d-34) then
tmp = x + (y / (a / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e+42) {
tmp = x + y;
} else if (t <= 1.56e-34) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.35e+42: tmp = x + y elif t <= 1.56e-34: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.35e+42) tmp = Float64(x + y); elseif (t <= 1.56e-34) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.35e+42) tmp = x + y; elseif (t <= 1.56e-34) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.35e+42], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.56e-34], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+42}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.56 \cdot 10^{-34}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.35e42 or 1.55999999999999992e-34 < t Initial program 77.1%
+-commutative77.1%
associate-*r/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in t around inf 80.1%
if -1.35e42 < t < 1.55999999999999992e-34Initial program 95.5%
+-commutative95.5%
associate-*r/94.1%
fma-def94.1%
Simplified94.1%
Taylor expanded in t around 0 72.5%
associate-/l*74.9%
Simplified74.9%
Final simplification77.8%
(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 85.5%
associate-*l/96.3%
Simplified96.3%
Final simplification96.3%
(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 85.5%
+-commutative85.5%
associate-*r/97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in t around inf 63.0%
Final simplification63.0%
(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 85.5%
+-commutative85.5%
associate-*r/97.3%
fma-def97.3%
Simplified97.3%
Taylor expanded in y around 0 48.5%
Final simplification48.5%
(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 2023224
(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))))