
(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 (/ (- z t) (- t a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (t - a)));
}
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) / (t - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (t - a)));
}
def code(x, y, z, t, a): return x - (y * ((z - t) / (t - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(z - t) / Float64(t - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((z - t) / (t - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{z - t}{t - a}
\end{array}
Initial program 86.6%
associate-/l*97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7e-71)
(+ x y)
(if (<= t 6.5e-84)
(+ x (/ y (/ a z)))
(if (<= t 1.2e+100) (- x (/ z (/ t y))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e-71) {
tmp = x + y;
} else if (t <= 6.5e-84) {
tmp = x + (y / (a / z));
} else if (t <= 1.2e+100) {
tmp = x - (z / (t / y));
} 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 <= (-7d-71)) then
tmp = x + y
else if (t <= 6.5d-84) then
tmp = x + (y / (a / z))
else if (t <= 1.2d+100) then
tmp = x - (z / (t / y))
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 <= -7e-71) {
tmp = x + y;
} else if (t <= 6.5e-84) {
tmp = x + (y / (a / z));
} else if (t <= 1.2e+100) {
tmp = x - (z / (t / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e-71: tmp = x + y elif t <= 6.5e-84: tmp = x + (y / (a / z)) elif t <= 1.2e+100: tmp = x - (z / (t / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e-71) tmp = Float64(x + y); elseif (t <= 6.5e-84) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 1.2e+100) tmp = Float64(x - Float64(z / Float64(t / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e-71) tmp = x + y; elseif (t <= 6.5e-84) tmp = x + (y / (a / z)); elseif (t <= 1.2e+100) tmp = x - (z / (t / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e-71], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.5e-84], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+100], N[(x - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-71}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+100}:\\
\;\;\;\;x - \frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.9999999999999998e-71 or 1.20000000000000006e100 < t Initial program 76.4%
+-commutative76.4%
*-commutative76.4%
associate-/l*94.2%
fma-define94.2%
Simplified94.2%
Taylor expanded in t around inf 72.1%
+-commutative72.1%
Simplified72.1%
if -6.9999999999999998e-71 < t < 6.50000000000000022e-84Initial program 95.5%
+-commutative95.5%
*-commutative95.5%
associate-/l*93.0%
fma-define92.9%
Simplified92.9%
Taylor expanded in t around 0 84.3%
+-commutative84.3%
associate-/l*85.4%
Simplified85.4%
clear-num85.3%
un-div-inv85.4%
Applied egg-rr85.4%
if 6.50000000000000022e-84 < t < 1.20000000000000006e100Initial program 95.2%
+-commutative95.2%
*-commutative95.2%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
fma-undefine99.7%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 86.7%
Taylor expanded in a around 0 79.4%
neg-mul-179.4%
distribute-neg-frac79.4%
Simplified79.4%
Final simplification78.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.22e-70)
(+ x y)
(if (<= t 9e-82)
(+ x (/ y (/ a z)))
(if (<= t 3.8e+99) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.22e-70) {
tmp = x + y;
} else if (t <= 9e-82) {
tmp = x + (y / (a / z));
} else if (t <= 3.8e+99) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.22d-70)) then
tmp = x + y
else if (t <= 9d-82) then
tmp = x + (y / (a / z))
else if (t <= 3.8d+99) then
tmp = x - (y * (z / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.22e-70) {
tmp = x + y;
} else if (t <= 9e-82) {
tmp = x + (y / (a / z));
} else if (t <= 3.8e+99) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.22e-70: tmp = x + y elif t <= 9e-82: tmp = x + (y / (a / z)) elif t <= 3.8e+99: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.22e-70) tmp = Float64(x + y); elseif (t <= 9e-82) tmp = Float64(x + Float64(y / Float64(a / z))); elseif (t <= 3.8e+99) tmp = Float64(x - Float64(y * Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.22e-70) tmp = x + y; elseif (t <= 9e-82) tmp = x + (y / (a / z)); elseif (t <= 3.8e+99) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.22e-70], N[(x + y), $MachinePrecision], If[LessEqual[t, 9e-82], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+99], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{-70}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-82}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+99}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.22e-70 or 3.8e99 < t Initial program 76.4%
+-commutative76.4%
*-commutative76.4%
associate-/l*94.2%
fma-define94.2%
Simplified94.2%
Taylor expanded in t around inf 72.1%
+-commutative72.1%
Simplified72.1%
if -1.22e-70 < t < 8.9999999999999997e-82Initial program 95.5%
+-commutative95.5%
*-commutative95.5%
associate-/l*93.0%
fma-define92.9%
Simplified92.9%
Taylor expanded in t around 0 84.3%
+-commutative84.3%
associate-/l*85.4%
Simplified85.4%
clear-num85.3%
un-div-inv85.4%
Applied egg-rr85.4%
if 8.9999999999999997e-82 < t < 3.8e99Initial program 95.2%
+-commutative95.2%
*-commutative95.2%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 78.2%
+-commutative78.2%
mul-1-neg78.2%
Simplified78.2%
Taylor expanded in z around inf 77.2%
mul-1-neg77.2%
associate-/l*79.4%
distribute-rgt-neg-in79.4%
distribute-neg-frac279.4%
Simplified79.4%
Taylor expanded in y around 0 77.2%
mul-1-neg77.2%
associate-*r/79.4%
unsub-neg79.4%
Simplified79.4%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.3e+82) (not (<= t 1.65e+181))) (+ x y) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e+82) || !(t <= 1.65e+181)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (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 ((t <= (-2.3d+82)) .or. (.not. (t <= 1.65d+181))) then
tmp = x + y
else
tmp = x - (y * (z / (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 ((t <= -2.3e+82) || !(t <= 1.65e+181)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.3e+82) or not (t <= 1.65e+181): tmp = x + y else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e+82) || !(t <= 1.65e+181)) tmp = Float64(x + y); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.3e+82) || ~((t <= 1.65e+181))) tmp = x + y; else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e+82], N[Not[LessEqual[t, 1.65e+181]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+82} \lor \neg \left(t \leq 1.65 \cdot 10^{+181}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -2.29999999999999988e82 or 1.65000000000000008e181 < t Initial program 71.5%
+-commutative71.5%
*-commutative71.5%
associate-/l*91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in t around inf 83.9%
+-commutative83.9%
Simplified83.9%
if -2.29999999999999988e82 < t < 1.65000000000000008e181Initial program 92.1%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 81.6%
associate-/l*84.8%
Simplified84.8%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.4e-45) (- x (/ z (/ (- t a) y))) (if (<= z 8.8e-48) (+ x (* y (/ t (- t a)))) (- x (* y (/ z (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e-45) {
tmp = x - (z / ((t - a) / y));
} else if (z <= 8.8e-48) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x - (y * (z / (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 <= (-4.4d-45)) then
tmp = x - (z / ((t - a) / y))
else if (z <= 8.8d-48) then
tmp = x + (y * (t / (t - a)))
else
tmp = x - (y * (z / (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 <= -4.4e-45) {
tmp = x - (z / ((t - a) / y));
} else if (z <= 8.8e-48) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e-45: tmp = x - (z / ((t - a) / y)) elif z <= 8.8e-48: tmp = x + (y * (t / (t - a))) else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e-45) tmp = Float64(x - Float64(z / Float64(Float64(t - a) / y))); elseif (z <= 8.8e-48) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.4e-45) tmp = x - (z / ((t - a) / y)); elseif (z <= 8.8e-48) tmp = x + (y * (t / (t - a))); else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e-45], N[(x - N[(z / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e-48], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-45}:\\
\;\;\;\;x - \frac{z}{\frac{t - a}{y}}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-48}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < -4.39999999999999987e-45Initial program 85.7%
+-commutative85.7%
*-commutative85.7%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
fma-undefine95.2%
clear-num95.3%
un-div-inv95.3%
Applied egg-rr95.3%
Taylor expanded in z around inf 88.7%
if -4.39999999999999987e-45 < z < 8.8000000000000005e-48Initial program 86.5%
+-commutative86.5%
*-commutative86.5%
associate-/l*93.3%
fma-define93.3%
Simplified93.3%
Taylor expanded in z around 0 80.7%
mul-1-neg80.7%
unsub-neg80.7%
*-commutative80.7%
*-lft-identity80.7%
times-frac92.5%
/-rgt-identity92.5%
Simplified92.5%
if 8.8000000000000005e-48 < z Initial program 87.5%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 85.7%
associate-/l*93.5%
Simplified93.5%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e-46) (- x (/ z (/ (- t a) y))) (if (<= z 1.34e-42) (+ x (* t (/ y (- t a)))) (- x (* y (/ z (- t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-46) {
tmp = x - (z / ((t - a) / y));
} else if (z <= 1.34e-42) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x - (y * (z / (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 <= (-7.5d-46)) then
tmp = x - (z / ((t - a) / y))
else if (z <= 1.34d-42) then
tmp = x + (t * (y / (t - a)))
else
tmp = x - (y * (z / (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 <= -7.5e-46) {
tmp = x - (z / ((t - a) / y));
} else if (z <= 1.34e-42) {
tmp = x + (t * (y / (t - a)));
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e-46: tmp = x - (z / ((t - a) / y)) elif z <= 1.34e-42: tmp = x + (t * (y / (t - a))) else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e-46) tmp = Float64(x - Float64(z / Float64(Float64(t - a) / y))); elseif (z <= 1.34e-42) tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e-46) tmp = x - (z / ((t - a) / y)); elseif (z <= 1.34e-42) tmp = x + (t * (y / (t - a))); else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e-46], N[(x - N[(z / N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.34e-42], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-46}:\\
\;\;\;\;x - \frac{z}{\frac{t - a}{y}}\\
\mathbf{elif}\;z \leq 1.34 \cdot 10^{-42}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if z < -7.50000000000000027e-46Initial program 85.7%
+-commutative85.7%
*-commutative85.7%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
fma-undefine95.2%
clear-num95.3%
un-div-inv95.3%
Applied egg-rr95.3%
Taylor expanded in z around inf 88.7%
if -7.50000000000000027e-46 < z < 1.34e-42Initial program 86.5%
+-commutative86.5%
*-commutative86.5%
associate-/l*93.3%
fma-define93.3%
Simplified93.3%
fma-undefine93.3%
clear-num93.2%
un-div-inv94.1%
Applied egg-rr94.1%
Taylor expanded in z around 0 80.7%
mul-1-neg80.7%
associate-*r/90.7%
unsub-neg90.7%
Simplified90.7%
if 1.34e-42 < z Initial program 87.5%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 85.7%
associate-/l*93.5%
Simplified93.5%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.85e-72) (not (<= t 5e-66))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.85e-72) || !(t <= 5e-66)) {
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 <= (-1.85d-72)) .or. (.not. (t <= 5d-66))) 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 <= -1.85e-72) || !(t <= 5e-66)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.85e-72) or not (t <= 5e-66): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.85e-72) || !(t <= 5e-66)) 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 <= -1.85e-72) || ~((t <= 5e-66))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.85e-72], N[Not[LessEqual[t, 5e-66]], $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 -1.85 \cdot 10^{-72} \lor \neg \left(t \leq 5 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.8499999999999999e-72 or 4.99999999999999962e-66 < t Initial program 80.9%
+-commutative80.9%
*-commutative80.9%
associate-/l*95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -1.8499999999999999e-72 < t < 4.99999999999999962e-66Initial program 95.6%
+-commutative95.6%
*-commutative95.6%
associate-/l*93.1%
fma-define93.1%
Simplified93.1%
Taylor expanded in t around 0 83.6%
+-commutative83.6%
associate-/l*84.6%
Simplified84.6%
clear-num84.6%
un-div-inv84.6%
Applied egg-rr84.6%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.5e-71) (not (<= t 3.4e-66))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.5e-71) || !(t <= 3.4e-66)) {
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 <= (-8.5d-71)) .or. (.not. (t <= 3.4d-66))) 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 <= -8.5e-71) || !(t <= 3.4e-66)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.5e-71) or not (t <= 3.4e-66): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.5e-71) || !(t <= 3.4e-66)) 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 <= -8.5e-71) || ~((t <= 3.4e-66))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.5e-71], N[Not[LessEqual[t, 3.4e-66]], $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 -8.5 \cdot 10^{-71} \lor \neg \left(t \leq 3.4 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -8.49999999999999988e-71 or 3.39999999999999997e-66 < t Initial program 80.9%
+-commutative80.9%
*-commutative80.9%
associate-/l*95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -8.49999999999999988e-71 < t < 3.39999999999999997e-66Initial program 95.6%
+-commutative95.6%
*-commutative95.6%
associate-/l*93.1%
fma-define93.1%
Simplified93.1%
Taylor expanded in t around 0 83.6%
+-commutative83.6%
associate-/l*84.6%
Simplified84.6%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.3e-71) (not (<= t 4.5e-66))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e-71) || !(t <= 4.5e-66)) {
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 <= (-2.3d-71)) .or. (.not. (t <= 4.5d-66))) 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 <= -2.3e-71) || !(t <= 4.5e-66)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.3e-71) or not (t <= 4.5e-66): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e-71) || !(t <= 4.5e-66)) 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 <= -2.3e-71) || ~((t <= 4.5e-66))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e-71], N[Not[LessEqual[t, 4.5e-66]], $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 -2.3 \cdot 10^{-71} \lor \neg \left(t \leq 4.5 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2.2999999999999998e-71 or 4.4999999999999998e-66 < t Initial program 80.9%
+-commutative80.9%
*-commutative80.9%
associate-/l*95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -2.2999999999999998e-71 < t < 4.4999999999999998e-66Initial program 95.6%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in t around 0 83.6%
Final simplification73.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.5e-71) (not (<= t 3.6e-66))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.5e-71) || !(t <= 3.6e-66)) {
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 <= (-9.5d-71)) .or. (.not. (t <= 3.6d-66))) 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 <= -9.5e-71) || !(t <= 3.6e-66)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.5e-71) or not (t <= 3.6e-66): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.5e-71) || !(t <= 3.6e-66)) 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 <= -9.5e-71) || ~((t <= 3.6e-66))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.5e-71], N[Not[LessEqual[t, 3.6e-66]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-71} \lor \neg \left(t \leq 3.6 \cdot 10^{-66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.4999999999999994e-71 or 3.60000000000000012e-66 < t Initial program 80.9%
+-commutative80.9%
*-commutative80.9%
associate-/l*95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in t around inf 67.8%
+-commutative67.8%
Simplified67.8%
if -9.4999999999999994e-71 < t < 3.60000000000000012e-66Initial program 95.6%
+-commutative95.6%
*-commutative95.6%
associate-/l*93.1%
fma-define93.1%
Simplified93.1%
Taylor expanded in y around 0 54.2%
Final simplification62.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 86.6%
+-commutative86.6%
*-commutative86.6%
associate-/l*94.6%
fma-define94.6%
Simplified94.6%
Taylor expanded in y around 0 52.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 2024180
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))