
(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 10 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 83.8%
Taylor expanded in z around 0 83.3%
fma-def83.3%
associate-*r/87.1%
associate-*l/94.0%
*-commutative94.0%
fma-def94.0%
neg-mul-194.0%
+-commutative94.0%
sub-neg94.0%
distribute-rgt-out--94.1%
associate-*l/83.8%
associate-/l*97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8e+15) (not (<= t 3.4e+120))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8e+15) || !(t <= 3.4e+120)) {
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 <= (-8d+15)) .or. (.not. (t <= 3.4d+120))) 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 <= -8e+15) || !(t <= 3.4e+120)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8e+15) or not (t <= 3.4e+120): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8e+15) || !(t <= 3.4e+120)) 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 <= -8e+15) || ~((t <= 3.4e+120))) 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, -8e+15], N[Not[LessEqual[t, 3.4e+120]], $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 -8 \cdot 10^{+15} \lor \neg \left(t \leq 3.4 \cdot 10^{+120}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -8e15 or 3.39999999999999999e120 < t Initial program 68.6%
+-commutative68.6%
associate-*l/96.4%
fma-def96.4%
Simplified96.4%
Taylor expanded in t around inf 87.0%
+-commutative87.0%
Simplified87.0%
if -8e15 < t < 3.39999999999999999e120Initial program 93.4%
Taylor expanded in z around 0 92.7%
fma-def92.7%
associate-*r/87.3%
associate-*l/92.4%
*-commutative92.4%
fma-def92.4%
neg-mul-192.4%
+-commutative92.4%
sub-neg92.4%
distribute-rgt-out--92.6%
associate-*l/93.4%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 85.3%
associate-*l/84.9%
*-commutative84.9%
Simplified84.9%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.26e+14) (not (<= t 7.2e+78))) (+ x y) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.26e+14) || !(t <= 7.2e+78)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.26d+14)) .or. (.not. (t <= 7.2d+78))) then
tmp = x + y
else
tmp = x + ((y * z) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.26e+14) || !(t <= 7.2e+78)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.26e+14) or not (t <= 7.2e+78): tmp = x + y else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.26e+14) || !(t <= 7.2e+78)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.26e+14) || ~((t <= 7.2e+78))) tmp = x + y; else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.26e+14], N[Not[LessEqual[t, 7.2e+78]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.26 \cdot 10^{+14} \lor \neg \left(t \leq 7.2 \cdot 10^{+78}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -1.26e14 or 7.20000000000000039e78 < t Initial program 68.6%
+-commutative68.6%
associate-*l/96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in t around inf 86.0%
+-commutative86.0%
Simplified86.0%
if -1.26e14 < t < 7.20000000000000039e78Initial program 94.3%
Taylor expanded in z around inf 86.6%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+30) (not (<= t 1.8e+120))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+30) || !(t <= 1.8e+120)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.05d+30)) .or. (.not. (t <= 1.8d+120))) then
tmp = x + y
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+30) || !(t <= 1.8e+120)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+30) or not (t <= 1.8e+120): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+30) || !(t <= 1.8e+120)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+30) || ~((t <= 1.8e+120))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+30], N[Not[LessEqual[t, 1.8e+120]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+30} \lor \neg \left(t \leq 1.8 \cdot 10^{+120}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.05e30 or 1.80000000000000008e120 < t Initial program 67.9%
+-commutative67.9%
associate-*l/96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in t around inf 87.3%
+-commutative87.3%
Simplified87.3%
if -1.05e30 < t < 1.80000000000000008e120Initial program 93.0%
+-commutative93.0%
associate-*l/92.9%
fma-def92.9%
Simplified92.9%
fma-udef92.9%
associate-/r/95.8%
div-inv95.8%
clear-num95.8%
Applied egg-rr95.8%
Taylor expanded in z around inf 87.1%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -580000000.0) (not (<= t 5.7e+119))) (- x (/ t (/ (- a t) y))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -580000000.0) || !(t <= 5.7e+119)) {
tmp = x - (t / ((a - t) / y));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-580000000.0d0)) .or. (.not. (t <= 5.7d+119))) then
tmp = x - (t / ((a - t) / y))
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -580000000.0) || !(t <= 5.7e+119)) {
tmp = x - (t / ((a - t) / y));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -580000000.0) or not (t <= 5.7e+119): tmp = x - (t / ((a - t) / y)) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -580000000.0) || !(t <= 5.7e+119)) tmp = Float64(x - Float64(t / Float64(Float64(a - t) / y))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -580000000.0) || ~((t <= 5.7e+119))) tmp = x - (t / ((a - t) / y)); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -580000000.0], N[Not[LessEqual[t, 5.7e+119]], $MachinePrecision]], N[(x - N[(t / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -580000000 \lor \neg \left(t \leq 5.7 \cdot 10^{+119}\right):\\
\;\;\;\;x - \frac{t}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -5.8e8 or 5.7000000000000002e119 < t Initial program 69.2%
+-commutative69.2%
associate-*l/96.5%
fma-def96.5%
Simplified96.5%
Taylor expanded in z around 0 67.7%
associate-*r/90.0%
neg-mul-190.0%
unsub-neg90.0%
associate-*r/67.7%
associate-/l*90.0%
Simplified90.0%
if -5.8e8 < t < 5.7000000000000002e119Initial program 93.3%
+-commutative93.3%
associate-*l/92.5%
fma-def92.5%
Simplified92.5%
fma-udef92.5%
associate-/r/95.6%
div-inv95.6%
clear-num95.6%
Applied egg-rr95.6%
Taylor expanded in z around inf 87.8%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2200000000.0) (- x (/ t (/ (- a t) y))) (if (<= t 3.2e+91) (+ x (* y (/ z (- a t)))) (- x (/ y (/ t (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2200000000.0) {
tmp = x - (t / ((a - t) / y));
} else if (t <= 3.2e+91) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y / (t / (z - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2200000000.0d0)) then
tmp = x - (t / ((a - t) / y))
else if (t <= 3.2d+91) then
tmp = x + (y * (z / (a - t)))
else
tmp = x - (y / (t / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2200000000.0) {
tmp = x - (t / ((a - t) / y));
} else if (t <= 3.2e+91) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y / (t / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2200000000.0: tmp = x - (t / ((a - t) / y)) elif t <= 3.2e+91: tmp = x + (y * (z / (a - t))) else: tmp = x - (y / (t / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2200000000.0) tmp = Float64(x - Float64(t / Float64(Float64(a - t) / y))); elseif (t <= 3.2e+91) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2200000000.0) tmp = x - (t / ((a - t) / y)); elseif (t <= 3.2e+91) tmp = x + (y * (z / (a - t))); else tmp = x - (y / (t / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2200000000.0], N[(x - N[(t / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+91], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2200000000:\\
\;\;\;\;x - \frac{t}{\frac{a - t}{y}}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+91}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\end{array}
\end{array}
if t < -2.2e9Initial program 68.0%
+-commutative68.0%
associate-*l/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in z around 0 65.9%
associate-*r/88.9%
neg-mul-188.9%
unsub-neg88.9%
associate-*r/65.9%
associate-/l*89.0%
Simplified89.0%
if -2.2e9 < t < 3.19999999999999989e91Initial program 94.3%
+-commutative94.3%
associate-*l/92.4%
fma-def92.4%
Simplified92.4%
fma-udef92.4%
associate-/r/95.5%
div-inv95.5%
clear-num95.5%
Applied egg-rr95.5%
Taylor expanded in z around inf 88.4%
if 3.19999999999999989e91 < t Initial program 69.7%
+-commutative69.7%
associate-*l/98.2%
fma-def98.2%
Simplified98.2%
Taylor expanded in a around 0 66.6%
mul-1-neg66.6%
unsub-neg66.6%
associate-/l*91.9%
Simplified91.9%
Final simplification89.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3800000.0) (not (<= t 1.22e+67))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3800000.0) || !(t <= 1.22e+67)) {
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 <= (-3800000.0d0)) .or. (.not. (t <= 1.22d+67))) 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 <= -3800000.0) || !(t <= 1.22e+67)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3800000.0) or not (t <= 1.22e+67): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3800000.0) || !(t <= 1.22e+67)) 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 <= -3800000.0) || ~((t <= 1.22e+67))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3800000.0], N[Not[LessEqual[t, 1.22e+67]], $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 -3800000 \lor \neg \left(t \leq 1.22 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -3.8e6 or 1.22000000000000004e67 < t Initial program 69.2%
+-commutative69.2%
associate-*l/96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in t around inf 85.4%
+-commutative85.4%
Simplified85.4%
if -3.8e6 < t < 1.22000000000000004e67Initial program 94.3%
Taylor expanded in t around 0 71.2%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -45000000.0) (+ x y) (if (<= t 7.2e+68) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -45000000.0) {
tmp = x + y;
} else if (t <= 7.2e+68) {
tmp = x + (y * (z / 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 <= (-45000000.0d0)) then
tmp = x + y
else if (t <= 7.2d+68) then
tmp = x + (y * (z / 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 <= -45000000.0) {
tmp = x + y;
} else if (t <= 7.2e+68) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -45000000.0: tmp = x + y elif t <= 7.2e+68: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -45000000.0) tmp = Float64(x + y); elseif (t <= 7.2e+68) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -45000000.0) tmp = x + y; elseif (t <= 7.2e+68) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -45000000.0], N[(x + y), $MachinePrecision], If[LessEqual[t, 7.2e+68], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -45000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+68}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.5e7 or 7.1999999999999998e68 < t Initial program 69.2%
+-commutative69.2%
associate-*l/96.6%
fma-def96.6%
Simplified96.6%
Taylor expanded in t around inf 85.4%
+-commutative85.4%
Simplified85.4%
if -4.5e7 < t < 7.1999999999999998e68Initial program 94.3%
+-commutative94.3%
associate-*l/92.3%
fma-def92.3%
Simplified92.3%
Taylor expanded in t around 0 71.2%
+-commutative71.2%
associate-/l*75.5%
Simplified75.5%
clear-num75.5%
associate-/r/75.5%
clear-num75.5%
Applied egg-rr75.5%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -7.8e+182) x (if (<= a 2.7e+148) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.8e+182) {
tmp = x;
} else if (a <= 2.7e+148) {
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 (a <= (-7.8d+182)) then
tmp = x
else if (a <= 2.7d+148) 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 (a <= -7.8e+182) {
tmp = x;
} else if (a <= 2.7e+148) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.8e+182: tmp = x elif a <= 2.7e+148: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.8e+182) tmp = x; elseif (a <= 2.7e+148) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.8e+182) tmp = x; elseif (a <= 2.7e+148) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.8e+182], x, If[LessEqual[a, 2.7e+148], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{+182}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+148}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.7999999999999998e182 or 2.70000000000000019e148 < a Initial program 86.7%
+-commutative86.7%
associate-*l/97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in y around 0 63.4%
if -7.7999999999999998e182 < a < 2.70000000000000019e148Initial program 82.8%
+-commutative82.8%
associate-*l/93.1%
fma-def93.1%
Simplified93.1%
Taylor expanded in t around inf 67.1%
+-commutative67.1%
Simplified67.1%
Final simplification66.2%
(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 83.8%
+-commutative83.8%
associate-*l/94.1%
fma-def94.1%
Simplified94.1%
Taylor expanded in y around 0 50.2%
Final simplification50.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 2023271
(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))))